Added configuration to Context and fixed all the users.
This commit is contained in:
@@ -21,10 +21,42 @@ using std::endl;
|
||||
using std::hex;
|
||||
using std::dec;
|
||||
|
||||
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() :
|
||||
packets(0) {
|
||||
DummyResponseHandler(Context* context) :
|
||||
ResponseHandler(context), packets(0) {
|
||||
}
|
||||
|
||||
int getPackets() {
|
||||
@@ -71,8 +103,9 @@ void DummyResponseHandler::handleResponse(osiSockAddr* responseFrom,
|
||||
|
||||
void testBlockingUDPConnector() {
|
||||
BlockingUDPConnector connector(false, NULL, true);
|
||||
ContextImpl ctx;
|
||||
|
||||
DummyResponseHandler drh;
|
||||
DummyResponseHandler drh(&ctx);
|
||||
|
||||
osiSockAddr bindAddr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user