Convert factory methods to return smart ptrs

- Convert factory methods to return smart ptrs.
 - Refactor state machine to use same thread for user states.
 - Remove unused includes and dependencies, use std.
This commit is contained in:
Alexey Rybalchenko 2016-11-16 16:27:21 +01:00 committed by Mohammad Al-Turany
parent c86bfd97a8
commit e255372043
4 changed files with 63 additions and 21 deletions

View File

@ -15,7 +15,7 @@ void addCustomOptions(bpo::options_description& /*options*/)
{
}
FairMQDevicePtr getDevice(const FairMQProgOptions& config)
FairMQDevicePtr getDevice(const FairMQProgOptions& /*config*/)
{
return new FairMQExample3Processor();
}

View File

@ -35,7 +35,7 @@ void FairMQExample6Sampler::InitTask()
void FairMQExample6Sampler::Run()
{
unique_ptr<FairMQPoller> poller(fTransportFactory->CreatePoller(fChannels, { "data", "broadcast" }));
FairMQPollerPtr poller(fTransportFactory->CreatePoller(fChannels, { "data", "broadcast" }));
while (CheckCurrentState(RUNNING))
{

View File

@ -0,0 +1,60 @@
{
"fairMQOptions": {
"devices": [
{
"id": "sampler1",
"channels": [
{
"name": "data-out",
"sockets": [
{
"type": "push",
"method": "connect",
"address": "tcp://localhost:5555,tcp://localhost:5556",
"sndBufSize": 1000,
"rcvBufSize": 1000,
"rateLogging": 0
}
]
}
]
},
{
"id": "sink1",
"channels": [
{
"name": "data-in",
"sockets": [
{
"type": "pull",
"method": "bind",
"address": "tcp://*:5555",
"sndBufSize": 1000,
"rcvBufSize": 1000,
"rateLogging": 0
}
]
}
]
},
{
"id": "sink2",
"channels": [
{
"name": "data-in",
"sockets": [
{
"type": "pull",
"method": "connect",
"address": "@tcp://*:5556",
"sndBufSize": 1000,
"rcvBufSize": 1000,
"rateLogging": 0
}
]
}
]
}
]
}
}

View File

@ -10,7 +10,7 @@
{
"type": "push",
"method": "connect",
"address": "tcp://localhost:5555,tcp://localhost:5556",
"address": "tcp://localhost:5555",
"sndBufSize": 1000,
"rcvBufSize": 1000,
"rateLogging": 0
@ -36,24 +36,6 @@
]
}
]
},
{
"id": "sink2",
"channels": [
{
"name": "data-in",
"sockets": [
{
"type": "pull",
"method": "connect",
"address": "@tcp://*:5556",
"sndBufSize": 1000,
"rcvBufSize": 1000,
"rateLogging": 0
}
]
}
]
}
]
}