Class Domain

Class Documentation

class Domain

Class Domain, use to interact with the Publisher Subscriber API of the Fast RTPS implementation.

Public Static Functions

static RTPS_DllAPI DEPRECATED Participant * createParticipant (const std::string &participant_profile, ParticipantListener *listen=nullptr)

Create a Participant from a profile name.

Parameters:
Returns:

Participant pointer. (nullptr if not created.)

static RTPS_DllAPI DEPRECATED Participant * createParticipant (const ParticipantAttributes &att, ParticipantListener *listen=nullptr)

Create a Participant.

Parameters:
Returns:

Participant pointer. (nullptr if not created.)

static RTPS_DllAPI void getDefaultParticipantAttributes (ParticipantAttributes &participant_attributes)

Fills participant_attributes with the default values.

static RTPS_DllAPI Publisher * createPublisher (Participant *part, const std::string &publisher_profile, PublisherListener *listen=nullptr)

Create a Publisher in a Participant from a profile name.

Parameters:
Returns:

Pointer to the created Publisher (nullptr if not created).

static RTPS_DllAPI Publisher * createPublisher (Participant *part, const PublisherAttributes &att, PublisherListener *listen=nullptr)

Create a Publisher in a Participant.

Parameters:
Returns:

Pointer to the created Publisher (nullptr if not created).

static RTPS_DllAPI void getDefaultPublisherAttributes (PublisherAttributes &publisher_attributes)

Fills publisher_attributes with the default values.

static RTPS_DllAPI Subscriber * createSubscriber (Participant *part, const std::string &subscriber_profile, SubscriberListener *listen=nullptr)

Create a Subscriber in a Participant from a profile name.

Parameters:
Returns:

Pointer to the created Subscriber (nullptr if not created).

static RTPS_DllAPI Subscriber * createSubscriber (Participant *part, const SubscriberAttributes &att, SubscriberListener *listen=nullptr)

Create a Subscriber in a Participant.

Parameters:
Returns:

Pointer to the created Subscriber (nullptr if not created).

static RTPS_DllAPI void getDefaultSubscriberAttributes (SubscriberAttributes &subscriber_attributes)

Fills subscriber_attributes with the default values.

static RTPS_DllAPI bool removeParticipant (Participant *part)

Remove a Participant and all associated publishers and subscribers.

Parameters:

part – Pointer to the participant.

Returns:

True if correctly removed.

static RTPS_DllAPI bool removePublisher (Publisher *pub)

Remove a Publisher.

Parameters:

pub – Pointer to the Publisher.

Returns:

True if correctly removed.

static RTPS_DllAPI bool removeSubscriber (Subscriber *sub)

Remove a Subscriber.

Parameters:

sub – Pointer to the Subscriber.

Returns:

True if correctly removed.

static RTPS_DllAPI bool getRegisteredType (Participant *part, const char *typeName, fastdds::dds::TopicDataType **type)

Return a registered type.

Parameters:
  • part – Pointer to the Participant.

  • typeName – Name of the type.

  • type – Returned type.

Returns:

True if type was found.

static RTPS_DllAPI bool registerType (Participant *part, fastdds::dds::TopicDataType *type)

Register a type in a participant.

Parameters:
  • part – Pointer to the Participant.

  • type – Pointer to the Type.

Returns:

True if correctly registered.

static RTPS_DllAPI bool registerDynamicType (Participant *part, types::DynamicPubSubType *type)

Register a type in a participant.

Parameters:
  • part – Pointer to the Participant.

  • type – Pointer to the Type.

Returns:

True if correctly registered.

static RTPS_DllAPI bool unregisterType (Participant *part, const char *typeName)

Unregister a type in a participant.

Parameters:
  • part – Pointer to the Participant.

  • typeName – Name of the type.

Returns:

True if correctly unregistered.

static RTPS_DllAPI void stopAll ()

Stop and remove all participants, publishers and subscribers in this Domain.

static RTPS_DllAPI bool loadXMLProfilesFile (const std::string &xml_profile_file)

Load profiles from XML file.

Parameters:

xml_profile_file – XML profile file.

Returns:

True if correctly loaded.

static RTPS_DllAPI bool loadXMLProfilesString (const char *data, size_t length)

Load profiles from XML string.

Parameters:
  • data – buffer containing XML data.

  • length – length of data.

Returns:

True if correctly loaded.