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 Boost::filesystem
FairLogger::FairLogger FairLogger::FairLogger
StateMachine StateMachine
DDS::dds_topology_lib # TODO Eventually hide this in the future
PRIVATE PRIVATE
Boost::boost Boost::boost
DDS::dds_intercom_lib DDS::dds_intercom_lib
DDS::dds_tools_lib DDS::dds_tools_lib
DDS::dds_topology_lib
Tools Tools
) )
set_target_properties(${target} PROPERTIES set_target_properties(${target} PROPERTIES

View File

@ -7,6 +7,7 @@
********************************************************************************/ ********************************************************************************/
#include "DDSSession.h" #include "DDSSession.h"
#include "DDSEnvironment.h"
#include <DDS/Tools.h> #include <DDS/Tools.h>
#include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_io.hpp>
@ -157,7 +158,6 @@ auto DDSSession::ActivateTopology(Path topologyFile) -> void
dds::tools_api::STopologyRequestData topologyInfo; dds::tools_api::STopologyRequestData topologyInfo;
topologyInfo.m_updateType = dds::tools_api::STopologyRequestData::EUpdateType::ACTIVATE; topologyInfo.m_updateType = dds::tools_api::STopologyRequestData::EUpdateType::ACTIVATE;
topologyInfo.m_topologyFile = topologyFile.string(); topologyInfo.m_topologyFile = topologyFile.string();
LOG(warn) << topologyFile.string() << " :::: " << topologyFile;
tools::Semaphore blocker; tools::Semaphore blocker;
auto topologyRequest = dds::tools_api::STopologyRequest::makeRequest(topologyInfo); auto topologyRequest = dds::tools_api::STopologyRequest::makeRequest(topologyInfo);

View File

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

View File

@ -8,14 +8,24 @@
#include "Topology.h" #include "Topology.h"
#include <DDS/Topology.h>
#include <utility> #include <utility>
namespace fair { namespace fair {
namespace mq { namespace mq {
namespace sdk { namespace sdk {
Topology::Topology(dds::topology_api::CTopology topo) struct Topology::Impl
{
Impl(dds::topology_api::CTopology topo)
: fDDSTopology(std::move(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 sdk

View File

@ -9,8 +9,20 @@
#ifndef FAIR_MQ_SDK_TOPOLOGY_H #ifndef FAIR_MQ_SDK_TOPOLOGY_H
#define FAIR_MQ_SDK_TOPOLOGY_H #define FAIR_MQ_SDK_TOPOLOGY_H
#include <DDS/Topology.h> #include <fairmq/States.h>
#include <functional>
#include <memory> #include <memory>
#include <ostream>
#include <string>
#include <vector>
namespace dds {
namespace topology_api {
class CTopology;
} // namespace topology_api
} // namespace dds
namespace fair { namespace fair {
namespace mq { namespace mq {
@ -24,12 +36,13 @@ class Topology
{ {
public: 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 /// @param topo An initialized CTopology object
explicit Topology(dds::topology_api::CTopology topo); explicit Topology(dds::topology_api::CTopology topo);
private: private:
dds::topology_api::CTopology fDDSTopology; struct Impl;
std::shared_ptr<Impl> fImpl;
}; };
} // namespace sdk } // namespace sdk