19#ifndef FASTDDS_RTPS_ATTRIBUTES__RTPSPARTICIPANTATTRIBUTES_HPP
20#define FASTDDS_RTPS_ATTRIBUTES__RTPSPARTICIPANTATTRIBUTES_HPP
25#include <fastcdr/cdr/fixed_size_string.hpp>
27#include <fastdds/rtps/attributes/BuiltinTransports.hpp>
28#include <fastdds/rtps/attributes/ExternalLocators.hpp>
29#include <fastdds/rtps/attributes/PropertyPolicy.hpp>
30#include <fastdds/rtps/attributes/ResourceManagement.hpp>
31#include <fastdds/rtps/attributes/RTPSParticipantAllocationAttributes.hpp>
32#include <fastdds/rtps/attributes/ThreadSettings.hpp>
33#include <fastdds/rtps/common/Locator.hpp>
34#include <fastdds/rtps/common/PortParameters.hpp>
35#include <fastdds/rtps/common/Time_t.hpp>
36#include <fastdds/rtps/common/Types.hpp>
37#include <fastdds/rtps/flowcontrol/FlowControllerDescriptor.hpp>
38#include <fastdds/rtps/transport/network/NetmaskFilterKind.hpp>
39#include <fastdds/rtps/transport/TransportInterface.hpp>
40#include <fastdds/fastdds_dll.hpp>
51 static constexpr const char*
SIMPLE =
"SIMPLE";
52 static constexpr const char*
SERVER =
"SERVER";
53 static constexpr const char*
CLIENT =
"CLIENT";
55 static constexpr const char*
BACKUP =
"BACKUP";
56 static constexpr const char*
NONE =
"NONE";
57 static constexpr const char*
EXTERNAL =
"EXTERNAL";
58 static constexpr const char*
UNKNOWN =
"UNKNOWN";
101 switch (discovery_protocol)
154#define BUILTIN_DATA_MAX_SIZE 512
158class BuiltinProtocols;
163 PDP* (*CreatePDPInstance)(BuiltinProtocols*);
192 bool enable_builtin_secure_publications_writer_and_subscriptions_reader;
194 bool enable_builtin_secure_subscriptions_writer_and_publications_reader;
201 , enable_builtin_secure_publications_writer_and_subscriptions_reader(true)
202 , enable_builtin_secure_subscriptions_writer_and_publications_reader(true)
212 (this->enable_builtin_secure_publications_writer_and_subscriptions_reader ==
213 b.enable_builtin_secure_publications_writer_and_subscriptions_reader) &&
214 (this->enable_builtin_secure_subscriptions_writer_and_publications_reader ==
215 b.enable_builtin_secure_subscriptions_writer_and_publications_reader) &&
312 (this->static_edp_xml_config_ == b.static_edp_xml_config_) &&
325 static_edp_xml_config_ = str;
335 return static_edp_xml_config_.c_str();
342 std::string static_edp_xml_config_ =
"";
376 MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
383 MemoryManagementPolicy_t::PREALLOCATED_WITH_REALLOC_MEMORY_MODE;
424 using FlowControllerDescriptorList = std::vector<std::shared_ptr<fastdds::rtps::FlowControllerDescriptor>>;
435 return (this->name == b.name) &&
454 (this->security_log_thread == b.security_log_thread) &&
515 return bool(std::istringstream(pfx) >>
prefix);
531 std::vector<std::shared_ptr<fastdds::rtps::TransportDescriptorInterface>>
userTransports;
587 fastcdr::string_255 name{
"RTPSParticipant"};
Class BuiltinAttributes, to define the behavior of the RTPSParticipant builtin protocols.
Definition RTPSParticipantAttributes.hpp:350
bool avoid_builtin_multicast
Set to true to avoid multicast traffic on builtin endpoints.
Definition RTPSParticipantAttributes.hpp:392
fastdds::rtps::ExternalLocators metatraffic_external_unicast_locators
The collection of external locators to use for communication on metatraffic topics.
Definition RTPSParticipantAttributes.hpp:369
virtual ~BuiltinAttributes()=default
MemoryManagementPolicy_t writerHistoryMemoryPolicy
Memory policy for builtin writers.
Definition RTPSParticipantAttributes.hpp:382
DiscoverySettings discovery_config
Discovery protocol related attributes.
Definition RTPSParticipantAttributes.hpp:354
LocatorList_t initialPeersList
Initial peers.
Definition RTPSParticipantAttributes.hpp:372
bool operator==(const BuiltinAttributes &b) const
Definition RTPSParticipantAttributes.hpp:398
LocatorList_t metatrafficUnicastLocatorList
Metatraffic Unicast Locator List.
Definition RTPSParticipantAttributes.hpp:363
MemoryManagementPolicy_t readerHistoryMemoryPolicy
Memory policy for builtin readers.
Definition RTPSParticipantAttributes.hpp:375
uint32_t readerPayloadSize
Maximum payload size for builtin readers.
Definition RTPSParticipantAttributes.hpp:379
BuiltinAttributes()=default
bool use_WriterLivelinessProtocol
Indicates to use the WriterLiveliness protocol.
Definition RTPSParticipantAttributes.hpp:357
uint32_t writerPayloadSize
Maximum payload size for builtin writers.
Definition RTPSParticipantAttributes.hpp:386
LocatorList_t metatrafficMulticastLocatorList
Metatraffic Multicast Locator List.
Definition RTPSParticipantAttributes.hpp:366
uint32_t mutation_tries
Mutation tries if the port is being used.
Definition RTPSParticipantAttributes.hpp:389
NetworkConfigSet_t network_configuration
Network Configuration.
Definition RTPSParticipantAttributes.hpp:360
Class DiscoverySettings, to define the attributes of the several discovery protocols available.
Definition RTPSParticipantAttributes.hpp:248
SimpleEDPAttributes m_simpleEDP
Attributes of the SimpleEDP protocol.
Definition RTPSParticipantAttributes.hpp:281
const char * static_edp_xml_config() const
Get the static endpoint XML configuration.
Definition RTPSParticipantAttributes.hpp:333
ParticipantFilteringFlags ignoreParticipantFlags
Filtering participants out depending on location.
Definition RTPSParticipantAttributes.hpp:296
dds::Duration_t discoveryServer_client_syncperiod
The period for the RTPSParticipant to: send its Discovery Message to its servers check for EDP endpoi...
Definition RTPSParticipantAttributes.hpp:290
InitialAnnouncementConfig initial_announcements
Initial announcements configuration.
Definition RTPSParticipantAttributes.hpp:278
DiscoverySettings()=default
dds::Duration_t leaseDuration
Lease Duration of the RTPSParticipant, indicating how much time remote RTPSParticipants should consid...
Definition RTPSParticipantAttributes.hpp:269
void static_edp_xml_config(const char *str)
Set the static endpoint XML configuration.
Definition RTPSParticipantAttributes.hpp:322
bool operator==(const DiscoverySettings &b) const
Definition RTPSParticipantAttributes.hpp:300
dds::Duration_t leaseDuration_announcementperiod
The period for the RTPSParticipant to send its Discovery Message to all other discovered RTPSParticip...
Definition RTPSParticipantAttributes.hpp:275
bool use_STATIC_EndpointDiscoveryProtocol
If set to true, StaticEDP based on an XML file would be implemented.
Definition RTPSParticipantAttributes.hpp:263
bool use_SIMPLE_EndpointDiscoveryProtocol
If set to true, SimpleEDP would be used.
Definition RTPSParticipantAttributes.hpp:257
PDPFactory m_PDPfactory
function that returns a PDP object (only if EXTERNAL selected)
Definition RTPSParticipantAttributes.hpp:284
eprosima::fastdds::rtps::LocatorList m_DiscoveryServers
Discovery Server initial connections, needed if discoveryProtocol = CLIENT | SUPER_CLIENT | SERVER | ...
Definition RTPSParticipantAttributes.hpp:293
DiscoveryProtocol discoveryProtocol
Chosen discovery protocol.
Definition RTPSParticipantAttributes.hpp:252
Class LocatorList, a Locator vector that doesn't allow duplicates.
Definition LocatorList.hpp:97
Class PortParameters, to define the port parameters and gains related with the RTPS protocol.
Definition PortParameters.hpp:35
Definition PropertyPolicy.hpp:30
Class RTPSParticipantAttributes used to define different aspects of a RTPSParticipant.
Definition RTPSParticipantAttributes.hpp:423
LocatorList_t defaultUnicastLocatorList
Default list of Unicast Locators to be used for any Endpoint defined inside this RTPSParticipant in t...
Definition RTPSParticipantAttributes.hpp:477
int32_t participantID
Participant ID.
Definition RTPSParticipantAttributes.hpp:528
uint32_t sendSocketBufferSize
Send socket buffer size for the send resource.
Definition RTPSParticipantAttributes.hpp:499
fastdds::rtps::ExternalLocators default_external_unicast_locators
The collection of external locators to use for communication on user created topics.
Definition RTPSParticipantAttributes.hpp:488
FASTDDS_EXPORTED_API bool ReadguidPrefix(const char *pfx)
Definition RTPSParticipantAttributes.hpp:512
PropertyPolicy properties
Property policies.
Definition RTPSParticipantAttributes.hpp:540
fastdds::rtps::ThreadSettings discovery_server_thread
Thread settings for the discovery server thread.
Definition RTPSParticipantAttributes.hpp:565
FASTDDS_EXPORTED_API void setup_transports(fastdds::rtps::BuiltinTransports transports, const fastdds::rtps::BuiltinTransportsOptions &options=fastdds::rtps::BuiltinTransportsOptions())
Provides a way of easily configuring transport related configuration on certain pre-defined scenarios...
LocatorList_t defaultMulticastLocatorList
Default list of Multicast Locators to be used for any Endpoint defined inside this RTPSParticipant in...
Definition RTPSParticipantAttributes.hpp:483
bool ignore_non_matching_locators
Whether locators that don't match with the announced locators should be kept.
Definition RTPSParticipantAttributes.hpp:493
virtual ~RTPSParticipantAttributes()=default
const char * getName() const
Get the name of the participant.
Definition RTPSParticipantAttributes.hpp:550
std::vector< std::shared_ptr< fastdds::rtps::TransportDescriptorInterface > > userTransports
User defined transports to use alongside or in place of builtins.
Definition RTPSParticipantAttributes.hpp:531
RTPSParticipantAttributes()=default
RTPSParticipantAllocationAttributes allocation
Holds allocation limits affecting collections managed by a participant.
Definition RTPSParticipantAttributes.hpp:537
void setName(const char *nam)
Set the name of the participant.
Definition RTPSParticipantAttributes.hpp:543
uint32_t max_msg_size_no_frag
Maximum message size used to avoid fragmentation, set ONLY in LARGE_DATA.
Definition RTPSParticipantAttributes.hpp:582
bool useBuiltinTransports
Set as false to disable the creation of the default transports.
Definition RTPSParticipantAttributes.hpp:534
FlowControllerDescriptorList flow_controllers
Flow controllers.
Definition RTPSParticipantAttributes.hpp:556
fastdds::rtps::ThreadSettings builtin_controllers_sender_thread
Thread settings for the builtin flow controllers sender threads.
Definition RTPSParticipantAttributes.hpp:559
std::vector< octet > userData
User Data of the participant.
Definition RTPSParticipantAttributes.hpp:525
bool operator==(const RTPSParticipantAttributes &b) const
Definition RTPSParticipantAttributes.hpp:432
GuidPrefix_t prefix
Optionally allows user to define the GuidPrefix_t.
Definition RTPSParticipantAttributes.hpp:510
BuiltinAttributes builtin
Builtin parameters.
Definition RTPSParticipantAttributes.hpp:519
uint32_t listenSocketBufferSize
Listen socket buffer for all listen resources.
Definition RTPSParticipantAttributes.hpp:504
fastdds::rtps::ThreadSettings builtin_transports_reception_threads
Thread settings for the builtin transports reception threads.
Definition RTPSParticipantAttributes.hpp:571
fastdds::rtps::ThreadSettings typelookup_service_thread
Thread settings for the builtin TypeLookup service requests and replies threads.
Definition RTPSParticipantAttributes.hpp:568
fastdds::rtps::ThreadSettings timed_events_thread
Thread settings for the timed events thread.
Definition RTPSParticipantAttributes.hpp:562
fastdds::rtps::NetmaskFilterKind netmaskFilter
Netmask filter configuration.
Definition RTPSParticipantAttributes.hpp:507
PortParameters port
Port Parameters.
Definition RTPSParticipantAttributes.hpp:522
Class SimpleEDPAttributes, to define the attributes of the Simple Endpoint Discovery Protocol.
Definition RTPSParticipantAttributes.hpp:182
bool operator==(const SimpleEDPAttributes &b) const
Definition RTPSParticipantAttributes.hpp:207
bool use_PublicationWriterANDSubscriptionReader
Default value true.
Definition RTPSParticipantAttributes.hpp:186
SimpleEDPAttributes()
Definition RTPSParticipantAttributes.hpp:197
bool use_PublicationReaderANDSubscriptionWriter
Default value true.
Definition RTPSParticipantAttributes.hpp:189
std::ostream & operator<<(std::ostream &output, BuiltinTransports transports)
Definition BuiltinTransports.hpp:117
BuiltinTransports
Defines the kind of transports automatically instantiated upon the creation of a participant.
Definition BuiltinTransports.hpp:106
NetmaskFilterKind
Definition NetmaskFilterKind.hpp:31
FASTDDS_EXPORTED_API bool get_server_client_default_guidPrefix(int id, fastdds::rtps::GuidPrefix_t &guid)
Returns the guidPrefix associated to the given server id.
enum eprosima::fastdds::rtps::MemoryManagementPolicy MemoryManagementPolicy_t
Enum MemoryuManagementPolicy_t, indicated the way memory is managed in terms of dealing with CacheCha...
uint32_t NetworkConfigSet_t
Definition Types.hpp:88
constexpr uint16_t DEFAULT_ROS2_SERVER_PORT
Definition RTPSParticipantAttributes.hpp:141
constexpr uint16_t DEFAULT_TCP_SERVER_PORT
Definition RTPSParticipantAttributes.hpp:143
std::map< uint8_t, std::map< uint8_t, std::vector< LocatorWithMask > >, std::greater< uint8_t > > ExternalLocators
A collection of LocatorWithMask grouped by externality and cost.
Definition ExternalLocators.hpp:41
DiscoveryProtocol
PDP subclass choice.
Definition RTPSParticipantAttributes.hpp:69
@ EXTERNAL
A user defined PDP subclass object must be provided in the attributes that deals with the discovery.
@ SERVER
The participant will behave as a server concerning discovery operation.
@ NONE
NO discovery whatsoever would be used.
@ BACKUP
The participant will behave as a server concerning discovery operation.
@ SIMPLE
Discovery works according to 'The Real-time Publish-Subscribe Protocol(RTPS) DDS Interoperability Wir...
@ SUPER_CLIENT
The participant will behave as a client concerning all internal behaviour.
@ CLIENT
The participant will behave as a client concerning discovery operation.
ParticipantFilteringFlags
Filtering flags when discovering participants.
Definition RTPSParticipantAttributes.hpp:147
@ FILTER_DIFFERENT_HOST
Definition RTPSParticipantAttributes.hpp:149
@ NO_FILTER
Definition RTPSParticipantAttributes.hpp:148
@ FILTER_SAME_PROCESS
Definition RTPSParticipantAttributes.hpp:151
@ FILTER_DIFFERENT_PROCESS
Definition RTPSParticipantAttributes.hpp:150
Structure Time_t, used to describe times at a DDS level.
Definition Time_t.hpp:36
Options for configuring the built-in transports when using LARGE_DATA mode.
Definition BuiltinTransports.hpp:37
Structure GuidPrefix_t, Guid Prefix of GUID_t.
Definition GuidPrefix_t.hpp:37
Struct InitialAnnouncementConfig defines the behavior of the RTPSParticipant initial announcements.
Definition RTPSParticipantAttributes.hpp:227
dds::Duration_t period
Specific period for initial announcements (default 100ms)
Definition RTPSParticipantAttributes.hpp:232
bool operator==(const InitialAnnouncementConfig &b) const
Definition RTPSParticipantAttributes.hpp:234
uint32_t count
Number of initial announcements with specific period (default 5)
Definition RTPSParticipantAttributes.hpp:229
Definition RTPSParticipantAttributes.hpp:161
bool operator==(const struct PDPFactory &e) const
Definition RTPSParticipantAttributes.hpp:168
void(* ReleasePDPInstance)(PDP *)
Definition RTPSParticipantAttributes.hpp:165
PDP *(* CreatePDPInstance)(BuiltinProtocols *)
Definition RTPSParticipantAttributes.hpp:163
Struct to define participant types to set participant type parameter property.
Definition RTPSParticipantAttributes.hpp:50
static constexpr const char * SIMPLE
Definition RTPSParticipantAttributes.hpp:51
static constexpr const char * CLIENT
Definition RTPSParticipantAttributes.hpp:53
static constexpr const char * EXTERNAL
Definition RTPSParticipantAttributes.hpp:57
static constexpr const char * UNKNOWN
Definition RTPSParticipantAttributes.hpp:58
static constexpr const char * SUPER_CLIENT
Definition RTPSParticipantAttributes.hpp:54
static constexpr const char * SERVER
Definition RTPSParticipantAttributes.hpp:52
static constexpr const char * NONE
Definition RTPSParticipantAttributes.hpp:56
static constexpr const char * BACKUP
Definition RTPSParticipantAttributes.hpp:55
Holds allocation limits affecting collections managed by a participant.
Definition RTPSParticipantAllocationAttributes.hpp:129
Struct ThreadSettings to specify various thread settings.
Definition ThreadSettings.hpp:37