SDK: Forward declare types where possible

This commit is contained in:
Dennis Klein 2019-07-19 20:49:56 +02:00 committed by Dennis Klein
parent eb9dcdd1f9
commit a9b4788756
5 changed files with 31 additions and 7 deletions

View File

@ -48,12 +48,12 @@ target_link_libraries(${target}
Boost::filesystem
FairLogger::FairLogger
StateMachine
DDS::dds_topology_lib # TODO Eventually hide this in the future
PRIVATE
Boost::boost
DDS::dds_intercom_lib
DDS::dds_tools_lib
DDS::dds_topology_lib
Tools
)
set_target_properties(${target} PROPERTIES

View File

@ -7,6 +7,7 @@
********************************************************************************/
#include "DDSSession.h"
#include "DDSEnvironment.h"
#include <DDS/Tools.h>
#include <boost/uuid/uuid_io.hpp>
@ -157,7 +158,6 @@ 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);

View File

@ -11,7 +11,6 @@
#include <boost/filesystem.hpp>
#include <cstdint>
#include <fairmq/sdk/DDSEnvironment.h>
#include <fairmq/sdk/DDSInfo.h>
#include <istream>
#include <memory>
@ -23,6 +22,8 @@ namespace fair {
namespace mq {
namespace sdk {
class DDSEnvironment;
/**
* @enum DDSRMSPlugin DDSSession.h <fairmq/sdk/DDSSession.h>
* @brief Supported DDS resource management system plugins

View File

@ -8,16 +8,26 @@
#include "Topology.h"
#include <DDS/Topology.h>
#include <utility>
namespace fair {
namespace mq {
namespace sdk {
Topology::Topology(dds::topology_api::CTopology topo)
struct Topology::Impl
{
Impl(dds::topology_api::CTopology topo)
: fDDSTopology(std::move(topo))
{}
dds::topology_api::CTopology fDDSTopology;
};
Topology::Topology(dds::topology_api::CTopology topo)
: fImpl(std::make_shared<Impl>(std::move(topo)))
{}
} // namespace sdk
} // namespace mq
} // namespace fair

View File

@ -9,8 +9,20 @@
#ifndef FAIR_MQ_SDK_TOPOLOGY_H
#define FAIR_MQ_SDK_TOPOLOGY_H
#include <DDS/Topology.h>
#include <fairmq/States.h>
#include <functional>
#include <memory>
#include <ostream>
#include <string>
#include <vector>
namespace dds {
namespace topology_api {
class CTopology;
} // namespace topology_api
} // namespace dds
namespace fair {
namespace mq {
@ -24,12 +36,13 @@ class Topology
{
public:
/// Construct a FairMQ topology from an existing DDS session via the dds::topology_api
/// @brief Construct a FairMQ topology from an existing DDS session via the dds::topology_api
/// @param topo An initialized CTopology object
explicit Topology(dds::topology_api::CTopology topo);
private:
dds::topology_api::CTopology fDDSTopology;
struct Impl;
std::shared_ptr<Impl> fImpl;
};
} // namespace sdk