Fast DDS  Version 3.0.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
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/publisher/qos/WriterQos.hpp>
27#include <fastdds/dds/subscriber/qos/ReaderQos.hpp>
28#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
29#include <fastdds/rtps/builtin/data/ContentFilterProperty.hpp>
30#include <fastdds/rtps/builtin/data/ParticipantBuiltinTopicData.hpp>
31#include <fastdds/rtps/common/Guid.hpp>
32#include <fastdds/statistics/IListeners.hpp>
33#include <fastdds/fastdds_dll.hpp>
34
35namespace eprosima {
36
37#ifdef FASTDDS_STATISTICS
38
39namespace fastdds {
40namespace statistics {
41
42class MonitorServiceStatusData;
43
44namespace rtps {
45
46struct IStatusQueryable;
47struct IStatusObserver;
48
49} // namespace rtps
50} // namespace statistics
51} // namespace fastdds
52
53#endif //FASTDDS_STATISTICS
54
55namespace fastdds {
56namespace rtps {
57
59class RTPSParticipantImpl;
60class RTPSParticipantListener;
61class RTPSWriter;
62class RTPSReader;
64struct TopicDescription;
65class EndpointAttributes;
66class WriterAttributes;
67class ReaderAttributes;
68class ResourceEvent;
69class WLP;
70
75class FASTDDS_EXPORTED_API RTPSParticipant
76{
77 friend class RTPSParticipantImpl;
78 friend class RTPSDomain;
79 friend class RTPSDomainImpl;
80
81private:
82
88 RTPSParticipantImpl* pimpl);
89
90 virtual ~RTPSParticipant();
91
92public:
93
95 const GUID_t& getGuid() const;
96
99
100 // //!Method to loose the next change (ONLY FOR TEST). //TODO remove this method because is only for testing
101 // void loose_next_change();
102
105
108
119 const GUID_t& pguid,
120 int16_t userDefinedId);
130 const GUID_t& pguid,
131 int16_t userDefinedId);
132
137 uint32_t getRTPSParticipantID() const;
138
149 RTPSWriter* rtps_writer,
150 const TopicDescription& topic,
151 const fastdds::dds::WriterQos& qos);
152
164 RTPSReader* rtps_reader,
165 const TopicDescription& topic,
166 const fastdds::dds::ReaderQos& qos,
167 const ContentFilterProperty* content_filter = nullptr);
168
174 const RTPSParticipantAttributes& patt);
175
183 RTPSWriter* rtps_writer,
184 const fastdds::dds::WriterQos& wqos);
185
194 RTPSReader* rtps_reader,
195 const fastdds::dds::ReaderQos& rqos,
196 const ContentFilterProperty* content_filter = nullptr);
197
202 std::vector<std::string> getParticipantNames() const;
203
209
213 uint32_t getMaxMessageSize() const;
214
218 uint32_t getMaxDataSize() const;
219
220 ResourceEvent& get_resource_event() const;
221
226 WLP* wlp() const;
227
235 EntityId_t& entityId);
236
241 std::function<bool(const std::string&)>&& check_type);
242
248 RTPSParticipantListener* listener);
249
253 uint32_t get_domain_id() const;
254
258 void enable();
259
267 const GuidPrefix_t& participant_guid);
268
276 const GUID_t& writer_guid);
277
285 const GUID_t& reader_guid);
286
292 std::vector<TransportNetmaskFilterInfo> get_netmask_filter_info() const;
293
294#if HAVE_SECURITY
295
301 bool is_security_enabled_for_writer(
302 const WriterAttributes& writer_attributes);
303
309 bool is_security_enabled_for_reader(
310 const ReaderAttributes& reader_attributes);
311
312#endif // if HAVE_SECURITY
313
314#ifdef FASTDDS_STATISTICS
315
322 bool add_statistics_listener(
323 std::shared_ptr<fastdds::statistics::IListener> listener,
324 uint32_t kind);
325
332 bool remove_statistics_listener(
333 std::shared_ptr<fastdds::statistics::IListener> listener,
334 uint32_t kind);
335
341 void set_enabled_statistics_writers_mask(
342 uint32_t enabled_writers);
343
354 const fastdds::statistics::rtps::IStatusObserver* create_monitor_service(
355 fastdds::statistics::rtps::IStatusQueryable& status_queryable);
356
365 bool create_monitor_service();
366
375 bool is_monitor_service_created() const;
376
384 bool enable_monitor_service() const;
385
394 bool disable_monitor_service() const;
395
404 bool fill_discovery_data_from_cdr_message(
407
416 bool fill_discovery_data_from_cdr_message(
419
428 bool fill_discovery_data_from_cdr_message(
431
432#endif // FASTDDS_STATISTICS
433
434protected:
435
437 RTPSParticipantImpl* mp_impl;
438
439};
440
441} // namespace rtps
442} // namespace rtps
443} // namespace eprosima
444
445#endif // FASTDDS_RTPS_PARTICIPANT__RTPSPARTICIPANT_HPP
Class ReaderQos, contains all the possible Qos that can be set for a determined Subscriber.
Definition ReaderQos.hpp:37
Class WriterQos, containing all the possible Qos that can be set for a determined Publisher.
Definition WriterQos.hpp:37
Information about the content filter being applied by a reader.
Definition ContentFilterProperty.hpp:36
Class RTPSDomain,it manages the creation and destruction of RTPSParticipant RTPSWriter and RTPSReader...
Definition RTPSDomain.hpp:56
Class RTPSParticipantAttributes used to define different aspects of a RTPSParticipant.
Definition RTPSParticipantAttributes.hpp:423
Class RTPSParticipant, contains the public API for a RTPSParticipant.
Definition RTPSParticipant.hpp:76
bool ignore_reader(const GUID_t &reader_guid)
Ignore all messages coming from the RTPSReader.
uint32_t getMaxMessageSize() const
Retrieves the maximum message size.
bool register_writer(RTPSWriter *rtps_writer, const TopicDescription &topic, const fastdds::dds::WriterQos &qos)
Register a Writer in the BuiltinProtocols.
std::vector< std::string > getParticipantNames() const
Returns a list with the participant names.
bool ignore_participant(const GuidPrefix_t &participant_guid)
Ignore all messages coming from the RTPSParticipant.
bool update_writer(RTPSWriter *rtps_writer, const fastdds::dds::WriterQos &wqos)
Update local writer QoS.
void enable()
This operation enables the RTPSParticipantImpl.
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...
bool ignore_writer(const GUID_t &writer_guid)
Ignore all messages coming from the RTPSWriter.
RTPSParticipantImpl * mp_impl
Pointer to the implementation.
Definition RTPSParticipant.hpp:437
ResourceEvent & get_resource_event() const
bool newRemoteReaderDiscovered(const GUID_t &pguid, int16_t userDefinedId)
Indicate the Participant that you have discovered a new Remote Reader.
void stopRTPSParticipantAnnouncement()
Stop the RTPSParticipant announcement period. //TODO remove this method because is only for testing.
const RTPSParticipantAttributes & get_attributes() const
Get a reference of the current state of the RTPSParticipantParameters.
std::vector< TransportNetmaskFilterInfo > get_netmask_filter_info() const
Returns registered transports' netmask filter information (transport's netmask filter kind and allowl...
bool newRemoteWriterDiscovered(const GUID_t &pguid, int16_t userDefinedId)
Indicate the Participant that you have discovered a new Remote Writer.
bool update_reader(RTPSReader *rtps_reader, const fastdds::dds::ReaderQos &rqos, const ContentFilterProperty *content_filter=nullptr)
Update local reader QoS.
uint32_t get_domain_id() const
Retrieves the DomainId.
const GUID_t & getGuid() const
Get the GUID_t of the RTPSParticipant.
uint32_t getMaxDataSize() const
Retrieves the maximum data size.
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.
void resetRTPSParticipantAnnouncement()
Reset the RTPSParticipant announcement period. //TODO remove this method because is only for testing.
WLP * wlp() const
A method to retrieve the built-in writer liveliness protocol.
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.
void set_listener(RTPSParticipantListener *listener)
Modifies the participant listener.
void announceRTPSParticipantState()
Force the announcement of the RTPSParticipant state.
void update_attributes(const RTPSParticipantAttributes &patt)
Update participant attributes.
uint32_t getRTPSParticipantID() const
Get the Participant ID.
Class RTPSParticipantListener with virtual method that the user can overload to respond to certain ev...
Definition RTPSParticipantListener.hpp:40
Class RTPSReader, manages the reception of data from its matched writers.
Definition RTPSReader.hpp:54
Class RTPSWriter, manages the sending of data to the readers.
Definition RTPSWriter.hpp:62
Class ReaderAttributes, to define the attributes of a RTPSReader.
Definition ReaderAttributes.hpp:59
Class WriterAttributes, defining the attributes of a RTPSWriter.
Definition WriterAttributes.hpp:73
rtps::SubscriptionBuiltinTopicData SubscriptionBuiltinTopicData
Definition SubscriptionBuiltinTopicData.hpp:28
rtps::PublicationBuiltinTopicData PublicationBuiltinTopicData
Definition PublicationBuiltinTopicData.hpp:28
eProsima namespace.
Structure EntityId_t, entity id part of GUID_t.
Definition EntityId_t.hpp:77
Structure GUID_t, entity identifier, unique in DDS-RTPS Domain.
Definition Guid.hpp:40
Structure GuidPrefix_t, Guid Prefix of GUID_t.
Definition GuidPrefix_t.hpp:37
Definition ParticipantBuiltinTopicData.hpp:33
Structure PublicationBuiltinTopicData, contains the information on a discovered publication.
Definition PublicationBuiltinTopicData.hpp:39
Structure SubscriptionBuiltinTopicData, contains the information on a discovered subscription.
Definition SubscriptionBuiltinTopicData.hpp:37
Structure TopicDescription, used to register an endpoint on a topic.
Definition TopicDescription.hpp:35
Definition monitorservice_types.idl:115