15.2.7.2. RTPSParticipant

class eprosima::fastrtps::rtps::RTPSParticipant

Class RTPSParticipant, contains the public API for a RTPSParticipant.

Public Functions

const GUID_t &getGuid() const

Get the GUID_t of the RTPSParticipant.

void announceRTPSParticipantState()

Force the announcement of the RTPSParticipant state.

void stopRTPSParticipantAnnouncement()

Stop the RTPSParticipant announcement period. //TODO remove this method because is only for testing.

void resetRTPSParticipantAnnouncement()

Reset the RTPSParticipant announcement period. //TODO remove this method because is only for testing.

bool newRemoteWriterDiscovered(const GUID_t &pguid, int16_t userDefinedId)

Indicate the Participant that you have discovered a new Remote Writer. This method can be used by the user to implements its own Static Endpoint Discovery Protocol

Return

True if correctly added.

Parameters
  • pguid: GUID_t of the discovered Writer.

  • userDefinedId: ID of the discovered Writer.

bool newRemoteReaderDiscovered(const GUID_t &pguid, int16_t userDefinedId)

Indicate the Participant that you have discovered a new Remote Reader. This method can be used by the user to implements its own Static Endpoint Discovery Protocol

Return

True if correctly added.

Parameters
  • pguid: GUID_t of the discovered Reader.

  • userDefinedId: ID of the discovered Reader.

uint32_t getRTPSParticipantID() const

Get the Participant ID.

Return

Participant ID.

bool registerWriter(RTPSWriter *Writer, const TopicAttributes &topicAtt, const WriterQos &wqos)

Register a RTPSWriter in the builtin Protocols.

Return

True if correctly registered.

Parameters
  • Writer: Pointer to the RTPSWriter.

  • topicAtt: Topic Attributes where you want to register it.

  • wqos: WriterQos.

bool registerReader(RTPSReader *Reader, const TopicAttributes &topicAtt, const ReaderQos &rqos)

Register a RTPSReader in the builtin Protocols.

Return

True if correctly registered.

Parameters
  • Reader: Pointer to the RTPSReader.

  • topicAtt: Topic Attributes where you want to register it.

  • rqos: ReaderQos.

bool updateWriter(RTPSWriter *Writer, const TopicAttributes &topicAtt, const WriterQos &wqos)

Update writer QOS

Return

true on success

Parameters
  • Writer: to update

  • topicAtt: Topic Attributes where you want to register it.

  • wqos: New writer QoS

bool updateReader(RTPSReader *Reader, const TopicAttributes &topicAtt, const ReaderQos &rqos)

Update reader QOS

Return

true on success

Parameters
  • Reader: to update

  • topicAtt: Topic Attributes where you want to register it.

  • rqos: New reader QoS

std::vector<std::string> getParticipantNames() const

Returns a list with the participant names.

Return

list of participant names.

const RTPSParticipantAttributes &getRTPSParticipantAttributes() const

Get a copy of the actual state of the RTPSParticipantParameters

Return

RTPSParticipantAttributes copy of the params.

uint32_t getMaxMessageSize() const

Retrieves the maximum message size.

uint32_t getMaxDataSize() const

Retrieves the maximum data size.

WLP *wlp() const

A method to retrieve the built-in writer liveliness protocol.

Return

Writer liveliness protocol

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 other case.

Return

True if filled or the entityId is available.

Parameters
  • entityId: to check of fill. If filled, EntityKind will be “vendor-specific” (0x01)

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.

fastdds::dds::builtin::TypeLookupManager *typelookup_manager() const

Retrieves the built-in typelookup service manager.

Return

void set_listener(RTPSParticipantListener *listener)

Modifies the participant listener.

Parameters
  • listener:

uint32_t get_domain_id() const

Retrieves the DomainId.

void enable()

This operation enables the RTPSParticipantImpl.