RTI Connext C++ API
Version 5.1.0
|
<<interface>> Allows the application to: (1) declare the data it wishes to receive (i.e. make a subscription) and (2) access the data received by the attached DDSSubscriber. More...
Public Member Functions | |
virtual DDSReadCondition * | create_readcondition (DDS_SampleStateMask sample_states, DDS_ViewStateMask view_states, DDS_InstanceStateMask instance_states) |
Creates a DDSReadCondition. | |
virtual DDSQueryCondition * | create_querycondition (DDS_SampleStateMask sample_states, DDS_ViewStateMask view_states, DDS_InstanceStateMask instance_states, const char *query_expression, const struct DDS_StringSeq &query_parameters) |
Creates a DDSQueryCondition. | |
virtual DDS_ReturnCode_t | delete_readcondition (DDSReadCondition *condition) |
Deletes a DDSReadCondition or DDSQueryCondition attached to the DDSDataReader. | |
virtual DDS_ReturnCode_t | delete_contained_entities () |
Deletes all the entities that were created by means of the "create" operations on the DDSDataReader. | |
virtual DDS_ReturnCode_t | wait_for_historical_data (const DDS_Duration_t &max_wait) |
Waits until all "historical" data is received for DDSDataReader entities that have a non-VOLATILE Durability Qos kind. | |
virtual DDS_ReturnCode_t | acknowledge_sample (const DDS_SampleInfo &sample_info) |
Acknowledge a single sample explicitly. | |
virtual DDS_ReturnCode_t | acknowledge_all () |
Acknowledge all previously accessed samples. | |
virtual DDS_ReturnCode_t | acknowledge_sample (const DDS_SampleInfo &sample_info, const DDS_AckResponseData_t &response_data) |
[Not supported.] Acknowledge a single sample explicitly | |
virtual DDS_ReturnCode_t | acknowledge_all (const DDS_AckResponseData_t &response_data) |
[Not supported.] Acknowledge all previously accessed samples | |
virtual DDS_ReturnCode_t | get_matched_publications (DDS_InstanceHandleSeq &publication_handles) |
Retrieve the list of publications currently "associated" with this DDSDataReader. | |
virtual DDS_ReturnCode_t | get_matched_publication_data (DDS_PublicationBuiltinTopicData &publication_data, const DDS_InstanceHandle_t &publication_handle) |
This operation retrieves the information on a publication that is currently "associated" with the DDSDataReader. | |
virtual DDS_ReturnCode_t | get_matched_publication_participant_data (DDS_ParticipantBuiltinTopicData &participant_data, const DDS_InstanceHandle_t &publication_handle) |
This operation retrieves the information on the discovered DDSDomainParticipant associated with the publication that is currently matching with the DDSDataReader. | |
virtual DDSTopicDescription * | get_topicdescription () |
Returns the DDSTopicDescription associated with the DDSDataReader. | |
virtual DDSSubscriber * | get_subscriber () |
Returns the DDSSubscriber to which the DDSDataReader belongs. | |
virtual DDS_ReturnCode_t | get_sample_rejected_status (DDS_SampleRejectedStatus &status) |
Accesses the DDS_SAMPLE_REJECTED_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_liveliness_changed_status (DDS_LivelinessChangedStatus &status) |
Accesses the DDS_LIVELINESS_CHANGED_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_requested_deadline_missed_status (DDS_RequestedDeadlineMissedStatus &status) |
Accesses the DDS_REQUESTED_DEADLINE_MISSED_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_requested_incompatible_qos_status (DDS_RequestedIncompatibleQosStatus &status) |
Accesses the DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_sample_lost_status (DDS_SampleLostStatus &status) |
Accesses the DDS_SAMPLE_LOST_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_subscription_matched_status (DDS_SubscriptionMatchedStatus &status) |
Accesses the DDS_SUBSCRIPTION_MATCHED_STATUS communication status. | |
virtual DDS_ReturnCode_t | get_datareader_cache_status (DDS_DataReaderCacheStatus &status) |
<<eXtension>> Get the datareader cache status for this reader. | |
virtual DDS_ReturnCode_t | get_datareader_protocol_status (DDS_DataReaderProtocolStatus &status) |
<<eXtension>> Get the datareader protocol status for this reader. | |
virtual DDS_ReturnCode_t | get_matched_publication_datareader_protocol_status (DDS_DataReaderProtocolStatus &status, const DDS_InstanceHandle_t &publication_handle) |
<<eXtension>> Get the datareader protocol status for this reader, per matched publication identified by the publication_handle. | |
virtual DDS_ReturnCode_t | set_qos (const DDS_DataReaderQos &qos) |
Sets the reader QoS. | |
virtual DDS_ReturnCode_t | get_qos (DDS_DataReaderQos &qos) |
Gets the reader QoS. | |
virtual DDS_ReturnCode_t | set_qos_with_profile (const char *library_name, const char *profile_name) |
<<eXtension>> Change the QoS of this reader using the input XML QoS profile. | |
virtual DDS_ReturnCode_t | set_listener (DDSDataReaderListener *l, DDS_StatusMask mask=DDS_STATUS_MASK_ALL) |
Sets the reader listener. | |
virtual DDSDataReaderListener * | get_listener () |
Get the reader listener. | |
virtual DDS_ReturnCode_t | enable () |
Enables the DDSEntity. | |
virtual DDSStatusCondition * | get_statuscondition () |
Allows access to the DDSStatusCondition associated with the DDSEntity. | |
virtual DDS_StatusMask | get_status_changes () |
Retrieves the list of communication statuses in the DDSEntity that are triggered. | |
virtual DDS_InstanceHandle_t | get_instance_handle () |
Allows access to the DDS_InstanceHandle_t associated with the DDSEntity. | |
<<interface>> Allows the application to: (1) declare the data it wishes to receive (i.e. make a subscription) and (2) access the data received by the attached DDSSubscriber.
A DDSDataReader refers to exactly one DDSTopicDescription (either a DDSTopic, a DDSContentFilteredTopic or a DDSMultiTopic) that identifies the data to be read.
The subscription has a unique resulting type. The data-reader may give access to several instances of the resulting type, which can be distinguished from each other by their key
.
DDSDataReader is an abstract class. It must be specialised for each particular application data-type (see USER_DATA). The additional methods or functions that must be defined in the auto-generated class for a hypothetical application type Foo
are specified in the generic type FooDataReader.
The following operations may be called even if the DDSDataReader is not enabled. Other operations will fail with the value DDS_RETCODE_NOT_ENABLED if called on a disabled DDSDataReader:
All sample-accessing operations, namely: FooDataReader::read, FooDataReader::take, FooDataReader::read_w_condition, and FooDataReader::take_w_condition may fail with the error DDS_RETCODE_PRECONDITION_NOT_MET as described in DDSSubscriber::begin_access.
|
inlinevirtual |
Creates a DDSReadCondition.
The returned DDSReadCondition will be attached and belong to the DDSDataReader.
sample_states | <<in>> sample state of the data samples that are of interest |
view_states | <<in>> view state of the data samples that are of interest |
instance_states | <<in>> instance state of the data samples that are of interest |
|
inlinevirtual |
Creates a DDSQueryCondition.
The returned DDSQueryCondition will be attached and belong to the DDSDataReader.
Queries and Filters Syntax describes the syntax of query_expression
and query_parameters
.
sample_states | <<in>> sample state of the data samples that are of interest |
view_states | <<in>> view state of the data samples that are of interest |
instance_states | <<in>> instance state of the data samples that are of interest |
query_expression | <<in>> Expression for the query. Cannot be NULL. |
query_parameters | <<in>> Parameters for the query expression. |
|
inlinevirtual |
Deletes a DDSReadCondition or DDSQueryCondition attached to the DDSDataReader.
Since DDSQueryCondition specializes DDSReadCondition, it can also be used to delete a DDSQueryCondition.
condition | <<in>> Condition to be deleted. |
|
inlinevirtual |
Deletes all the entities that were created by means of the "create" operations on the DDSDataReader.
Deletes all contained DDSReadCondition and DDSQueryCondition objects.
The operation will fail with DDS_RETCODE_PRECONDITION_NOT_MET if the any of the contained entities is in a state where it cannot be deleted.
Once DDSDataReader::delete_contained_entities completes successfully, the application may delete the DDSDataReader, knowing that it has no contained DDSReadCondition and DDSQueryCondition objects.
|
inlinevirtual |
Waits until all "historical" data is received for DDSDataReader entities that have a non-VOLATILE Durability Qos kind.
This operation is intended only for DDSDataReader entities that have a non-VOLATILE Durability QoS kind.
As soon as an application enables a non-VOLATILE DDSDataReader, it will start receiving both "historical" data (i.e., the data that was written prior to the time the DDSDataReader joined the domain) as well as any new data written by the DDSDataWriter entities. There are situations where the application logic may require the application to wait until all "historical" data is received. This is the purpose of the DDSDataReader::wait_for_historical_data operations.
DataReader_wait_for_historical_data() blocks the calling thread until either all "historical" data is received, or until the duration specified by the max_wait parameter elapses, whichever happens first. It will return immediately if no DataWriters have been discovered at the time the operation is called; therefore it is advisable to make sure at least one DDSDataWriter has been discovered before calling this operation. (One way to do this is by using DDSDataReader::get_subscription_matched_status.)
A successful completion indicates that all the "historical" data was "received"; timing out indicates that max_wait elapsed before all the data was received.
max_wait | <<in>> Timeout value. |
|
inlinevirtual |
Acknowledge a single sample explicitly.
Applicable only when DDS_ReliabilityQosPolicy::acknowledgment_kind = DDS_APPLICATION_EXPLICIT_ACKNOWLEDGMENT_MODE
A call to this method does not necessarily trigger the sending of an AppAck RTPS message from the DataReader to the DataWriter. How and when AppAck messages are sent can be configured using the QoS values DDS_RtpsReliableReaderProtocol_t::samples_per_app_ack and DDS_RtpsReliableReaderProtocol_t::app_ack_period.
sample_info | <<in>> DDS_SampleInfo identifying the sample being acknowledged. |
|
inlinevirtual |
Acknowledge all previously accessed samples.
Applicable only when DDS_ReliabilityQosPolicy::acknowledgment_kind = DDS_APPLICATION_EXPLICIT_ACKNOWLEDGMENT_MODE
A call to this method does not necessarily trigger the sending of an AppAck RTPS message from the DataReader to the DataWriter. How and when AppAck messages are sent can be configured using the QoS values DDS_RtpsReliableReaderProtocol_t::samples_per_app_ack and DDS_RtpsReliableReaderProtocol_t::app_ack_period.
|
inlinevirtual |
[Not supported.] Acknowledge a single sample explicitly
Applicable only when DDS_ReliabilityQosPolicy::acknowledgment_kind = DDS_APPLICATION_EXPLICIT_ACKNOWLEDGMENT_MODE
sample_info | <<in>> DDS_SampleInfo identifying the sample being acknowledged. |
response_data | <<in>> Response data sent to DDSDataWriter upon acknowledgment |
|
inlinevirtual |
[Not supported.] Acknowledge all previously accessed samples
Applicable only when DDS_ReliabilityQosPolicy::acknowledgment_kind = DDS_APPLICATION_EXPLICIT_ACKNOWLEDGMENT_MODE
response_data | <<in>> Response data sent to DDSDataWriter upon acknowledgment |
|
inlinevirtual |
Retrieve the list of publications currently "associated" with this DDSDataReader.
Matching publications are those in the same domain that have a matching DDSTopic, compatible QoS common partition that the DDSDomainParticipant has not indicated should be "ignored" by means of the DDSDomainParticipant::ignore_publication operation.
The handles returned in the publication_handles'
list are the ones that are used by the DDS implementation to locally identify the corresponding matched DDSDataWriter entities. These handles match the ones that appear in the instance_handle
field of the DDS_SampleInfo when reading the DDS_PUBLICATION_TOPIC_NAME builtin topic
publication_handles | <<inout>>. The sequence will be grown if the sequence has ownership and the system has the corresponding resources. Use a sequence without ownership to avoid dynamic memory allocation. If the sequence is too small to store all the matches and the system can not resize the sequence, this method will fail with DDS_RETCODE_OUT_OF_RESOURCES. |
The maximum number of matches possible is configured with DDS_DomainParticipantResourceLimitsQosPolicy. You can use a zero-maximum sequence without ownership to quickly check whether there are any matches without allocating any memory. .
|
inlinevirtual |
This operation retrieves the information on a publication that is currently "associated" with the DDSDataReader.
Publication with a matching DDSTopic, compatible QoS and common partition that the application has not indicated should be "ignored" by means of the DDSDomainParticipant::ignore_publication operation.
The publication_handle
must correspond to a publication currently associated with the DDSDataReader. Otherwise, the operation will fail with DDS_RETCODE_BAD_PARAMETER. Use the operation DDSDataReader::get_matched_publications to find the publications that are currently matched with the DDSDataReader.
Note: This operation does not retrieve the following information in DDS_PublicationBuiltinTopicData:
The above information is available through DDSDataReaderListener::on_data_available() (if a reader listener is installed on the DDSPublicationBuiltinTopicDataDataReader).
publication_data | <<inout>>. The information to be filled in on the associated publication. Cannot be NULL. |
publication_handle | <<in>>. Handle to a specific publication associated with the DDSDataWriter. . Must correspond to a publication currently associated with the DDSDataReader. |
|
inlinevirtual |
This operation retrieves the information on the discovered DDSDomainParticipant associated with the publication that is currently matching with the DDSDataReader.
Participant with a matching DDSTopic, compatible QoS and common partition that the application has not indicated should be "ignored" by means of the DDSDomainParticipant::ignore_publication operation.
The publication_handle
must correspond to a publication currently associated with the DDSDataReader. Otherwise, the operation will fail with DDS_RETCODE_BAD_PARAMETER. The operation may also fail with DDS_RETCODE_PRECONDITION_NOT_MET if the publication corresponds to the same DDSDomainParticipant that the DataReader belongs to. Use the operation DDSDataReader::get_matched_publications to find the publications that are currently matched with the DDSDataReader.
Note: This operation does not retrieve the DDS_ParticipantBuiltinTopicData::property.
The above information is available through DDSDataReaderListener::on_data_available() (if a reader listener is installed on the DDSPublicationBuiltinTopicDataDataReader).
participant_data | <<inout>>. The information to be filled in on the associated participant. Cannot be NULL. |
publication_handle | <<in>>. Handle to a specific publication associated with the DDSDataWriter. . Must correspond to a publication currently associated with the DDSDataReader. |
|
inlinevirtual |
Returns the DDSTopicDescription associated with the DDSDataReader.
Returns that same DDSTopicDescription that was used to create the DDSDataReader.
|
inlinevirtual |
Returns the DDSSubscriber to which the DDSDataReader belongs.
|
inlinevirtual |
Accesses the DDS_SAMPLE_REJECTED_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_SampleRejectedStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_LIVELINESS_CHANGED_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_LivelinessChangedStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_REQUESTED_DEADLINE_MISSED_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_RequestedDeadlineMissedStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_RequestedIncompatibleQosStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_SAMPLE_LOST_STATUS communication status.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_SampleLostStatus to be filled in. |
|
inlinevirtual |
Accesses the DDS_SUBSCRIPTION_MATCHED_STATUS communication status.
status | <<inout>> DDS_SubscriptionMatchedStatus to be filled in. |
|
inlinevirtual |
<<eXtension>> Get the datareader cache status for this reader.
status | <<inout>> DDS_DataReaderCacheStatus to be filled in. |
|
inlinevirtual |
<<eXtension>> Get the datareader protocol status for this reader.
This also resets the status so that it is no longer considered changed.
status | <<inout>> DDS_DataReaderProtocolStatus to be filled in. |
|
inlinevirtual |
<<eXtension>> Get the datareader protocol status for this reader, per matched publication identified by the publication_handle.
This also resets the status so that it is no longer considered changed.
Note: Status for a remote entity is only kept while the entity is alive. Once a remote entity is no longer alive, its status is deleted.
status | <<inout>>. The information to be filled in on the associated publication. Cannot be NULL. |
publication_handle | <<in>>. Handle to a specific publication associated with the DDSDataWriter. . Must correspond to a publication currently associated with the DDSDataReader. |
|
inlinevirtual |
Sets the reader QoS.
This operation modifies the QoS of the DDSDataReader.
The DDS_DataReaderQos::user_data, DDS_DataReaderQos::deadline, DDS_DataReaderQos::latency_budget, DDS_DataReaderQos::time_based_filter, DDS_DataReaderQos::reader_data_lifecycle can be changed. The other policies are immutable.
qos | <<in>> The DDS_DataReaderQos to be set to. Policies must be consistent. Immutable policies cannot be changed after DDSDataReader is enabled. The special value DDS_DATAREADER_QOS_DEFAULT can be used to indicate that the QoS of the DDSDataReader should be changed to match the current default DDS_DataReaderQos set in the DDSSubscriber. |
|
inlinevirtual |
Gets the reader QoS.
This method may potentially allocate memory depending on the sequences contained in some QoS policies.
qos | <<inout>> The DDS_DataReaderQos to be filled up. |
|
inlinevirtual |
<<eXtension>> Change the QoS of this reader using the input XML QoS profile.
This operation modifies the QoS of the DDSDataReader.
The DDS_DataReaderQos::user_data, DDS_DataReaderQos::deadline, DDS_DataReaderQos::latency_budget, DDS_DataReaderQos::time_based_filter, DDS_DataReaderQos::reader_data_lifecycle can be changed. The other policies are immutable.
library_name | <<in>> Library name containing the XML QoS profile. If library_name is null RTI Connext will use the default library (see DDSSubscriber::set_default_library). |
profile_name | <<in>> XML QoS Profile name. If profile_name is null RTI Connext will use the default profile (see DDSSubscriber::set_default_profile). |
|
inlinevirtual |
Sets the reader listener.
l | <<in>> DDSDataReaderListener to set to |
mask | <<in>> DDS_StatusMask associated with the DDSDataReaderListener. |
|
inlinevirtual |
Get the reader listener.
|
inlinevirtual |
Enables the DDSEntity.
This operation enables the Entity. Entity objects can be created either enabled or disabled. This is controlled by the value of the ENTITY_FACTORY QoS policy on the corresponding factory for the DDSEntity.
By default, ENTITY_FACTORY is set so that it is not necessary to explicitly call DDSEntity::enable on newly created entities.
The DDSEntity::enable operation is idempotent. Calling enable on an already enabled Entity returns OK and has no effect.
If a DDSEntity has not yet been enabled, the following kinds of operations may be invoked on it:
Other operations may explicitly state that they may be called on disabled entities; those that do not will return the error DDS_RETCODE_NOT_ENABLED.
It is legal to delete an DDSEntity that has not been enabled by calling the proper operation on its factory.
Entities created from a factory that is disabled are created disabled, regardless of the setting of the DDS_EntityFactoryQosPolicy.
Calling enable on an Entity whose factory is not enabled will fail and return DDS_RETCODE_PRECONDITION_NOT_MET.
If DDS_EntityFactoryQosPolicy::autoenable_created_entities is TRUE, the enable operation on a factory will automatically enable all entities created from that factory.
Listeners associated with an entity are not called until the entity is enabled.
Conditions associated with a disabled entity are "inactive," that is, they have a trigger_value
== FALSE.
Implements DDSEntity.
|
inlinevirtual |
Allows access to the DDSStatusCondition associated with the DDSEntity.
The returned condition can then be added to a DDSWaitSet so that the application can wait for specific status changes that affect the DDSEntity.
Implements DDSEntity.
|
inlinevirtual |
Retrieves the list of communication statuses in the DDSEntity that are triggered.
That is, the list of statuses whose value has changed since the last time the application read the status using the get_*_status() method.
When the entity is first created or if the entity is not enabled, all communication statuses are in the "untriggered" state so the list returned by the get_status_changes operation will be empty.
The list of statuses returned by the get_status_changes operation refers to the status that are triggered on the Entity itself and does not include statuses that apply to contained entities.
Implements DDSEntity.
|
inlinevirtual |
Allows access to the DDS_InstanceHandle_t associated with the DDSEntity.
This operation returns the DDS_InstanceHandle_t that represents the DDSEntity.
Implements DDSEntity.