diff --git a/fairmq/sdk/CMakeLists.txt b/fairmq/sdk/CMakeLists.txt index 5bdc2d9f..299d5da1 100644 --- a/fairmq/sdk/CMakeLists.txt +++ b/fairmq/sdk/CMakeLists.txt @@ -47,12 +47,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 diff --git a/fairmq/sdk/Topology.cxx b/fairmq/sdk/Topology.cxx index 86a6ffc3..2b22d327 100644 --- a/fairmq/sdk/Topology.cxx +++ b/fairmq/sdk/Topology.cxx @@ -14,7 +14,8 @@ namespace fair { namespace mq { namespace sdk { -Topology::Topology() +Topology::Topology(dds::topology_api::CTopology topo) + : fDDSTopology(std::move(topo)) {} } // namespace sdk diff --git a/fairmq/sdk/Topology.h b/fairmq/sdk/Topology.h index 5409fe2b..e6ed2bed 100644 --- a/fairmq/sdk/Topology.h +++ b/fairmq/sdk/Topology.h @@ -9,6 +9,7 @@ #ifndef FAIR_MQ_SDK_TOPOLOGY_H #define FAIR_MQ_SDK_TOPOLOGY_H +#include #include namespace fair { @@ -23,11 +24,12 @@ class Topology { public: - /// Construct a FairMQ topology from a existing DDS session via the dds::topology_api - /// @param topo a shared_ptr to an initialized CTopology object - explicit Topology(); + /// 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; }; } // namespace sdk diff --git a/test/sdk/_topology.cxx b/test/sdk/_topology.cxx index 42bf6bba..7449688b 100644 --- a/test/sdk/_topology.cxx +++ b/test/sdk/_topology.cxx @@ -14,9 +14,9 @@ namespace { using Topology = fair::mq::test::TopologyFixture; -TEST_F(Topology, Basic) +TEST_F(Topology, Construction) { - fair::mq::sdk::Topology topo; + fair::mq::sdk::Topology topo(mDDSTopology); } } // namespace