SDK: Implement Topology ctor

This commit is contained in:
Dennis Klein 2019-07-19 16:58:47 +02:00 committed by Dennis Klein
parent 53be96d93c
commit 44da054e78
4 changed files with 10 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -9,6 +9,7 @@
#ifndef FAIR_MQ_SDK_TOPOLOGY_H
#define FAIR_MQ_SDK_TOPOLOGY_H
#include <DDS/Topology.h>
#include <memory>
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

View File

@ -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