mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
- create 3 test scripts for bin, boost, and root serialization format
- print message at the end of the data generator of GenericDevices tutorial
This commit is contained in:
parent
76626b4f4b
commit
89d57db5ea
|
@ -69,6 +69,51 @@ inline int runStateMachine(TMQDevice& device, FairMQProgOptions& config)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename TMQDevice>
|
||||||
|
inline int runNonInteractiveStateMachine(TMQDevice& device, FairMQProgOptions& config)
|
||||||
|
{
|
||||||
|
device.CatchSignals();
|
||||||
|
std::string jsonfile = config.GetValue<std::string>("config-json-file");
|
||||||
|
std::string id = config.GetValue<std::string>("id");
|
||||||
|
int ioThreads = config.GetValue<int>("io-threads");
|
||||||
|
|
||||||
|
config.UserParser<FairMQParser::JSON>(jsonfile, id);
|
||||||
|
|
||||||
|
device.fChannels = config.GetFairMQMap();
|
||||||
|
|
||||||
|
device.SetProperty(TMQDevice::Id, id);
|
||||||
|
device.SetProperty(TMQDevice::NumIoThreads, ioThreads);
|
||||||
|
|
||||||
|
LOG(INFO) << "PID: " << getpid();
|
||||||
|
|
||||||
|
#ifdef NANOMSG
|
||||||
|
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||||
|
#else
|
||||||
|
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
device.SetTransport(transportFactory);
|
||||||
|
|
||||||
|
device.ChangeState(TMQDevice::INIT_DEVICE);
|
||||||
|
device.WaitForEndOfState(TMQDevice::INIT_DEVICE);
|
||||||
|
|
||||||
|
device.ChangeState(TMQDevice::INIT_TASK);
|
||||||
|
device.WaitForEndOfState(TMQDevice::INIT_TASK);
|
||||||
|
|
||||||
|
device.ChangeState(TMQDevice::RUN);
|
||||||
|
device.WaitForEndOfState(TMQDevice::RUN);
|
||||||
|
|
||||||
|
device.ChangeState(TMQDevice::RESET_TASK);
|
||||||
|
device.WaitForEndOfState(TMQDevice::RESET_TASK);
|
||||||
|
|
||||||
|
device.ChangeState(TMQDevice::RESET_DEVICE);
|
||||||
|
device.WaitForEndOfState(TMQDevice::RESET_DEVICE);
|
||||||
|
|
||||||
|
device.ChangeState(TMQDevice::END);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif /* RUNSIMPLEMQSTATEMACHINE_H */
|
#endif /* RUNSIMPLEMQSTATEMACHINE_H */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user