18 #include "../../include/mm_radio/publisher.hpp" 19 #include "../../include/mm_radio/radio.hpp" 20 #include "../../include/mm_radio/subscriber.hpp" 27 std::cout <<
"oldtimer_foo : processing data: " << data << std::endl;
31 std::cout <<
"oldman_foo : processing data: " << data << std::endl;
38 int main(
int argc,
char **argv)
43 ecl::CmdLine cmd(
"Radio multiplexing, by default tests both sides on inproc, use the options to choose otherwise.");
44 ecl::SwitchArg oldman(
"m",
"oldman",
"Run the publisher only",
false);
45 ecl::SwitchArg oldtimer(
"t",
"oldtimer",
"Run the subscriber only",
false);
46 ecl::SwitchArg both(
"b",
"both",
"Run both the oldman and oldtimer inproc (instead of iproc)",
false);
47 std::vector<ecl::Arg*> xorlist;
48 xorlist.push_back(&oldman);
49 xorlist.push_back(&oldtimer);
50 xorlist.push_back(&both);
52 cmd.
parse(argc, argv);
54 const std::string inproc_address =
"inproc://radio";
55 const std::string ipc_address =
"ipc:///tmp/radio.ipc";
57 if ( oldman.
isSet() ) {
63 ecl::MilliSleep()(500);
65 }
else if ( oldtimer.
isSet() ) {
71 ecl::MilliSleep()(500);
74 }
else if ( both.
isSet() ) {
81 ecl::MilliSleep()(200);
82 for (
unsigned int i = 0; i < 4; ++i ) {
84 ecl::MilliSleep()(500);
86 ecl::MilliSleep()(500);
int main(int argc, char **argv)
void publish(const unsigned int &id, const T &msg)
void oldman_foo(std::string data)
static void startClient(const std::string &name, const std::string &url, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET)
Pre-establish named connections for a client.
static void startServer(const std::string &name, const std::string &url, const mm_messages::Verbosity::Level &verbosity=mm_messages::Verbosity::QUIET)
Pre-establish named connections for a server.
void parse(int argc, char **argv)
void xorAdd(Arg &a, Arg &b)
void oldtimer_foo(std::string data)