Added configuration to Context and fixed all the users.

This commit is contained in:
miha_vitorovic
2011-01-10 14:09:58 +01:00
parent 4b8bb07d61
commit df7a9fa073
12 changed files with 532 additions and 407 deletions

View File

@@ -26,8 +26,44 @@ using std::sscanf;
static osiSockAddr sendTo;
class ContextImpl : public Context {
public:
ContextImpl() :
_tr(new TransportRegistry()), _timer(new Timer("server thread",
lowPriority)), _conf(new SystemConfigurationImpl()) {
}
virtual ~ContextImpl() {
delete _tr;
delete _timer;
}
virtual Timer* getTimer() {
return _timer;
}
virtual TransportRegistry* getTransportRegistry() {
return _tr;
}
virtual Channel* getChannel(epics::pvAccess::pvAccessID) {
return 0;
}
virtual Transport* getSearchTransport() {
return 0;
}
virtual Configuration* getConfiguration() {
return _conf;
}
private:
TransportRegistry* _tr;
Timer* _timer;
Configuration* _conf;
};
class DummyResponseHandler : public ResponseHandler {
public:
DummyResponseHandler(Context* ctx) :
ResponseHandler(ctx) {
}
virtual void handleResponse(osiSockAddr* responseFrom,
Transport* transport, int8 version, int8 command, int payloadSize,
ByteBuffer* payloadBuffer) {
@@ -69,9 +105,10 @@ private:
void testBlockingUDPSender() {
BlockingUDPConnector connector(false, NULL, true);
ContextImpl ctx;
DummyTransportSender dts;
DummyResponseHandler drh;
DummyResponseHandler drh(&ctx);
osiSockAddr bindAddr;