CoreDX DDS C++ Reference Manual
Public Member Functions | List of all members
DDS::Topic Class Reference

Topic is the basic description of data to be published or subscribed. More...

Inheritance diagram for DDS::Topic:
DDS::TopicDescription DDS::Entity

Public Member Functions

const char * get_type_name ()
 This operation returns type_name of the provided Topic.
const char * get_name ()
 This operation returns topic name of the provided Topic.
DomainParticipantget_participant ()
 This operation returns DomainParticipant that owns the Topic.
StatusMask get_status_changes ()
 This returns the list of triggered communication statuses in the Topic. More...
ReturnCode_t enable ()
 Enables the Topic. More...
ReturnCode_t set_qos (const TopicQos &qos)
 Sets the TopicQos values. More...
ReturnCode_t get_qos (TopicQos &qos)
 Returns the current TopicQos settings held in the Topic t. More...
ReturnCode_t set_listener (TopicListener *a_listener, StatusMask mask)
 Installs a TopicListener on Topic t. More...
TopicListenerget_listener ()
 This operation returns the currently installed TopicListener. More...
ReturnCode_t get_inconsistent_topic_status (InconsistentTopicStatus *a_status)
 Provides access to the InconsistentTopicStatus of the Topic. More...
- Public Member Functions inherited from DDS::Entity
virtual StatusConditionget_statuscondition ()
 Gets the StatusCondition associated with this Entity. NOTE: The entity maintains ownership of the statuscondition, and it remains valid only as long as the Entity is valid. Destroying the Entity also destroys the status condition.
virtual InstanceHandle_t get_instance_handle ()
 Gets the handle that locally identifies this Entity.

Detailed Description

Topic is the basic description of data to be published or subscribed.

A topic is identified by a name and a type. A Topic is created by calling DomainParticipant::create_topic(). Prior to creating a Topic, the associated data type must be registered with the DomainParticipant via a call to the TypeSupport::register_type() function. [The register_type() function is auto-generated 'type-specific' code.]

Member Function Documentation

ReturnCode_t DDS::Topic::enable ( )

Enables the Topic.

A Topic is created either enabled or not based on the DomainParticipantQos setting entity_factory. When a Topic is not enabled, only the following sub-set of all Topic operations are legal:

Any other operation may return the NOT_ENABLED error. Topic::enable() may be called on an already enabled Topic [it will have no effect].

Reimplemented from DDS::Entity.

ReturnCode_t DDS::Topic::get_inconsistent_topic_status ( InconsistentTopicStatus *  a_status)

Provides access to the InconsistentTopicStatus of the Topic.

As a side-effect, this routine will reset the total_count_change status field to zero.

TopicListener* DDS::Topic::get_listener ( )

This operation returns the currently installed TopicListener.

Because the infrastructure makes a copy of the listener provided in Topic::set_listener(), the returned structure pointer will not match the pointer originally provided. However, the function pointers within the structure will match. Also, the application should not free the data referenced by the returned pointer.
ReturnCode_t DDS::Topic::get_qos ( TopicQos qos)

Returns the current TopicQos settings held in the Topic t.

This routine copies the Topic QoS properites into qos.

The qos structure may contain sequences or strings that are populated with dynamic memory. The caller is responsible for freeing the dynamic memory of these items.
For example, the sequence 'qos->topic_data' may have dynamically allocated memory assigned. This can be released by a call to seq_clear(&qos->topic_data).
StatusMask DDS::Topic::get_status_changes ( )

This returns the list of triggered communication statuses in the Topic.

If the Topic is not enabled, all statuses will be untriggered.

Implements DDS::Entity.

ReturnCode_t DDS::Topic::set_listener ( TopicListener a_listener,
StatusMask  mask 

Installs a TopicListener on Topic t.

Only one listener may be attached to a Topic at a time. A call to set_listener() will replace any current listener with a_listener.

a_listener can be NULL, which indicates a listener that does nothing.

The infrastructure will make an internal copy of the listener structure so that it need not be persisted by the application.

ReturnCode_t DDS::Topic::set_qos ( const TopicQos qos)

Sets the TopicQos values.

These QoS values affect the behavior of the Topic.

© 2009-2017 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.