RTI Connext DDS Micro C++ API
Version 3.0.3
|
<<interface>> A subscriber is the object responsible for actually receiving data from a subscription. More...
#include <dds_cpp_subscription.hxx>
Public Member Functions | |
virtual DDSDataReader * | create_datareader (DDSTopicDescription *topic, const DDS_DataReaderQos &qos, DDSDataReaderListener *listener, DDS_StatusMask mask)=0 |
<<cert>> Creates a DDSDataReader that will be attached and belong to the DDSSubscriber. | |
virtual DDS_ReturnCode_t | delete_datareader (DDSDataReader *a_datareader)=0 |
Deletes a DDSDataReader that belongs to the DDSSubscriber. | |
virtual DDS_ReturnCode_t | get_default_datareader_qos (DDS_DataReaderQos &qos)=0 |
Copies the default DDS_DataReaderQos values into the provided DDS_DataReaderQos instance. | |
virtual DDS_ReturnCode_t | set_default_datareader_qos (const DDS_DataReaderQos &qos)=0 |
Sets the default DDS_DataReaderQos values for this subscriber. | |
virtual DDS_ReturnCode_t | delete_contained_entities ()=0 |
Deletes all the entities that were created by means of the "create" operation on the DDSSubscriber. | |
virtual DDSDataReader * | lookup_datareader (const char *topic_name)=0 |
<<cert>> Retrieves an existing DDSDataReader. | |
virtual DDSDataReader * | lookup_datareader_by_name (const char *reader_name)=0 |
<<cert>> Retrieves a DDSDataReader by its entity name within this DDSSubscriber | |
virtual DDSDomainParticipant * | get_participant ()=0 |
<<cert>> Returns the DDSDomainParticipant to which the DDSSubscriber belongs. | |
virtual DDS_ReturnCode_t | set_qos (const DDS_SubscriberQos &qos)=0 |
Sets the subscriber QoS. | |
virtual DDS_ReturnCode_t | get_qos (DDS_SubscriberQos &qos)=0 |
Gets the subscriber QoS. | |
virtual DDS_ReturnCode_t | set_listener (const DDSSubscriberListener *listener, DDS_StatusMask mask)=0 |
Sets the subscriber listener. | |
virtual DDSSubscriberListener * | get_listener ()=0 |
Get the subscriber listener. | |
Public Member Functions inherited from DDSEntity | |
DDS_ReturnCode_t | enable () |
<<cert>> Enables the DDSEntity. | |
DDSStatusCondition * | get_statuscondition () |
<<cert>> Return the DDSStatusCondition associated with a particular DDSEntity. | |
DDS_StatusMask | get_status_changes () |
<<cert>> Retrieves the list of communication statuses in the DDSEntity that are triggered. | |
DDS_InstanceHandle_t | get_instance_handle () |
<<cert>> Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. |
<<interface>> A subscriber is the object responsible for actually receiving data from a subscription.
A subscriber acts on the behalf of one or several DDSDataReader objects that are related to it. When it receives data (from the other parts of the system), it builds the list of concerned DDSDataReader objects and then indicates to the application that data is available through its listener.
The application can access the list of concerned DDSDataReader objects through the operation get_datareaders() and then access the data available through operations on the DDSDataReader.
The following operations may be called even if the DDSSubscriber is not enabled. Other operations will the value DDS_RETCODE_NOT_ENABLED if called on a disabled DDSSubscriber:
All operations except for the base-class operations enable() and create_datareader() may fail with DDS_RETCODE_NOT_ENABLED.
|
pure virtual |
<<cert>> Creates a DDSDataReader that will be attached and belong to the DDSSubscriber.
topic | <<in>> The DDSTopicDescription that the DDSDataReader will be associated with. Cannot be NULL. |
qos | <<in>> The qos of the DDSDataReader. The special value DDS_DATAREADER_QOS_DEFAULT can be used to indicate that the DDSDataReader should be created with the default DDS_DataReaderQos set in the DDSSubscriber. If DDSTopicDescription is of type DDSTopic, the special value DDS_DATAREADER_QOS_USE_TOPIC_QOS can be used to indicate that the DDSDataReader should be created with the combination of the default DDS_DataReaderQos set on the DDSSubscriber and the DDS_TopicQos. |
listener | <<in>> The listener of the DDSDataReader. |
mask | <<in>>. Changes of communication status to be invoked on the listener. |
|
pure virtual |
Deletes a DDSDataReader that belongs to the DDSSubscriber.
a_datareader | <<in>> The DDSDataReader to be deleted. |
|
pure virtual |
Copies the default DDS_DataReaderQos values into the provided DDS_DataReaderQos instance.
The retreived qos
will match the set of values specified on the last successful call to DDSSubscriber::set_default_datareader_qos, or else, if the call was never made, the default values from is owning DDSDomainParticipant.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
qos
parameter. qos | <<inout>> DDS_DataReaderQos to be filled-up. |
|
pure virtual |
Sets the default DDS_DataReaderQos values for this subscriber.
This call causes the default values inherited from the owning DDSDomainParticipant to be overridden.
This default value will be used for newly created DDSDataReader if DDS_DATAREADER_QOS_DEFAULT is specified as the qos
parameter when DDSSubscriber::create_datareader is called.
qos
parameter. qos | <<in>> The default DDS_DataReaderQos to be set to. The special value DDS_DATAREADER_QOS_DEFAULT may be passed as qos to indicate that the default QoS should be reset back to the initial values the factory would have used if DDSSubscriber::set_default_datareader_qos had never been called. |
|
pure virtual |
Deletes all the entities that were created by means of the "create" operation on the DDSSubscriber.
Deletes all contained DDSDataReader objects. This pattern is applied recursively. In this manner, the operation DDSSubscriber::delete_contained_entities on the DDSSubscriber will end up deleting all the entities recursively contained in the DDSSubscriber, that is also the objects belonging to the contained DDSDataReader.
The operation will fail with DDS_RETCODE_PRECONDITION_NOT_MET if any of the contained entities is in a state where it cannot be deleted. This will occur, for example, if a contained DDSDataReader cannot be deleted because the application has called a FooDataReader::read or FooDataReader::take operation and has not called the corresponding FooDataReader::return_loan operation to return the loaned samples.
Once DDSSubscriber::delete_contained_entities completes successfully, the application may delete the DDSSubscriber, knowing that it has no contained DDSDataReader objects.
|
pure virtual |
<<cert>> Retrieves an existing DDSDataReader.
Use this operation on the built-in DDSSubscriber (Discovery) to access the built-in DDSDataReader entities for the built-in topics.
The built-in DDSDataReader is created when this operation is called on a built-in topic for the first time. The built-in DDSDataReader is deleted automatically when the DDSDomainParticipant is deleted.
To ensure that builtin DDSDataReader entities receive all the discovery traffic, it is suggested that you lookup the builtin DDSDataReader before the DDSDomainParticipant is enabled. Looking up builtin DDSDataReader may implicitly register builtin transports due to creation of DDSDataReader. Therefore, if you are want to modify builtin transport properties, do so before using this operation.
Therefore the suggested sequence when looking up builtin DataReaders is:
topic_name | <<in>> Name of the DDSTopicDescription that the retrieved DDSDataReader is attached to. Cannot be NULL. |
topic_name
. If no such DDSDataReader exists, this operation returns NULL. The returned DDSDataReader may be enabled or disabled.
If more than one DDSDataReader is attached to the DDSSubscriber, this operation may return any one of them.
|
pure virtual |
<<cert>> Retrieves a DDSDataReader by its entity name within this DDSSubscriber
This returned DDSDataReader is either enabled or disabled.
Every DDSDataReader in the system has an entity name which is configured and stored in the EntityName policy, ENTITY_NAME.
This operation retrieves a DDSDataReader within the DDSSubscriber given the entity's name. If there are several DDSDataReader with the same name within the DDSSubscriber, this function returns the first matching occurrence.
reader_name | <<in>> Entity name of the DDSDataReader. Cannot be NULL. |
|
pure virtual |
<<cert>> Returns the DDSDomainParticipant to which the DDSSubscriber belongs.
|
pure virtual |
Sets the subscriber QoS.
This operation modifies the QoS of the DDSSubscriber.
The DDS_SubscriberQos::entity_factory can be changed. The other policies are immutable.
qos | <<in>> DDS_SubscriberQos to be set to. Policies must be consistent. Policies cannot be changed after DDSSubscriber is enabled. The special value DDS_SUBSCRIBER_QOS_DEFAULT can be used to indicate that the QoS of the DDSSubscriber should be changed to match the current default DDS_SubscriberQos set in the DDSDomainParticipant. |
|
pure virtual |
Gets the subscriber QoS.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
qos | <<in>> DDS_SubscriberQos to be filled in. |
|
pure virtual |
Sets the subscriber listener.
listener | <<in>> DDSSubscriberListener to set to. |
mask | <<in>> DDS_StatusMask associated with the DDSSubscriberListener. |
|
pure virtual |
Get the subscriber listener.