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

All functionallty needed to create DDS entities for DDS data subscribing is concentrated in this class. More...

#include <ddsSub.hpp>

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

Public Member Functions

 DdsSub (std::string qos_library="RtcTk_Default_Library", std::string qos_profile="RtcTk_Default_Profile")
 
virtual ~DdsSub ()
 
void CreateSubscriber ()
 Creates DDS subscriber. More...
 
TypedDataReaderCreateDataReader (Topic *topic, DataReaderListener *listener=nullptr, std::string multicast_address="")
 Creates DDS data reader for particular topic for topic of type: rtctk::AgnosticTopic. More...
 
void DestroyDataReader (TypedDataReader *dr, bool to_be_removed=true)
 Destroys DDS data reader. More...
 
void CreateDataReaders ()
 Creates DDS Data Reader for all DDS topics. More...
 
void EnableAllDataReaders ()
 
void DestroyAllDataReaders ()
 Destroys DDS Data Reader for all DDS topics. More...
 
void CreateManyDataReaders (std::vector< DdsTopicReaderListener > const &)
 create DDS topics and DDS readers for the given list (vector) of topic names and #DdsReaderListener Internally it calls for each topic name CreateTopic, and on the created topic CreateDataReader. More...
 
void CreateManyDataReaders (std::vector< std::string > &topic_names)
 create DDS topics and DDS readers for the given list of topic names Internally it calls for each topic name CreateTopic, and on the created topic CreateDataReader. More...
 
void DumpDDSstatistics ()
 Dumps / logs varios DDS statistic like NACks, ACKs, ... More...
 
std::list< TypedDataReader * > & GetDataReaders ()
 returns vector of all DDS Data writers More...
 
- Public Member Functions inherited from rtctk::componentFramework::Dds
 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...
 
size_t GetNumberOfTopics () const noexcept
 
const std::string GetTopicName (size_t index) const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from rtctk::componentFramework::Dds
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 inherited from rtctk::componentFramework::Dds
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

All functionallty needed to create DDS entities for DDS data subscribing is concentrated in this class.

Note
Please refer to RTI DDS documentation for details of DDS

Constructor & Destructor Documentation

◆ DdsSub()

rtctk::componentFramework::DdsSub::DdsSub ( 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)

◆ ~DdsSub()

rtctk::componentFramework::DdsSub::~DdsSub ( )
virtual

Member Function Documentation

◆ CreateDataReader()

TypedDataReader * rtctk::componentFramework::DdsSub::CreateDataReader ( Topic *  topic,
DataReaderListener *  listener = nullptr,
std::string  multicast_address = "" 
)

Creates DDS data reader for particular topic for topic of type: rtctk::AgnosticTopic.

Parameters
topicDDS topic for which DDS reader shall be created
Returns
created DDS data reader

◆ CreateDataReaders()

void rtctk::componentFramework::DdsSub::CreateDataReaders ( )

Creates DDS Data Reader for all DDS topics.

Internal it calls #createDataWriter for each topic from the internal topic map.

◆ CreateManyDataReaders() [1/2]

void rtctk::componentFramework::DdsSub::CreateManyDataReaders ( std::vector< DdsTopicReaderListener > const &  topics_listeners)

create DDS topics and DDS readers for the given list (vector) of topic names and #DdsReaderListener Internally it calls for each topic name CreateTopic, and on the created topic CreateDataReader.

◆ CreateManyDataReaders() [2/2]

void rtctk::componentFramework::DdsSub::CreateManyDataReaders ( std::vector< std::string > &  topic_names)

create DDS topics and DDS readers for the given list of topic names Internally it calls for each topic name CreateTopic, and on the created topic CreateDataReader.

◆ CreateSubscriber()

void rtctk::componentFramework::DdsSub::CreateSubscriber ( )

Creates DDS subscriber.

It is enough to have one subscriber, so this shall be called just once. It has to be called after DDS particpant has been created.

◆ DestroyAllDataReaders()

void rtctk::componentFramework::DdsSub::DestroyAllDataReaders ( )

Destroys DDS Data Reader for all DDS topics.

Internal it calls DestroyDataReader for each data reader for each topic from the internal topic map.

◆ DestroyDataReader()

void rtctk::componentFramework::DdsSub::DestroyDataReader ( TypedDataReader dr,
bool  to_be_removed = true 
)

Destroys DDS data reader.

Parameters
drDDS Data reader to be destroyed
to_be_removedflag that indicates if the data reader should be also removed from internal map. Default is to be removed.

◆ DumpDDSstatistics()

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

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

for each DDS writer

Reimplemented from rtctk::componentFramework::Dds.

◆ EnableAllDataReaders()

void rtctk::componentFramework::DdsSub::EnableAllDataReaders ( )

◆ GetDataReaders()

std::list<TypedDataReader *>& rtctk::componentFramework::DdsSub::GetDataReaders ( )
inline

returns vector of all DDS Data writers


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