mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
FairMQ: Add dump-config functionality to DDS plugin
This commit is contained in:
committed by
Mohammad Al-Turany
parent
511141c851
commit
7429f7a326
@@ -10,6 +10,8 @@
|
||||
|
||||
#include <termios.h> // for the interactive mode
|
||||
#include <poll.h> // for the interactive mode
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -89,7 +91,7 @@ auto DDS::HandleControl() -> void
|
||||
}
|
||||
|
||||
// subscribe for state changes from DDS (subscriptions start firing after fService.start() is called)
|
||||
SubscribeForStateChanges();
|
||||
SubscribeForCustomCommands();
|
||||
|
||||
// start DDS service - subscriptions will only start firing after this step
|
||||
fService.start();
|
||||
@@ -201,7 +203,7 @@ auto DDS::PublishBoundChannels() -> void
|
||||
}
|
||||
}
|
||||
|
||||
auto DDS::SubscribeForStateChanges() -> void
|
||||
auto DDS::SubscribeForCustomCommands() -> void
|
||||
{
|
||||
string id = GetProperty<string>("id");
|
||||
string pid(to_string(getpid()));
|
||||
@@ -230,6 +232,15 @@ auto DDS::SubscribeForStateChanges() -> void
|
||||
fStopCondition.notify_one();
|
||||
}
|
||||
}
|
||||
else if (cmd == "dump-config")
|
||||
{
|
||||
stringstream ss;
|
||||
for (const auto pKey: GetPropertyKeys())
|
||||
{
|
||||
ss << id << ": " << pKey << " -> " << GetPropertyAsString(pKey) << endl;
|
||||
}
|
||||
fDDSCustomCmd.send(ss.str(), to_string(senderId));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARN) << "Unknown command: " << cmd;
|
||||
|
Reference in New Issue
Block a user