14.1.5.1. Topic

class eprosima::fastdds::dds::Topic : public eprosima::fastdds::dds::DomainEntity, public eprosima::fastdds::dds::TopicDescription

Class TopicDescription, represents the fact that both publications and subscriptions are tied to a single data-type

Public Functions

~Topic()

Destructor.

DomainParticipant *get_participant() const override

Getter for the DomainParticipant.

Return

DomainParticipant pointer

ReturnCode_t get_inconsistent_topic_status(InconsistentTopicStatus &status)

Allows the application to retrieve the INCONSISTENT_TOPIC_STATUS status of a Topic.

Return

RETCODE_OK

Parameters
  • status: [out] Status to be retrieved.

const TopicQos &get_qos() const

Allows accessing the Topic Qos.

Return

reference to TopicQos

ReturnCode_t get_qos(TopicQos &qos) const

Retrieves the Topic Qos.

Return

RETCODE_OK

Parameters
  • qos: TopicQos where the qos is returned

ReturnCode_t set_qos(const TopicQos &qos)

Allows modifying the Topic Qos. The given Qos must be supported by the Topic.

Parameters
Return Value
  • RETCODE_IMMUTABLE_POLICY: if a change was not allowed.

  • RETCODE_INCONSISTENT_POLICY: if new qos has inconsistent values.

  • RETCODE_OK: if qos was updated.

const TopicListener *get_listener() const

Retrieves the attached TopicListener.

Return

pointer to TopicListener

ReturnCode_t set_listener(TopicListener *listener, const StatusMask &mask = StatusMask::all())

Modifies the TopicListener.

Return

RETCODE_OK

Parameters
  • listener: new value for the TopicListener

  • mask: StatusMask that holds statuses the listener responds to (default: all).

TopicDescriptionImpl *get_impl() const override

Getter for the TopicDescriptionImpl.

Return

pointer to TopicDescriptionImpl