RTI Connext Traditional C++ API Version 7.1.0
DDSTopic Class Referenceabstract

<<interface>> The most basic description of the data to be published and subscribed. More...

Inheritance diagram for DDSTopic:
DDSDomainEntity DDSTopicDescription DDSEntity

Public Member Functions

virtual DDS_ReturnCode_t get_inconsistent_topic_status (DDS_InconsistentTopicStatus &status)=0
 Allows the application to retrieve the DDS_INCONSISTENT_TOPIC_STATUS status of a DDSTopic. More...
 
virtual DDS_ReturnCode_t set_qos (const DDS_TopicQos &qos)=0
 Set the topic QoS. More...
 
virtual DDS_ReturnCode_t set_qos_with_profile (const char *library_name, const char *profile_name)=0
 <<extension>> Change the QoS of this topic using the input XML QoS profile. More...
 
virtual DDS_ReturnCode_t get_qos (DDS_TopicQos &qos)=0
 Get the topic QoS. More...
 
virtual DDS_ReturnCode_t set_listener (DDSTopicListener *l, DDS_StatusMask mask=DDS_STATUS_MASK_ALL)=0
 Set the topic listener. More...
 
virtual DDSTopicListenerget_listener ()=0
 Get the topic listener. More...
 
- Public Member Functions inherited from DDSEntity
virtual DDS_ReturnCode_t enable ()=0
 Enables the DDSEntity. More...
 
virtual DDSStatusConditionget_statuscondition ()=0
 Allows access to the DDSStatusCondition associated with the DDSEntity. More...
 
virtual DDS_StatusMask get_status_changes ()=0
 Retrieves the list of communication statuses in the DDSEntity that are triggered. More...
 
virtual DDS_InstanceHandle_t get_instance_handle ()=0
 Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. More...
 
- Public Member Functions inherited from DDSTopicDescription
virtual const char * get_type_name ()=0
 Get the associated type_name. More...
 
virtual const char * get_name ()=0
 Get the name used to create this DDSTopicDescription . More...
 
virtual DDSDomainParticipantget_participant ()=0
 Get the DDSDomainParticipant to which the DDSTopicDescription belongs. More...
 

Static Public Member Functions

static DDSTopicnarrow (DDSTopicDescription *topic_description)
 Narrow the given DDSTopicDescription pointer to a DDSTopic pointer. More...
 

Detailed Description

<<interface>> The most basic description of the data to be published and subscribed.

QoS:
DDS_TopicQos
Status:
DDS_INCONSISTENT_TOPIC_STATUS, DDS_InconsistentTopicStatus
Listener:
DDSTopicListener

A DDSTopic is identified by its name, which must be unique in the whole domain. In addition (by virtue of extending DDSTopicDescription) it fully specifies the type of the data that can be communicated when publishing or subscribing to the DDSTopic.

DDSTopic is the only DDSTopicDescription that can be used for publications and therefore associated with a DDSDataWriter.

The following operations may be called even if the DDSTopic is not enabled. Other operations will fail with the value DDS_RETCODE_NOT_ENABLED if called on a disabled DDSTopic:

See also
Operations Allowed in Listener Callbacks
Examples
HelloWorld_publisher.cxx, and HelloWorld_subscriber.cxx.

Member Function Documentation

◆ narrow()

static DDSTopic * DDSTopic::narrow ( DDSTopicDescription topic_description)
static

Narrow the given DDSTopicDescription pointer to a DDSTopic pointer.

Returns
DDSTopic if this DDSTopicDescription is a DDSTopic. Otherwise, return NULL.

◆ get_inconsistent_topic_status()

virtual DDS_ReturnCode_t DDSTopic::get_inconsistent_topic_status ( DDS_InconsistentTopicStatus status)
pure virtual

Allows the application to retrieve the DDS_INCONSISTENT_TOPIC_STATUS status of a DDSTopic.

Retrieve the current DDS_InconsistentTopicStatus

Parameters
status<<inout>> Status to be retrieved.
Exceptions
Oneof the Standard Return Codes
See also
DDS_InconsistentTopicStatus

◆ set_qos()

virtual DDS_ReturnCode_t DDSTopic::set_qos ( const DDS_TopicQos qos)
pure virtual

Set the topic QoS.

The DDS_TopicQos::topic_data and DDS_TopicQos::deadline, DDS_TopicQos::latency_budget, DDS_TopicQos::transport_priority and DDS_TopicQos::lifespan can be changed. The other policies are immutable.

Parameters
qos<<in>> Set of policies to be applied to DDSTopic.

Policies must be consistent. Immutable policies cannot be changed after DDSTopic is enabled. The special value DDS_TOPIC_QOS_DEFAULT can be used to indicate that the QoS of the DDSTopic should be changed to match the current default DDS_TopicQos set in the DDSDomainParticipant.

Exceptions
Oneof the Standard Return Codes, DDS_RETCODE_IMMUTABLE_POLICY if immutable policy is changed, or DDS_RETCODE_INCONSISTENT_POLICY if policies are inconsistent
See also
DDS_TopicQos for rules on consistency among QoS
set_qos (abstract)
Operations Allowed in Listener Callbacks

◆ set_qos_with_profile()

virtual DDS_ReturnCode_t DDSTopic::set_qos_with_profile ( const char *  library_name,
const char *  profile_name 
)
pure virtual

<<extension>> Change the QoS of this topic using the input XML QoS profile.

The DDS_TopicQos::topic_data and DDS_TopicQos::deadline, DDS_TopicQos::latency_budget, DDS_TopicQos::transport_priority and DDS_TopicQos::lifespan can be changed. The other policies are immutable.

Parameters
library_name<<in>> Library name containing the XML QoS profile. If library_name is null RTI Connext will use the default library (see DDSDomainParticipant::set_default_library).
profile_name<<in>> XML QoS Profile name. If profile_name is null RTI Connext will use the default profile (see DDSDomainParticipant::set_default_profile).
Exceptions
Oneof the Standard Return Codes, DDS_RETCODE_IMMUTABLE_POLICY if immutable policy is changed, or DDS_RETCODE_INCONSISTENT_POLICY if policies are inconsistent
See also
DDS_TopicQos for rules on consistency among QoS
Operations Allowed in Listener Callbacks

◆ get_qos()

virtual DDS_ReturnCode_t DDSTopic::get_qos ( DDS_TopicQos qos)
pure virtual

Get the topic QoS.

This method may potentially allocate memory depending on the sequences contained in some QoS policies.

Parameters
qos<<inout>> QoS to be filled up.
Exceptions
Oneof the Standard Return Codes
See also
get_qos (abstract)

◆ set_listener()

virtual DDS_ReturnCode_t DDSTopic::set_listener ( DDSTopicListener l,
DDS_StatusMask  mask = DDS_STATUS_MASK_ALL 
)
pure virtual

Set the topic listener.

Parameters
l<<in>> Listener to be installed on entity.
mask<<in>> Changes of communication status to be invoked on the listener. See DDS_StatusMask.
Exceptions
Oneof the Standard Return Codes
See also
set_listener (abstract)

◆ get_listener()

virtual DDSTopicListener * DDSTopic::get_listener ( )
pure virtual

Get the topic listener.

Returns
Existing listener attached to the DDSTopic.
See also
get_listener (abstract)