12#ifndef RTCTK_COMPONENTFRAMEWORK_DATAPATH_DDSSUB_HPP
13#define RTCTK_COMPONENTFRAMEWORK_DATAPATH_DDSSUB_HPP
14#include <fmt/format.h>
51 Subscriber* m_subscriber;
52 std::vector<DataReader*> m_data_readers;
94 DataReaderListener* listener =
nullptr,
95 const std::string& multicast_address =
"");
145 return m_data_readers;
154struct formatter<eprosima::fastdds::dds::SampleRejectedStatusKind> : formatter<string_view> {
155 template <
typename FormatContext>
156 auto format(eprosima::fastdds::dds::SampleRejectedStatusKind c, FormatContext& ctx)
const {
157 using eprosima::fastdds::dds::SampleRejectedStatusKind;
158 string_view name =
"unknown";
160 case SampleRejectedStatusKind::NOT_REJECTED:
161 name =
"NOT_REJECTED";
163 case SampleRejectedStatusKind::REJECTED_BY_INSTANCES_LIMIT:
164 name =
"REJECTED_BY_INSTANCES_LIMIT";
166 case SampleRejectedStatusKind::REJECTED_BY_SAMPLES_LIMIT:
167 name =
"REJECTED_BY_SAMPLES_LIMIT";
169 case SampleRejectedStatusKind::REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT:
170 name =
"REJECTED_BY_SAMPLES_PER_INSTANCE_LIMIT";
173 return formatter<string_view>::format(name, ctx);
All functionality needed to create DDS entities for DDS data subscribing is concentrated in this clas...
Definition ddsSub.hpp:48
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="")
Definition ddsSub.cpp:30
void CreateManyDataReaders(const std::vector< DdsReaderParams > &)
create DDS topics and DDS readers for the given list (vector) of topic names and rtctk::componentFram...
Definition ddsSub.cpp:216
void DumpDDSstatistics()
Dumps / logs varios DDS statistic like NACks, ACKs, ... for each DDS writer.
Definition ddsSub.cpp:267
void DestroySubscriber()
Destroys DDS subscriber.
Definition ddsSub.cpp:92
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.
Definition ddsSub.cpp:109
void DestroyAllDataReaders()
Destroys DDS Data Reader for all DDS topics.
Definition ddsSub.cpp:243
void EnableAllDataReaders()
Definition ddsSub.cpp:182
std::vector< DataReader * > & GetDataReaders()
returns vector of all DDS Data writers
Definition ddsSub.hpp:144
~DdsSub() override
Definition ddsSub.cpp:39
void CreateDataReaders()
Creates DDS Data Reader for all DDS topics.
Definition ddsSub.cpp:254
void CreateSubscriber()
Creates DDS subscriber.
Definition ddsSub.cpp:48
void DestroyDataReader(DataReader *dr, bool to_be_removed=true)
Destroys DDS data reader.
Definition ddsSub.cpp:195
Common functionallty needed to create DDS entities like participant and topic that can be later used ...
Definition dds.hpp:33
static const DomainId_t DEFAULT_DOMAIN_ID
default Domain Id for different DDS
Definition dds.hpp:174
static const std::string DEFAULT_QOS_PROFILE
default profile name for different DDS QoSs
Definition dds.hpp:168
Declares common DDS class.
Definition ddsSub.hpp:151
Definition commandReplier.cpp:22
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Structure that keeps together topic name and DDS Data Writer listener.
Definition ddsSub.hpp:25
std::string topic_name
Definition ddsSub.hpp:26
std::string multicast_address
Definition ddsSub.hpp:28
DdsReaderParams(const std::string &tn)
Definition ddsSub.hpp:37
DdsReaderParams(const std::string &tn, DataReaderListener *l, const std::string &mc)
Definition ddsSub.hpp:30
DataReaderListener * listener
Definition ddsSub.hpp:27
DdsReaderParams(const std::string &tn, DataReaderListener *l)
Definition ddsSub.hpp:34