mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-16 10:01:47 +00:00
Update DDS example to use new library and names
This commit is contained in:
committed by
Mohammad Al-Turany
parent
830ba948f0
commit
e818174126
@@ -1,5 +1,5 @@
|
||||
// DDS
|
||||
#include "CustomCmd.h"
|
||||
#include "dds_intercom.h" // DDS
|
||||
|
||||
// STD
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
@@ -8,8 +8,7 @@
|
||||
#include <atomic>
|
||||
|
||||
using namespace std;
|
||||
using namespace dds;
|
||||
using namespace custom_cmd;
|
||||
using namespace dds::intercom_api;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
@@ -17,14 +16,14 @@ int main(int argc, char* argv[])
|
||||
{
|
||||
CCustomCmd ddsCustomCmd;
|
||||
|
||||
ddsCustomCmd.subscribeCmd([](const string& command, const string& condition, uint64_t senderId)
|
||||
ddsCustomCmd.subscribe([](const string& command, const string& condition, uint64_t senderId)
|
||||
{
|
||||
cout << "Received: \"" << command << "\"" << endl;
|
||||
});
|
||||
|
||||
while (true)
|
||||
{
|
||||
int result = ddsCustomCmd.sendCmd("check-state", "");
|
||||
int result = ddsCustomCmd.send("check-state", "");
|
||||
|
||||
if (result == 1)
|
||||
{
|
||||
@@ -34,11 +33,11 @@ int main(int argc, char* argv[])
|
||||
this_thread::sleep_for(chrono::seconds(1));
|
||||
}
|
||||
}
|
||||
catch (exception& _e)
|
||||
catch (exception& e)
|
||||
{
|
||||
cerr << "Error: " << _e.what() << endl;
|
||||
cerr << "Error: " << e.what() << endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user