FairMQ: Move static and interactive control modes to plugin

NOT YET FINISHED
This commit is contained in:
Dennis Klein
2017-09-14 02:10:00 +02:00
committed by Mohammad Al-Turany
parent 2af3ae99eb
commit 10f67e4c72
9 changed files with 223 additions and 113 deletions

View File

@@ -24,35 +24,6 @@
template<typename TMQDevice>
inline int runStateMachine(TMQDevice& device, FairMQProgOptions& cfg)
{
device.RegisterChannelEndpoints();
if (cfg.Count("print-channels"))
{
device.PrintRegisteredChannels();
device.ChangeState(TMQDevice::END);
return 0;
}
if (cfg.Count("version"))
{
std::cout << "User device version: " << device.GetVersion() << std::endl;
std::cout << "FAIRMQ_INTERFACE_VERSION: " << FAIRMQ_INTERFACE_VERSION << std::endl;
device.ChangeState(TMQDevice::END);
return 0;
}
if (cfg.GetValue<int>("catch-signals") > 0)
{
device.CatchSignals();
}
else
{
LOG(WARN) << "Signal handling (e.g. ctrl+C) has been deactivated via command line argument";
}
LOG(DEBUG) << "PID: " << getpid();
device.SetConfig(cfg);
std::string config = cfg.GetValue<std::string>("config");
std::string control = cfg.GetValue<std::string>("control");