18.1.5.4. Topic

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

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

Public Functions

virtual DomainParticipant *get_participant() const override

Getter for the DomainParticipant.

Returns

DomainParticipant pointer

ReturnCode_t get_inconsistent_topic_status(InconsistentTopicStatus &status)

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

Warning

Not supported yet. Currently returns RETCODE_UNSUPPORTED

Parameters

status – [out] Status to be retrieved.

Returns

RETCODE_OK

const TopicQos &get_qos() const

Allows accessing the Topic Qos.

Returns

reference to TopicQos

ReturnCode_t get_qos(TopicQos &qos) const

Retrieves the Topic Qos.

Parameters

qosTopicQos where the qos is returned

Returns

RETCODE_OK

ReturnCode_t set_qos(const TopicQos &qos)

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

Parameters

qos – new TopicQos value to set for the Topic.

Return values
  • 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.

Returns

pointer to TopicListener

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

Modifies the TopicListener.

Parameters
  • listener – new value for the TopicListener

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

Returns

RETCODE_OK