mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
Remove compile time transport interface switch
- Remove the compile time check of the transport implementation. The transport (zeromq/nanomsg) can be chosen at run time with: `device.SetTransport("zeromq"); // possible values are "zeromq" and "nanomsg"`. For devices that use FairMQProgOptions, the transport can be configured via cmd option: `--transport zeromq` or `--transport nanomsg`. Default values is "zeromq". The device receives the configured value with: `device.SetTransport(config.GetValue<std::string>("transport"));` Old method of setting transport still works. But the NANOMSG constant is not defined. - Remove old `fairmq/prototest` directory. It was only used as a test for protobuf. The protobuf part of Tutorial3 does the same (with different values). - Fix a bug in FairMQPollerNN, where the `revents` value was not initialized. This caused the `poller->CheckOutput()` to trigger when it should not.
This commit is contained in:
@@ -16,13 +16,6 @@
|
||||
/// boost
|
||||
#include "boost/program_options.hpp"
|
||||
|
||||
/// ZMQ/nmsg (in FairSoft)
|
||||
#ifdef NANOMSG
|
||||
#include "FairMQTransportFactoryNN.h"
|
||||
#else
|
||||
#include "FairMQTransportFactoryZMQ.h"
|
||||
#endif
|
||||
|
||||
/// FairRoot - FairMQ
|
||||
#include "FairMQLogger.h"
|
||||
#include "FairMQParser.h"
|
||||
@@ -47,13 +40,7 @@ inline int runStateMachine(TMQDevice& device, FairMQProgOptions& config)
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
#ifdef NANOMSG
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||
#else
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
|
||||
#endif
|
||||
|
||||
device.SetTransport(transportFactory);
|
||||
device.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
device.ChangeState(TMQDevice::INIT_DEVICE);
|
||||
device.WaitForEndOfState(TMQDevice::INIT_DEVICE);
|
||||
@@ -84,13 +71,7 @@ inline int runNonInteractiveStateMachine(TMQDevice& device, FairMQProgOptions& c
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
#ifdef NANOMSG
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||
#else
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
|
||||
#endif
|
||||
|
||||
device.SetTransport(transportFactory);
|
||||
device.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
device.ChangeState(TMQDevice::INIT_DEVICE);
|
||||
device.WaitForEndOfState(TMQDevice::INIT_DEVICE);
|
||||
|
Reference in New Issue
Block a user