| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
RTPSParticipant.hpp
1// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
18
19#ifndef FASTDDS_RTPS_PARTICIPANT__RTPSPARTICIPANT_HPP
20#define FASTDDS_RTPS_PARTICIPANT__RTPSPARTICIPANT_HPP
21
22#include <cstdint>
23#include <cstdlib>
24#include <memory>
25
26#include <fastdds/dds/core/ReturnCode.hpp>
27#include <fastdds/dds/publisher/qos/WriterQos.hpp>
28#include <fastdds/dds/subscriber/qos/ReaderQos.hpp>
29#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
30#include <fastdds/rtps/builtin/data/ContentFilterProperty.hpp>
31#include <fastdds/rtps/builtin/data/ParticipantBuiltinTopicData.hpp>
32#include <fastdds/rtps/common/Guid.hpp>
33#include <fastdds/statistics/IListeners.hpp>
34#include <fastdds/fastdds_dll.hpp>
35
36 namespace eprosima {
37
38#ifdef FASTDDS_STATISTICS
39
40 namespace fastdds {
41 namespace statistics {
42
43 class MonitorServiceStatusData;
44
45 namespace rtps {
46
47 struct IStatusQueryable;
48 struct IStatusObserver;
49
50} // namespace rtps
51} // namespace statistics
52} // namespace fastdds
53
54#endif //FASTDDS_STATISTICS
55
56 namespace fastdds {
57 namespace rtps {
58
59 struct PublicationBuiltinTopicData;
60 class RTPSParticipantImpl;
61 class RTPSParticipantListener;
62 class RTPSWriter;
63 class RTPSReader;
64 struct SubscriptionBuiltinTopicData;
65 struct TopicDescription;
66 class EndpointAttributes;
67 class WriterAttributes;
68 class ReaderAttributes;
69 class ResourceEvent;
70 class WLP;
71
76 class FASTDDS_EXPORTED_API RTPSParticipant
77{
78 friend class RTPSParticipantImpl;
79 friend class RTPSDomain;
80 friend class RTPSDomainImpl;
81
82 private:
83
88 RTPSParticipant(
89 RTPSParticipantImpl* pimpl);
90
91 virtual ~RTPSParticipant();
92
93 public:
94
96 const GUID_t& getGuid() const;
97
99 void announceRTPSParticipantState();
100
101 // //!Method to loose the next change (ONLY FOR TEST). //TODO remove this method because is only for testing
102 // void loose_next_change();
103
105 void stopRTPSParticipantAnnouncement();
106
108 void resetRTPSParticipantAnnouncement();
109
118
119 bool newRemoteWriterDiscovered(
120 const GUID_t& pguid,
121 int16_t userDefinedId);
130 bool newRemoteReaderDiscovered(
131 const GUID_t& pguid,
132 int16_t userDefinedId);
133
138 uint32_t getRTPSParticipantID() const;
139
149 bool register_writer(
150 RTPSWriter* rtps_writer,
151 const TopicDescription& topic,
152 const fastdds::dds::WriterQos& qos);
153
163 dds::ReturnCode_t register_writer(
164 RTPSWriter* rtps_writer,
165 const TopicDescription& topic,
166 const PublicationBuiltinTopicData& pub_builtin_topic_data);
167
178 bool register_reader(
179 RTPSReader* rtps_reader,
180 const TopicDescription& topic,
181 const fastdds::dds::ReaderQos& qos,
182 const ContentFilterProperty* content_filter = nullptr);
183
194 dds::ReturnCode_t register_reader(
195 RTPSReader* rtps_reader,
196 const TopicDescription& topic,
197 const SubscriptionBuiltinTopicData& sub_builtin_topic_data,
198 const ContentFilterProperty* content_filter = nullptr);
199
204 void update_attributes(
205 const RTPSParticipantAttributes& patt);
206
213 bool update_writer(
214 RTPSWriter* rtps_writer,
215 const fastdds::dds::WriterQos& wqos);
216
224 bool update_reader(
225 RTPSReader* rtps_reader,
226 const fastdds::dds::ReaderQos& rqos,
227 const ContentFilterProperty* content_filter = nullptr);
228
233 std::vector<std::string> getParticipantNames() const;
234
239 const RTPSParticipantAttributes& get_attributes() const;
240
244 uint32_t getMaxMessageSize() const;
245
249 uint32_t getMaxDataSize() const;
250
251 ResourceEvent& get_resource_event() const;
252
257 WLP* wlp() const;
258
265 bool get_new_entity_id(
266 EntityId_t& entityId);
267
271 void set_check_type_function(
272 std::function<bool(const std::string&)>&& check_type);
273
278 void set_listener(
279 RTPSParticipantListener* listener);
280
284 uint32_t get_domain_id() const;
285
289 void enable();
290
297 bool ignore_participant(
298 const GuidPrefix_t& participant_guid);
299
306 bool ignore_writer(
307 const GUID_t& writer_guid);
308
315 bool ignore_reader(
316 const GUID_t& reader_guid);
317
323 std::vector<TransportNetmaskFilterInfo> get_netmask_filter_info() const;
324
333 bool get_publication_info(
334 fastdds::rtps::PublicationBuiltinTopicData& data,
335 const GUID_t& writer_guid) const;
336
345 bool get_subscription_info(
346 fastdds::rtps::SubscriptionBuiltinTopicData& data,
347 const GUID_t& reader_guid) const;
348
349#if HAVE_SECURITY
350
355
356 bool is_security_enabled_for_writer(
357 const WriterAttributes& writer_attributes);
358
363
364 bool is_security_enabled_for_reader(
365 const ReaderAttributes& reader_attributes);
366
367#endif // if HAVE_SECURITY
368
369#ifdef FASTDDS_STATISTICS
370
377 bool add_statistics_listener(
378 std::shared_ptr<fastdds::statistics::IListener> listener,
379 uint32_t kind);
380
387 bool remove_statistics_listener(
388 std::shared_ptr<fastdds::statistics::IListener> listener,
389 uint32_t kind);
390
396 void set_enabled_statistics_writers_mask(
397 uint32_t enabled_writers);
398
409 const fastdds::statistics::rtps::IStatusObserver* create_monitor_service(
410 fastdds::statistics::rtps::IStatusQueryable& status_queryable);
411
420 bool create_monitor_service();
421
430 bool is_monitor_service_created() const;
431
439 bool enable_monitor_service() const;
440
449 bool disable_monitor_service() const;
450
459 bool fill_discovery_data_from_cdr_message(
460 ParticipantBuiltinTopicData& data,
461 const fastdds::statistics::MonitorServiceStatusData& msg);
462
471 bool fill_discovery_data_from_cdr_message(
472 PublicationBuiltinTopicData& data,
473 const fastdds::statistics::MonitorServiceStatusData& msg);
474
483 bool fill_discovery_data_from_cdr_message(
484 SubscriptionBuiltinTopicData& data,
485 const fastdds::statistics::MonitorServiceStatusData& msg);
486
487#endif // FASTDDS_STATISTICS
488
489 protected:
490
492 RTPSParticipantImpl* mp_impl;
493
494};
495
496} // namespace rtps
497} // namespace rtps
498} // namespace eprosima
499
500#endif // FASTDDS_RTPS_PARTICIPANT__RTPSPARTICIPANT_HPP
eprosima::fastdds::dds::ReaderQos
Definition ReaderQos.hpp:38
eprosima::fastdds::dds::WriterQos
Definition WriterQos.hpp:38
eprosima::fastdds::rtps::ContentFilterProperty
Information about the content filter being applied by a reader.
Definition ContentFilterProperty.hpp:36
eprosima::fastdds::rtps::EndpointAttributes
Structure EndpointAttributes, describing the attributes associated with an RTPS Endpoint.
Definition EndpointAttributes.hpp:40
eprosima::fastdds::rtps::RTPSParticipantAttributes
Class RTPSParticipantAttributes used to define different aspects of a RTPSParticipant.
Definition RTPSParticipantAttributes.hpp:428
eprosima::fastdds::rtps::RTPSParticipant::register_reader
dds::ReturnCode_t register_reader(RTPSReader *rtps_reader, const TopicDescription &topic, const SubscriptionBuiltinTopicData &sub_builtin_topic_data, const ContentFilterProperty *content_filter=nullptr)
Register a Reader in the BuiltinProtocols.
eprosima::fastdds::rtps::RTPSParticipant::register_writer
dds::ReturnCode_t register_writer(RTPSWriter *rtps_writer, const TopicDescription &topic, const PublicationBuiltinTopicData &pub_builtin_topic_data)
Register a Writer in the BuiltinProtocols.
eprosima::fastdds::rtps::RTPSParticipant::get_publication_info
bool get_publication_info(fastdds::rtps::PublicationBuiltinTopicData &data, const GUID_t &writer_guid) const
Fills the provided publication discovery data with the information of the writer identified by writer...
eprosima::fastdds::rtps::RTPSParticipant::ignore_reader
bool ignore_reader(const GUID_t &reader_guid)
Ignore all messages coming from the RTPSReader.
eprosima::fastdds::rtps::RTPSParticipant::getMaxMessageSize
uint32_t getMaxMessageSize() const
Retrieves the maximum message size.
eprosima::fastdds::rtps::RTPSParticipant::register_writer
bool register_writer(RTPSWriter *rtps_writer, const TopicDescription &topic, const fastdds::dds::WriterQos &qos)
Register a Writer in the BuiltinProtocols.
eprosima::fastdds::rtps::RTPSParticipant::getParticipantNames
std::vector< std::string > getParticipantNames() const
Returns a list with the participant names.
eprosima::fastdds::rtps::RTPSParticipant::ignore_participant
bool ignore_participant(const GuidPrefix_t &participant_guid)
Ignore all messages coming from the RTPSParticipant.
eprosima::fastdds::rtps::RTPSParticipant::update_writer
bool update_writer(RTPSWriter *rtps_writer, const fastdds::dds::WriterQos &wqos)
Update local writer QoS.
eprosima::fastdds::rtps::RTPSParticipant::enable
void enable()
This operation enables the RTPSParticipantImpl.
eprosima::fastdds::rtps::RTPSParticipant::RTPSDomain
friend class RTPSDomain
Definition RTPSParticipant.hpp:79
eprosima::fastdds::rtps::RTPSParticipant::get_new_entity_id
bool get_new_entity_id(EntityId_t &entityId)
Fills a new entityId if set to unknown, or checks if a entity already exists with that entityId in ot...
eprosima::fastdds::rtps::RTPSParticipant::ignore_writer
bool ignore_writer(const GUID_t &writer_guid)
Ignore all messages coming from the RTPSWriter.
eprosima::fastdds::rtps::RTPSParticipant::get_subscription_info
bool get_subscription_info(fastdds::rtps::SubscriptionBuiltinTopicData &data, const GUID_t &reader_guid) const
Fills the provided subscription discovery data with the information of the reader identified by reade...
eprosima::fastdds::rtps::RTPSParticipant::mp_impl
RTPSParticipantImpl * mp_impl
Pointer to the implementation.
Definition RTPSParticipant.hpp:492
eprosima::fastdds::rtps::RTPSParticipant::get_resource_event
ResourceEvent & get_resource_event() const
eprosima::fastdds::rtps::RTPSParticipant::newRemoteReaderDiscovered
bool newRemoteReaderDiscovered(const GUID_t &pguid, int16_t userDefinedId)
Indicate the Participant that you have discovered a new Remote Reader.
eprosima::fastdds::rtps::RTPSParticipant::stopRTPSParticipantAnnouncement
void stopRTPSParticipantAnnouncement()
Stop the RTPSParticipant announcement period. //TODO remove this method because is only for testing.
eprosima::fastdds::rtps::RTPSParticipant::get_attributes
const RTPSParticipantAttributes & get_attributes() const
Get a reference of the current state of the RTPSParticipantParameters.
eprosima::fastdds::rtps::RTPSParticipant::get_netmask_filter_info
std::vector< TransportNetmaskFilterInfo > get_netmask_filter_info() const
Returns registered transports' netmask filter information (transport's netmask filter kind and allowl...
eprosima::fastdds::rtps::RTPSParticipant::newRemoteWriterDiscovered
bool newRemoteWriterDiscovered(const GUID_t &pguid, int16_t userDefinedId)
Indicate the Participant that you have discovered a new Remote Writer.
eprosima::fastdds::rtps::RTPSParticipant::RTPSParticipantImpl
friend class RTPSParticipantImpl
Definition RTPSParticipant.hpp:78
eprosima::fastdds::rtps::RTPSParticipant::update_reader
bool update_reader(RTPSReader *rtps_reader, const fastdds::dds::ReaderQos &rqos, const ContentFilterProperty *content_filter=nullptr)
Update local reader QoS.
eprosima::fastdds::rtps::RTPSParticipant::get_domain_id
uint32_t get_domain_id() const
Retrieves the DomainId.
eprosima::fastdds::rtps::RTPSParticipant::getGuid
const GUID_t & getGuid() const
Get the GUID_t of the RTPSParticipant.
eprosima::fastdds::rtps::RTPSParticipant::RTPSDomainImpl
friend class RTPSDomainImpl
Definition RTPSParticipant.hpp:80
eprosima::fastdds::rtps::RTPSParticipant::getMaxDataSize
uint32_t getMaxDataSize() const
Retrieves the maximum data size.
eprosima::fastdds::rtps::RTPSParticipant::register_reader
bool register_reader(RTPSReader *rtps_reader, const TopicDescription &topic, const fastdds::dds::ReaderQos &qos, const ContentFilterProperty *content_filter=nullptr)
Register a Reader in the BuiltinProtocols.
eprosima::fastdds::rtps::RTPSParticipant::resetRTPSParticipantAnnouncement
void resetRTPSParticipantAnnouncement()
Reset the RTPSParticipant announcement period. //TODO remove this method because is only for testing.
eprosima::fastdds::rtps::RTPSParticipant::wlp
WLP * wlp() const
A method to retrieve the built-in writer liveliness protocol.
eprosima::fastdds::rtps::RTPSParticipant::set_check_type_function
void set_check_type_function(std::function< bool(const std::string &)> &&check_type)
Allows setting a function to check if a type is already known by the top level API participant.
eprosima::fastdds::rtps::RTPSParticipant::set_listener
void set_listener(RTPSParticipantListener *listener)
Modifies the participant listener.
eprosima::fastdds::rtps::RTPSParticipant::announceRTPSParticipantState
void announceRTPSParticipantState()
Force the announcement of the RTPSParticipant state.
eprosima::fastdds::rtps::RTPSParticipant::update_attributes
void update_attributes(const RTPSParticipantAttributes &patt)
Update participant attributes.
eprosima::fastdds::rtps::RTPSParticipant::getRTPSParticipantID
uint32_t getRTPSParticipantID() const
Get the Participant ID.
eprosima::fastdds::rtps::RTPSParticipantListener
Class RTPSParticipantListener with virtual method that the user can overload to respond to certain ev...
Definition RTPSParticipantListener.hpp:40
eprosima::fastdds::rtps::RTPSReader
Class RTPSReader, manages the reception of data from its matched writers.
Definition RTPSReader.hpp:54
eprosima::fastdds::rtps::RTPSWriter
Class RTPSWriter, manages the sending of data to the readers.
Definition RTPSWriter.hpp:62
eprosima::fastdds::rtps::ReaderAttributes
Class ReaderAttributes, to define the attributes of a RTPSReader.
Definition ReaderAttributes.hpp:59
eprosima::fastdds::rtps::WriterAttributes
Class WriterAttributes, defining the attributes of a RTPSWriter.
Definition WriterAttributes.hpp:73
eprosima::fastdds::dds::ReturnCode_t
int32_t ReturnCode_t
Definition DDSReturnCode.hpp:59
eprosima::fastdds::rtps
Contains the RTPS protocol implementation.
eprosima::fastdds::statistics::rtps
Definition connections_fwd.hpp:29
eprosima::fastdds::statistics
Definition DomainParticipant.hpp:35
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::rtps::EntityId_t
Structure EntityId_t, entity id part of GUID_t.
Definition EntityId_t.hpp:77
eprosima::fastdds::rtps::GUID_t
Structure GUID_t, entity identifier, unique in DDS-RTPS Domain.
Definition Guid.hpp:40
eprosima::fastdds::rtps::GuidPrefix_t
Structure GuidPrefix_t, Guid Prefix of GUID_t.
Definition GuidPrefix_t.hpp:37
eprosima::fastdds::rtps::ParticipantBuiltinTopicData
Definition ParticipantBuiltinTopicData.hpp:36
eprosima::fastdds::rtps::PublicationBuiltinTopicData
Structure PublicationBuiltinTopicData, contains the information on a discovered publication.
Definition PublicationBuiltinTopicData.hpp:48
eprosima::fastdds::rtps::SubscriptionBuiltinTopicData
Structure SubscriptionBuiltinTopicData, contains the information on a discovered subscription.
Definition SubscriptionBuiltinTopicData.hpp:47
eprosima::fastdds::rtps::TopicDescription
Structure TopicDescription, used to register an endpoint on a topic.
Definition TopicDescription.hpp:35
eprosima::fastdds::statistics::MonitorServiceStatusData
Definition monitorservice_types.idl:126