|
RTC Toolkit 5.1.0
|
All functionality needed to create DDS entities for DDS data subscribing is concentrated in this class. More...
#include <rtctk/componentFramework/ddsSub.hpp>
Public Member Functions | |
| DdsSub (const std::string &qos_file, const std::string &qos_profile=DEFAULT_QOS_PROFILE, DomainId_t domain_id=DEFAULT_DOMAIN_ID, const std::string &participant_name="") | |
| ~DdsSub () override | |
| void | CreateSubscriber () |
| Creates DDS subscriber. | |
| void | DestroySubscriber () |
| Destroys DDS subscriber. | |
| DataReader * | CreateDataReader (Topic *topic, DataReaderListener *listener=nullptr, const std::string &multicast_address="") |
| Creates DDS data reader for particular topic for topic of type: rtctk::AgnosticTopic. | |
| void | DestroyDataReader (DataReader *dr, bool to_be_removed=true) |
| Destroys DDS data reader. | |
| void | CreateDataReaders () |
| Creates DDS Data Reader for all DDS topics. | |
| void | EnableAllDataReaders () |
| void | DestroyAllDataReaders () |
| Destroys DDS Data Reader for all DDS topics. | |
| void | CreateManyDataReaders (const std::vector< DdsReaderParams > &) |
| create DDS topics and DDS readers for the given list (vector) of topic names and rtctk::componentFramework::DdsReaderListener Internally it calls for each topic name CreateTopic, and on the created topic CreateDataReader. | |
| 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. | |
| void | DumpDDSstatistics () |
| Dumps / logs varios DDS statistic like NACks, ACKs, ... for each DDS writer. | |
| std::vector< DataReader * > & | GetDataReaders () |
| returns vector of all DDS Data writers | |
Public Member Functions inherited from rtctk::componentFramework::Dds | |
| Dds (const std::string &qos_file, const std::string &qos_profile=DEFAULT_QOS_PROFILE, DomainId_t domain_id=DEFAULT_DOMAIN_ID, const std::string &participant_name="") | |
| Constructor for Base class for both DDS Publisher and DDS Subscriber. | |
| virtual | ~Dds () noexcept |
| Dds (Dds &&rhs)=delete | |
| Dds & | operator= (Dds &&rhs)=delete |
| void | SetQosProfile (const std::string &qos_profile) |
| Set FastDDS QoS profile after creation. | |
| void | SetInterfaceWhiteList (const std::vector< std::string > &iwl) |
| Sets the interfaces that can be used for DDS sample traffic. | |
| void | SetParticipantName (const std::string &name) |
| Sets the name of the DDS Participant. | |
| void | CreateParticipant () |
| Creates DDS participant. | |
| void | DestroyParticipant () |
| Destroys DDS participant created in CreateParticipant. | |
| Topic * | CreateTopic (const std::string &topic_name) |
| Creates DDS topic. | |
| void | DestroyTopic (Topic *topic, bool to_be_removed=true) |
| Destroys DDS topic. | |
| void | CreateManyTopics (std::vector< std::string > &topic_names) |
| Creates many DDS topics. | |
| void | DestroyAllTopics () |
| Destroys all DDS topics from internal map. | |
| void | DumpDDSstatistics () |
| Dumps / logs varios DDS statistic like NACks, ACKs, ... for each DDS writer. | |
| size_t | GetNumberOfTopics () const noexcept |
| const std::string | GetTopicName (size_t index) const noexcept |
Additional Inherited Members | |
Static Public Attributes inherited from rtctk::componentFramework::Dds | |
| static const std::string | TELEM_DP_QOS_FILE = "telemDataPathDdsQos.xml" |
| default file name for different DDS QoSs | |
| static const std::string | DEFAULT_QOS_PROFILE = "RtcTk_Default_Profile" |
| default profile name for different DDS QoSs | |
| static const DomainId_t | DEFAULT_DOMAIN_ID = 0 |
| default Domain Id for different DDS | |
Protected Attributes inherited from rtctk::componentFramework::Dds | |
| DomainParticipantFactory * | m_factory |
| DomainParticipant * | m_participant |
| std::string | m_qos_profile |
| DomainId_t | m_domain_id = 0 |
| std::vector< std::string > | m_interface_white_list |
| std::string | m_participant_name |
| std::vector< Topic * > | m_topics |
| log4cplus::Logger & | m_logger |
All functionality needed to create DDS entities for DDS data subscribing is concentrated in this class.
|
explicit |
| qos_file | of QoS XML file. That needs to be located in subfolder: resource/config/rtctk/dds of $CFGPATH. |
| qos_profile | DDS QoS profile (please refer to FastDDS documentation for details) |
| domain_id | DDS domain Id (see FastDDS documentation for details) |
| participant_name | name of participant |
|
override |
| DataReader * rtctk::componentFramework::DdsSub::CreateDataReader | ( | Topic * | topic, |
| DataReaderListener * | listener = nullptr, | ||
| const std::string & | multicast_address = "" ) |
Creates DDS data reader for particular topic for topic of type: rtctk::AgnosticTopic.
| topic | DDS topic for which DDS reader shall be created |
| listener | pointer to DDS Reader Listener (optional). If not specified a default one is created/used: rtctk::componentFramework::DdsReaderListener |
| multicast_address | multicast address to be used for listening |
| void rtctk::componentFramework::DdsSub::CreateDataReaders | ( | ) |
Creates DDS Data Reader for all DDS topics.
Internal it calls CreateDataReader for each topic from the internal topic map.
| void rtctk::componentFramework::DdsSub::CreateManyDataReaders | ( | const std::vector< DdsReaderParams > & | topics_listeners | ) |
create DDS topics and DDS readers for the given list (vector) of topic names and rtctk::componentFramework::DdsReaderListener Internally it calls for each topic name CreateTopic, and on the created topic CreateDataReader.
| 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.
| 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 participant has been created.
| 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.
| void rtctk::componentFramework::DdsSub::DestroyDataReader | ( | DataReader * | dr, |
| bool | to_be_removed = true ) |
Destroys DDS data reader.
| dr | DDS Data reader to be destroyed |
| to_be_removed | flag that indicates if the data reader should be also removed from internal map. Default is to be removed. |
| void rtctk::componentFramework::DdsSub::DestroySubscriber | ( | ) |
Destroys DDS subscriber.
As there is just one subscriber is should be called at most once.
| void rtctk::componentFramework::DdsSub::DumpDDSstatistics | ( | ) |
Dumps / logs varios DDS statistic like NACks, ACKs, ... for each DDS writer.
| void rtctk::componentFramework::DdsSub::EnableAllDataReaders | ( | ) |
|
inline |
returns vector of all DDS Data writers