26 #include "gtest/gtest.h"
27 #include <boost/property_tree/ptree.hpp>
28 #include <zmqpp/zmqpp.hpp>
41 template <
typename ModuleType>
43 const boost::property_tree::ptree &cfg)
47 nullptr,
nullptr, std::make_shared<ConfigChecker>(),
false);
48 ModuleType module(*ctx, pipe, cfg, u);
50 pipe->send(zmqpp::signal::ok);
64 template <
typename... Content>
65 bool bus_read_extract(zmqpp::message *m,
const char *first_arg, Content... content);
72 template <
typename T,
typename... Content>
73 typename std::enable_if<!std::is_same<const char *, T>::value,
bool>::type
78 if (value != first_arg)
87 template <
typename... Content>
93 if (strcmp(value.c_str(), first_arg) != 0)
102 template <
typename... Content>
103 bool bus_read(zmqpp::socket &sub, Content... content)
107 if (!sub.receive(msg))
124 virtual bool run_module(zmqpp::socket *pipe) = 0;
134 bus_sub_.connect(
"inproc://zmq-bus-pub");
135 bus_push_.connect(
"inproc://zmq-bus-pull");
148 module_actor_ = std::unique_ptr<zmqpp::actor>(
new zmqpp::actor(