mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 17:41:45 +00:00
SDK: Implement DDS helpers
This commit is contained in:
committed by
Dennis Klein
parent
90496c89fe
commit
cfcdd666bf
@@ -69,7 +69,6 @@ struct DDSSession::Impl
|
||||
|
||||
~Impl()
|
||||
{
|
||||
fSession.stop();
|
||||
fSession.shutdown();
|
||||
}
|
||||
|
||||
@@ -136,6 +135,39 @@ auto DDSSession::SubmitAgents(Quantity agents, DDSRMSPlugin plugin, const Path&
|
||||
blocker.Wait();
|
||||
}
|
||||
|
||||
auto DDSSession::RequestAgentInfo() -> void
|
||||
{
|
||||
dds::tools_api::SAgentInfoRequestData agentInfoInfo;
|
||||
tools::Semaphore blocker;
|
||||
auto agentInfoRequest = dds::tools_api::SAgentInfoRequest::makeRequest(agentInfoInfo);
|
||||
agentInfoRequest->setResponseCallback(
|
||||
[&](const dds::tools_api::SAgentInfoResponseData& _response) {
|
||||
LOG(debug) << "agent: " << _response.m_index << "/" << _response.m_activeAgentsCount;
|
||||
LOG(debug) << "info: " << _response.m_agentInfo;
|
||||
});
|
||||
agentInfoRequest->setMessageCallback(
|
||||
[](const dds::tools_api::SMessageResponseData& _message) { LOG(debug) << _message; });
|
||||
agentInfoRequest->setDoneCallback([&]() { blocker.Signal(); });
|
||||
fImpl->fSession.sendRequest<dds::tools_api::SAgentInfoRequest>(agentInfoRequest);
|
||||
blocker.Wait();
|
||||
}
|
||||
|
||||
auto DDSSession::ActivateTopology(Path topologyFile) -> void
|
||||
{
|
||||
dds::tools_api::STopologyRequestData topologyInfo;
|
||||
topologyInfo.m_updateType = dds::tools_api::STopologyRequestData::EUpdateType::ACTIVATE;
|
||||
topologyInfo.m_topologyFile = topologyFile.string();
|
||||
LOG(warn) << topologyFile.string() << " :::: " << topologyFile;
|
||||
|
||||
tools::Semaphore blocker;
|
||||
auto topologyRequest = dds::tools_api::STopologyRequest::makeRequest(topologyInfo);
|
||||
topologyRequest->setMessageCallback(
|
||||
[](const dds::tools_api::SMessageResponseData& _message) { LOG(debug) << _message; });
|
||||
topologyRequest->setDoneCallback([&]() { blocker.Signal(); });
|
||||
fImpl->fSession.sendRequest<dds::tools_api::STopologyRequest>(topologyRequest);
|
||||
blocker.Wait();
|
||||
}
|
||||
|
||||
auto operator<<(std::ostream& os, DDSSession session) -> std::ostream&
|
||||
{
|
||||
return os << "$DDS_SESSION_ID: " << session.GetId();
|
||||
|
Reference in New Issue
Block a user