mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-12-19 17:30:16 +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:
committed by
Mohammad Al-Turany
parent
71ecbe214d
commit
7ab6afa28a
@@ -10,6 +10,8 @@ configure_file(${CMAKE_SOURCE_DIR}/examples/MQ/5-req-rep/ex5-req-rep.json ${CMAK
|
||||
|
||||
Set(INCLUDE_DIRECTORIES
|
||||
${CMAKE_SOURCE_DIR}/fairmq
|
||||
${CMAKE_SOURCE_DIR}/fairmq/zeromq
|
||||
${CMAKE_SOURCE_DIR}/fairmq/nanomsg
|
||||
${CMAKE_SOURCE_DIR}/fairmq/devices
|
||||
${CMAKE_SOURCE_DIR}/fairmq/tools
|
||||
${CMAKE_SOURCE_DIR}/fairmq/options
|
||||
@@ -19,28 +21,10 @@ Set(INCLUDE_DIRECTORIES
|
||||
|
||||
Set(SYSTEM_INCLUDE_DIRECTORIES
|
||||
${Boost_INCLUDE_DIR}
|
||||
${ZMQ_INCLUDE_DIR}
|
||||
${NANOMSG_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
If(NANOMSG_FOUND)
|
||||
Set(INCLUDE_DIRECTORIES
|
||||
${INCLUDE_DIRECTORIES}
|
||||
${CMAKE_SOURCE_DIR}/fairmq/nanomsg
|
||||
)
|
||||
Set(SYSTEM_INCLUDE_DIRECTORIES
|
||||
${SYSTEM_INCLUDE_DIRECTORIES}
|
||||
${ZMQ_INCLUDE_DIR}
|
||||
)
|
||||
Else(NANOMSG_FOUND)
|
||||
Set(INCLUDE_DIRECTORIES
|
||||
${INCLUDE_DIRECTORIES}
|
||||
${CMAKE_SOURCE_DIR}/fairmq/zeromq
|
||||
)
|
||||
Set(SYSTEM_INCLUDE_DIRECTORIES
|
||||
${SYSTEM_INCLUDE_DIRECTORIES}
|
||||
${ZMQ_INCLUDE_DIR}
|
||||
)
|
||||
EndIf(NANOMSG_FOUND)
|
||||
|
||||
Include_Directories(${INCLUDE_DIRECTORIES})
|
||||
Include_Directories(SYSTEM ${SYSTEM_INCLUDE_DIRECTORIES})
|
||||
|
||||
|
||||
@@ -21,12 +21,6 @@
|
||||
#include "FairMQProgOptions.h"
|
||||
#include "FairMQExample5Client.h"
|
||||
|
||||
#ifdef NANOMSG
|
||||
#include "FairMQTransportFactoryNN.h"
|
||||
#else
|
||||
#include "FairMQTransportFactoryZMQ.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::program_options;
|
||||
|
||||
@@ -61,13 +55,7 @@ int main(int argc, char** argv)
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
#ifdef NANOMSG
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||
#else
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
|
||||
#endif
|
||||
|
||||
client.SetTransport(transportFactory);
|
||||
client.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
client.SetProperty(FairMQExample5Client::Id, id);
|
||||
client.SetProperty(FairMQExample5Client::Text, text);
|
||||
|
||||
@@ -21,12 +21,6 @@
|
||||
#include "FairMQProgOptions.h"
|
||||
#include "FairMQExample5Server.h"
|
||||
|
||||
#ifdef NANOMSG
|
||||
#include "FairMQTransportFactoryNN.h"
|
||||
#else
|
||||
#include "FairMQTransportFactoryZMQ.h"
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace boost::program_options;
|
||||
|
||||
@@ -53,13 +47,7 @@ int main(int argc, char** argv)
|
||||
|
||||
LOG(INFO) << "PID: " << getpid();
|
||||
|
||||
#ifdef NANOMSG
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryNN();
|
||||
#else
|
||||
FairMQTransportFactory* transportFactory = new FairMQTransportFactoryZMQ();
|
||||
#endif
|
||||
|
||||
server.SetTransport(transportFactory);
|
||||
server.SetTransport(config.GetValue<std::string>("transport"));
|
||||
|
||||
server.SetProperty(FairMQExample5Server::Id, id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user