17.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

virtual ~Topic()

Destructor.

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.

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.

Returns RETCODE_IMMUTABLE_POLICY

if a change was not allowed.

Returns RETCODE_INCONSISTENT_POLICY

if new qos has inconsistent values.

Returns 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

virtual TopicDescriptionImpl *get_impl() const override

Getter for the TopicDescriptionImpl.

Returns

pointer to TopicDescriptionImpl