Fixing bad mering and test for search manager
This commit is contained in:
@@ -6,12 +6,341 @@
|
||||
using namespace epics::pvData;
|
||||
using namespace epics::pvAccess;
|
||||
|
||||
//TODO this will be deleted
|
||||
class ChannelImpl;
|
||||
|
||||
class ContextImpl : public Context
|
||||
|
||||
{
|
||||
|
||||
private:
|
||||
|
||||
Timer* _timer;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
||||
ContextImpl()
|
||||
|
||||
{
|
||||
|
||||
_timer = new Timer("krneki",lowPriority);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual Version* getVersion() {
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual ChannelProvider* getProvider() {
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Timer* getTimer()
|
||||
|
||||
{
|
||||
|
||||
return _timer;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void initialize() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void printInfo() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void printInfo(epics::pvData::StringBuilder out) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void destroy()
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void dispose()
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
BlockingUDPTransport* getSearchTransport()
|
||||
|
||||
{
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Searches for a channel with given channel ID.
|
||||
|
||||
* @param channelID CID.
|
||||
|
||||
* @return channel with given CID, <code></code> if non-existent.
|
||||
|
||||
*/
|
||||
|
||||
Channel* getChannel(pvAccessID channelID)
|
||||
|
||||
{
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
Configuration* getConfiguration() {return NULL;}
|
||||
|
||||
TransportRegistry* getTransportRegistry() {return NULL;}
|
||||
|
||||
~ContextImpl() { delete _timer;};
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void loadConfiguration() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void internalInitialize() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void initializeUDPTransport() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void internalDestroy() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void destroyAllChannels() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Check channel name.
|
||||
|
||||
*/
|
||||
|
||||
void checkChannelName(String& name) {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Check context state and tries to establish necessary state.
|
||||
|
||||
*/
|
||||
|
||||
void checkState() {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Generate Client channel ID (CID).
|
||||
|
||||
* @return Client channel ID (CID).
|
||||
|
||||
*/
|
||||
|
||||
pvAccessID generateCID()
|
||||
|
||||
{
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Free generated channel ID (CID).
|
||||
|
||||
*/
|
||||
|
||||
void freeCID(int cid)
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Get, or create if necessary, transport of given server address.
|
||||
|
||||
* @param serverAddress required transport address
|
||||
|
||||
* @param priority process priority.
|
||||
|
||||
* @return transport for given address
|
||||
|
||||
*/
|
||||
|
||||
Transport* getTransport(TransportClient* client, osiSockAddr* serverAddress, int minorRevision, int priority)
|
||||
|
||||
{
|
||||
|
||||
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Internal create channel.
|
||||
|
||||
*/
|
||||
|
||||
// TODO no minor version with the addresses
|
||||
|
||||
// TODO what if there is an channel with the same name, but on different host!
|
||||
|
||||
Channel* createChannelInternal(String name, ChannelRequester* requester, short priority,
|
||||
|
||||
InetAddrVector* addresses) {
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Destroy channel.
|
||||
|
||||
* @param channel
|
||||
|
||||
* @param force
|
||||
|
||||
* @throws CAException
|
||||
|
||||
* @throws IllegalStateException
|
||||
|
||||
*/
|
||||
|
||||
void destroyChannel(ChannelImpl* channel, bool force) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Get channel search manager.
|
||||
|
||||
* @return channel search manager.
|
||||
|
||||
*/
|
||||
|
||||
ChannelSearchManager* getChannelSearchManager() {
|
||||
|
||||
return NULL;
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class TestSearcInstance : public BaseSearchInstance
|
||||
{
|
||||
public:
|
||||
TestSearcInstance(string channelName, pvAccessID channelID): _channelID(channelID), _channelName(channelName) {}
|
||||
pvAccessID getChannelID() { return _channelID;};
|
||||
string getChannelName() {return _channelName;};
|
||||
pvAccessID getSearchInstanceID() { return _channelID;};
|
||||
string getSearchInstanceName() {return _channelName;};
|
||||
void searchResponse(int8 minorRevision, osiSockAddr* serverAddress) {};
|
||||
private:
|
||||
pvAccessID _channelID;
|
||||
@@ -19,8 +348,8 @@ private:
|
||||
};
|
||||
|
||||
static const int max_channels = 100;
|
||||
ClientContextImpl* context = new ClientContextImpl();
|
||||
ChannelSearchManager* manager = new ChannelSearchManager(context);
|
||||
ContextImpl* context = new ContextImpl();
|
||||
ChannelSearchManager* manager = new ChannelSearchManager(static_cast<Context*>(context));
|
||||
TestSearcInstance** chanArray = new TestSearcInstance*[max_channels];
|
||||
|
||||
void* testWorker1(void* p)
|
||||
|
||||
Reference in New Issue
Block a user