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

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

#include <ddsPub.hpp>

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

Public Member Functions

 DdsPub (std::string qos_library="RtcTk_Default_Library", std::string qos_profile="RtcTk_Default_Profile")
 
virtual ~DdsPub ()
 
void CreatePublisher ()
 Creates DDS publisher. More...
 
void DestroyPublisher ()
 Destroys DDS publisher. More...
 
TypedDataWriterCreateDataWriter (Topic *topic, DataWriterListener *listener=nullptr)
 Creates DDS writer for particular topic for topic of type: rtctk::AgnosticTopic. More...
 
void DestroyDataWriter (TypedDataWriter *dw, bool to_be_removed=true)
 Destroys DDS data writer. More...
 
void CreateDataWriters ()
 Creates DDS Data Writer for all DDS topics. More...
 
void DestroyAllDataWriters ()
 Destroys DDS Data Writer for all DDS topics. More...
 
void CreateManyDataWriters (std::vector< DdsTopicWriterListener > const &)
 create DDS topics and DDS writers for the given list (vector) of topic names and #DdsWriterListener Internally it calls for each topic name CreateTopic, and on the created topic CreateDataWriter. More...
 
void CreateManyDataWriters (std::vector< std::string > const &topic_names)
 create DDS topics and DDS writers for the given list of topic names Internally it calls for each topic name CreateTopic, and on the created topic CreateDataWriter. More...
 
void DumpDDSstatistics ()
 Dumps / logs varios DDS statistic like NACks, ACKs, ... More...
 
std::list< TypedDataWriter * > & GetDataWriters ()
 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 publishing is concentrated in this class.

Note
Please refer to RTI DDS documentation for details of DDS

Constructor & Destructor Documentation

◆ DdsPub()

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

◆ ~DdsPub()

rtctk::componentFramework::DdsPub::~DdsPub ( )
virtual

Member Function Documentation

◆ CreateDataWriter()

TypedDataWriter * rtctk::componentFramework::DdsPub::CreateDataWriter ( Topic *  topic,
DataWriterListener *  listener = nullptr 
)

Creates DDS writer for particular topic for topic of type: rtctk::AgnosticTopic.

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

◆ CreateDataWriters()

void rtctk::componentFramework::DdsPub::CreateDataWriters ( )

Creates DDS Data Writer for all DDS topics.

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

◆ CreateManyDataWriters() [1/2]

void rtctk::componentFramework::DdsPub::CreateManyDataWriters ( std::vector< DdsTopicWriterListener > const &  topics_listeners)

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

◆ CreateManyDataWriters() [2/2]

void rtctk::componentFramework::DdsPub::CreateManyDataWriters ( std::vector< std::string > const &  topic_names)

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

◆ CreatePublisher()

void rtctk::componentFramework::DdsPub::CreatePublisher ( )

Creates DDS publisher.

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

◆ DestroyAllDataWriters()

void rtctk::componentFramework::DdsPub::DestroyAllDataWriters ( )

Destroys DDS Data Writer for all DDS topics.

Internal it calls DestroyDataWriter for each data write for each topic from the internal topic map.

◆ DestroyDataWriter()

void rtctk::componentFramework::DdsPub::DestroyDataWriter ( TypedDataWriter dw,
bool  to_be_removed = true 
)

Destroys DDS data writer.

Parameters
dwDDS Data writter to be destroyed
toBeRemovedflag that indicates if the data writer should be also removed from internal map. Default is to be removed.

◆ DestroyPublisher()

void rtctk::componentFramework::DdsPub::DestroyPublisher ( )

Destroys DDS publisher.

As there is just one publisher is should be called ast most once.

◆ DumpDDSstatistics()

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

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

for each DDS writer

Reimplemented from rtctk::componentFramework::Dds.

◆ GetDataWriters()

std::list<TypedDataWriter *>& rtctk::componentFramework::DdsPub::GetDataWriters ( )
inline

returns vector of all DDS Data writers


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