RTC Toolkit  1.0.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rtctk::componentFramework::Dds Class Reference

Common functionallty needed to create DDS entities like participant and topic that can be later used (extent) for DDS data publishing and subscribing . More...

#include <dds.hpp>

Inheritance diagram for rtctk::componentFramework::Dds:
rtctk::componentFramework::DdsPub rtctk::componentFramework::DdsSub

Public Member Functions

 Dds (std::string qos_library="RtcTk_Default_Library", std::string qos_profile="RtcTk_Default_Profile")
 
virtual ~Dds () noexcept
 
 Dds (Dds &&rhs)=delete
 
Ddsoperator= (Dds &&rhs)=delete
 
void SetQosLibrary (std::string &qos_library)
 Set RTI DDS QoS library after creation. More...
 
void SetQosProfile (std::string &qos_profile)
 Set RTI DDS QoS profile after creation. More...
 
void SetInterfaceWhiteList (const std::vector< std::string > &iwl)
 Sets the interfaces that can be used for DDS sample traffic i.e. More...
 
void CreateParticipant ()
 Creates DDS participant. More...
 
void DestroyParticipant ()
 Destroys DDS participant created in CreateParticipant. More...
 
Topic * CreateTopic (const std::string &topic_name)
 Creates DDS topic. More...
 
void DestroyTopic (Topic *topic, bool to_be_removed=true)
 Destroys DDS topic. More...
 
void CreateManyTopics (std::vector< std::string > &topic_names)
 Creates many DDS topics. More...
 
void DestroyAllTopics ()
 Destroys all DDS topics from internal map. More...
 
virtual void DumpDDSstatistics ()
 Dumps / logs varios DDS statistic like NACks, ACKs, ... More...
 
size_t GetNumberOfTopics () const noexcept
 
const std::string GetTopicName (size_t index) const noexcept
 

Protected Member Functions

int PrintDDSParticipantQoSProperty (DomainParticipantQos &participant_qos, const char *prop, const char *sf="")
 
int SetDDSParticipantQoSProperty (DomainParticipantQos &participant_qos, const char *prop, const char *value, const char *sf="")
 

Protected Attributes

DomainParticipantFactory * m_factory
 
DomainParticipant * m_participant
 
std::string m_qos_library
 
std::string m_qos_profile
 
std::vector< std::string > m_interfaceWhiteList
 
std::vector< Topic * > m_topics
 

Detailed Description

Common functionallty needed to create DDS entities like participant and topic that can be later used (extent) for DDS data publishing and subscribing .

Note
Please refer to FastDDS / RTI DDS documentation for details of DDS

Constructor & Destructor Documentation

◆ Dds() [1/2]

rtctk::componentFramework::Dds::Dds ( std::string  qos_library = "RtcTk_Default_Library",
std::string  qos_profile = "RtcTk_Default_Profile" 
)
Parameters
qos_libraryRTI DDS QoS library (please refer to RTI DDS documentation for details)
qos_profileRTI DDS QoS profile (please refer to RTI DDS documentation for details)

◆ ~Dds()

rtctk::componentFramework::Dds::~Dds ( )
virtualnoexcept

◆ Dds() [2/2]

rtctk::componentFramework::Dds::Dds ( Dds &&  rhs)
delete

Member Function Documentation

◆ CreateManyTopics()

void rtctk::componentFramework::Dds::CreateManyTopics ( std::vector< std::string > &  topic_names)

Creates many DDS topics.

Internal it calls #createTopic, and add created topic to internal map.

Parameters
topic_namesvector of names for topic to be created.

◆ CreateParticipant()

void rtctk::componentFramework::Dds::CreateParticipant ( )

Creates DDS participant.

It is enough to have one particpant, so this shall be called just once.

◆ CreateTopic()

Topic * rtctk::componentFramework::Dds::CreateTopic ( const std::string &  topic_name)

Creates DDS topic.

It has to be called after DDS publisher has been created. It checks if the topic with the provided name already exists, and if exists returns it.

Parameters
topic_namename of the DDS topic to be created.
Returns
created or already existing DDS topic

◆ DestroyAllTopics()

void rtctk::componentFramework::Dds::DestroyAllTopics ( )

Destroys all DDS topics from internal map.

Internal it calls #destroyDDSTopic.

◆ DestroyParticipant()

void rtctk::componentFramework::Dds::DestroyParticipant ( )

Destroys DDS participant created in CreateParticipant.

As there should be just one participant this method should be called at most once.

◆ DestroyTopic()

void rtctk::componentFramework::Dds::DestroyTopic ( Topic *  topic,
bool  to_be_removed = true 
)

Destroys DDS topic.

Parameters
topicDDS topic to be destroyed
to_be_removedflag that indicates if the topic should be also removed from internal map. Default is to be removed.

◆ DumpDDSstatistics()

void rtctk::componentFramework::Dds::DumpDDSstatistics ( )
virtual

Dumps / logs varios DDS statistic like NACks, ACKs, ...

for each DDS writer

Reimplemented in rtctk::componentFramework::DdsSub, and rtctk::componentFramework::DdsPub.

◆ GetNumberOfTopics()

size_t rtctk::componentFramework::Dds::GetNumberOfTopics ( ) const
noexcept

◆ GetTopicName()

const std::string rtctk::componentFramework::Dds::GetTopicName ( size_t  index) const
noexcept

◆ operator=()

Dds& rtctk::componentFramework::Dds::operator= ( Dds &&  rhs)
delete

◆ PrintDDSParticipantQoSProperty()

int rtctk::componentFramework::Dds::PrintDDSParticipantQoSProperty ( DomainParticipantQos &  participant_qos,
const char *  prop,
const char *  sf = "" 
)
protected

◆ SetDDSParticipantQoSProperty()

int rtctk::componentFramework::Dds::SetDDSParticipantQoSProperty ( DomainParticipantQos &  participant_qos,
const char *  prop,
const char *  value,
const char *  sf = "" 
)
protected

◆ SetInterfaceWhiteList()

void rtctk::componentFramework::Dds::SetInterfaceWhiteList ( const std::vector< std::string > &  iwl)

Sets the interfaces that can be used for DDS sample traffic i.e.

interface whit list or allowed interfaces.

Note
Method needs to be called before calling CreateParticipant, otherwise the white list want be taken.
Parameters
iwllist of interfaces that can be used

◆ SetQosLibrary()

void rtctk::componentFramework::Dds::SetQosLibrary ( std::string &  qos_library)
inline

Set RTI DDS QoS library after creation.

Parameters
qos_libraryRTI DDS QoS library (please refer to RTI DDS documentation for details)

◆ SetQosProfile()

void rtctk::componentFramework::Dds::SetQosProfile ( std::string &  qos_profile)
inline

Set RTI DDS QoS profile after creation.

Parameters
qos_profileRTI DDS QoS profile (please refer to RTI DDS documentation for details)

Member Data Documentation

◆ m_factory

DomainParticipantFactory* rtctk::componentFramework::Dds::m_factory
protected

◆ m_interfaceWhiteList

std::vector<std::string> rtctk::componentFramework::Dds::m_interfaceWhiteList
protected

◆ m_participant

DomainParticipant* rtctk::componentFramework::Dds::m_participant
protected

◆ m_qos_library

std::string rtctk::componentFramework::Dds::m_qos_library
protected

◆ m_qos_profile

std::string rtctk::componentFramework::Dds::m_qos_profile
protected

◆ m_topics

std::vector<Topic *> rtctk::componentFramework::Dds::m_topics
protected

The documentation for this class was generated from the following files: