RTI Connext Java API
Version 6.0.0
|
Reads (subscribes to) objects of type com.rti.dds.dynamicdata.DynamicData. More...
Public Member Functions | |
void | read (DynamicDataSeq received_data, SampleInfoSeq info_seq, int max_samples, int sample_states, int view_states, int instance_states) |
Access a collection of data samples from the com.rti.dds.subscription.DataReader. | |
![]() | |
ReadCondition | create_readcondition (int sample_states, int view_states, int instance_states) |
Creates a com.rti.dds.subscription.ReadCondition. | |
ReadCondition | create_readcondition_w_params (ReadConditionParams params) |
<<extension>> Creates a com.rti.dds.subscription.ReadCondition with parameters. | |
QueryCondition | create_querycondition (int sample_states, int view_states, int instance_states, String query_expression, StringSeq query_parameters) |
Creates a com.rti.dds.subscription.QueryCondition. | |
QueryCondition | create_querycondition_w_params (QueryConditionParams params) |
<<extension>> Creates a com.rti.dds.subscription.QueryCondition with parameters. | |
void | delete_readcondition (ReadCondition condition) |
Deletes a com.rti.dds.subscription.ReadCondition or com.rti.dds.subscription.QueryCondition attached to the com.rti.dds.subscription.DataReader. | |
void | set_qos (DataReaderQos qos) |
Sets the reader QoS. | |
void | set_qos_with_profile (String library_name, String profile_name) |
<<extension>> Changes the QoS of this reader using the input XML QoS profile. | |
void | get_qos (DataReaderQos qos) |
Gets the reader QoS. | |
void | set_listener (DataReaderListener l, int mask) |
Sets the reader listener. | |
DataReaderListener | get_listener () |
Gets the reader listener. | |
void | call_listenerT (int mask) |
Calls the reader listener. | |
void | get_sample_rejected_status (SampleRejectedStatus status) |
Accesses the com.rti.dds.infrastructure.StatusKind.StatusKind.SAMPLE_REJECTED_STATUS communication status. | |
void | get_liveliness_changed_status (LivelinessChangedStatus status) |
Accesses the com.rti.dds.infrastructure.StatusKind.StatusKind.LIVELINESS_CHANGED_STATUS communication status. | |
void | get_requested_deadline_missed_status (RequestedDeadlineMissedStatus status) |
Accesses the com.rti.dds.infrastructure.StatusKind.StatusKind.REQUESTED_DEADLINE_MISSED_STATUS communication status. | |
void | get_requested_incompatible_qos_status (RequestedIncompatibleQosStatus status) |
Accesses the com.rti.dds.infrastructure.StatusKind.StatusKind.REQUESTED_INCOMPATIBLE_QOS_STATUS communication status. | |
void | get_sample_lost_status (SampleLostStatus status) |
Accesses the com.rti.dds.infrastructure.StatusKind.StatusKind.SAMPLE_LOST_STATUS_STATUS communication status. | |
void | get_subscription_matched_status (SubscriptionMatchedStatus status) |
Accesses the com.rti.dds.infrastructure.StatusKind.StatusKind.SUBSCRIPTION_MATCHED_STATUS communication status. | |
void | get_datareader_cache_status (DataReaderCacheStatus status) |
<<extension>> Gets the datareader cache status for this reader. | |
void | get_datareader_protocol_status (DataReaderProtocolStatus status) |
<<extension>> Gets the datareader protocol status for this reader. | |
void | get_matched_publication_datareader_protocol_status (DataReaderProtocolStatus status, InstanceHandle_t publication_handle) |
<<extension>> Gets the datareader protocol status for this reader, per matched publication identified by the publication_handle. | |
void | get_matched_publications (InstanceHandleSeq publication_handles) |
Retrieves the list of publications currently "associated" with this com.rti.dds.subscription.DataReader. | |
void | get_matched_publication_data (PublicationBuiltinTopicData publication_data, InstanceHandle_t publication_handle) |
Retrieves the information on a publication that is currently "associated" with the com.rti.dds.subscription.DataReader. | |
void | get_matched_publication_participant_data (ParticipantBuiltinTopicData participant_data, InstanceHandle_t publication_handle) |
<<extension>> Retrieves the information on the discovered com.rti.dds.domain.DomainParticipant associated with the publication that is currently matching with the com.rti.dds.subscription.DataReader. | |
TopicDescription | get_topicdescription () |
Returns the com.rti.dds.topic.TopicDescription associated with the com.rti.dds.subscription.DataReader. | |
Subscriber | get_subscriber () |
Returns the com.rti.dds.subscription.Subscriber to which the com.rti.dds.subscription.DataReader belongs. | |
void | delete_contained_entities () |
Deletes all the entities that were created by means of the "create" operations on the com.rti.dds.subscription.DataReader. | |
void | wait_for_historical_data (Duration_t max_wait) |
Waits until all "historical" data is received for com.rti.dds.subscription.DataReader entities that have a non-VOLATILE Durability Qos kind. | |
void | acknowledge_sample (SampleInfo sample_info) |
<<extension>> Acknowledges a single sample explicitly. | |
void | acknowledge_all () |
<<extension>> Acknowledges all previously accessed samples. | |
void | acknowledge_sample (SampleInfo sample_info, AckResponseData_t response_data) |
<<extension>> Acknowledges a single sample explicitly. | |
void | acknowledge_all (AckResponseData_t response_data) |
<<extension>> Acknowledges all previously accessed samples. | |
TopicQuery | create_topic_query (TopicQuerySelection selection) |
Creates a com.rti.dds.subscription.TopicQuery. | |
void | delete_topic_query (TopicQuery query) |
Deletes a com.rti.dds.subscription.TopicQuery. | |
TopicQuery | lookup_topic_query (GUID_t guid) |
Retrieves an existing com.rti.dds.subscription.TopicQuery. | |
void | read_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, int sample_states, int view_states, int instance_states) |
Reads data samples, if any are available. | |
void | take_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, int sample_states, int view_states, int instance_states) |
Takes data samples, if any are available. | |
void | read_w_condition_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, ReadCondition read_condition) |
Reads data samples, if any are available. | |
void | take_w_condition_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, ReadCondition read_condition) |
Takes data samples, if any are available. | |
void | read_next_sample_untyped (Object received_data, SampleInfo sample_info) |
Reads data samples, if any are available. | |
void | take_next_sample_untyped (Object received_data, SampleInfo sample_info) |
Takes data samples, if any are available. | |
void | read_instance_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, int sample_states, int view_states, int instance_states) |
Reads data samples, if any are available. | |
void | take_instance_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, int sample_states, int view_states, int instance_states) |
Takes data samples, if any are available. | |
void | read_instance_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, GUID_t topic_query_guid, int sample_states, int view_states, int instance_states) |
Reads data samples, if any are available. | |
void | take_instance_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, GUID_t topic_query_guid, int sample_states, int view_states, int instance_states) |
Takes data samples, if any are available. | |
void | read_instance_w_condition_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, ReadCondition read_condition) |
Reads data samples, if any are available. | |
void | take_instance_w_condition_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, ReadCondition read_condition) |
Takes data samples, if any are available. | |
void | read_next_instance_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, int sample_states, int view_states, int instance_states) |
Reads data samples, if any are available. | |
void | take_next_instance_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, int sample_states, int view_states, int instance_states) |
Takes data samples, if any are available. | |
void | read_next_instance_w_condition_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, ReadCondition read_condition) |
Reads data samples, if any are available. | |
void | take_next_instance_w_condition_untyped (List received_data, SampleInfoSeq info_seq, int max_samples, InstanceHandle_t a_handle, ReadCondition read_condition) |
Takes data samples, if any are available. | |
void | return_loan_untyped (List received_data, SampleInfoSeq info_seq) |
Returns loaned sample data and meta-data. | |
void | get_key_value_untyped (Object key_holder, InstanceHandle_t handle) |
Fills in the key fields of the given data sample. | |
InstanceHandle_t | lookup_instance_untyped (Object key_value) |
Additional Inherited Members | |
![]() | |
static final TopicQuerySelection | TOPIC_QUERY_SELECTION_USE_READER_CONTENT_FILTER |
Special value for creating a com.rti.dds.subscription.TopicQuery that applies the same filter as the DataReader's com.rti.dds.topic.ContentFilteredTopic. | |
static final TopicQuerySelection | TOPIC_QUERY_SELECTION_SELECT_ALL |
Special value for creating a com.rti.dds.subscription.TopicQuery that selects all the samples in a com.rti.dds.publication.DataWriter cache. | |
Reads (subscribes to) objects of type com.rti.dds.dynamicdata.DynamicData.
Instantiates com.rti.dds.subscription.DataReader
< com.rti.dds.dynamicdata.DynamicData > .
void read | ( | DynamicDataSeq | received_data, |
SampleInfoSeq | info_seq, | ||
int | max_samples, | ||
int | sample_states, | ||
int | view_states, | ||
int | instance_states | ||
) |
Access a collection of data samples from the com.rti.dds.subscription.DataReader.
This operation offers the same functionality and API as com.rti.ndds.example.FooDataReader.take except that the samples returned remain in the com.rti.dds.subscription.DataReader such that they can be retrieved again by means of a read or take operation.
Please refer to the documentation of com.rti.ndds.example.FooDataReader.take() for details on the number of samples returned within the received_data and info_seq as well as the order in which the samples appear in these sequences.
The act of reading a sample changes its sample_state
to com.rti.dds.subscription.SampleStateKind.SampleStateKind.READ_SAMPLE_STATE. If the sample belongs to the most recent generation of the instance, it will also set the view_state
of the instance to be com.rti.dds.subscription.ViewStateKind.ViewStateKind.NOT_NEW_VIEW_STATE. It will not affect the instance_state
of the instance.
Once the application completes its use of the samples, it must 'return the loan' to the com.rti.dds.subscription.DataReader by calling the com.rti.ndds.example.FooDataReader.return_loan operation.
Important: When you loan data from the middleware, you must not keep any pointers to any part of the data samples or the com.rti.dds.subscription.SampleInfo objects after the call to com.rti.ndds.example.FooDataReader.return_loan. Returning the loan places the objects back into a pool, allowing the middleware to overwrite them with new data.
Note: While you must call com.rti.ndds.example.FooDataReader.return_loan at some point, you do not have to do so before the next com.rti.ndds.example.FooDataReader.take call. However, failure to return the loan will eventually deplete the com.rti.dds.subscription.DataReader of the buffers it needs to receive new samples and eventually samples will start to be lost. The total number of buffers available to the com.rti.dds.subscription.DataReader is specified by the com.rti.dds.infrastructure.ResourceLimitsQosPolicy and the com.rti.dds.infrastructure.DataReaderResourceLimitsQosPolicy.
Important: If the samples "returned" by this method are loaned from RTI Connext (see com.rti.ndds.example.FooDataReader.take for more information on memory loaning), it is important that their contents not be changed. Because the memory in which the data is stored belongs to the middleware, any modifications made to the data will be seen the next time the same samples are read or taken; the samples will no longer reflect the state that was received from the network.
received_data | <<inout>> User data type-specific com.rti.dds.infrastructure.com.rti.dds.util.Sequence object where the received data samples will be returned. Must be a valid non-NULL FooSeq. The method will fail with com.rti.dds.infrastructure.RETCODE_BAD_PARAMETER if it is NULL. |
info_seq | <<inout>> A com.rti.dds.subscription.SampleInfoSeq object where the received sample info will be returned. Must be a valid non-NULL com.rti.dds.subscription.SampleInfoSeq. The method will fail with com.rti.dds.infrastructure.RETCODE_BAD_PARAMETER if it is NULL. |
max_samples | <<in>> The maximum number of samples to be returned. If the special value com.rti.dds.infrastructure.ResourceLimitsQosPolicy.LENGTH_UNLIMITED is provided, as many samples will be returned as are available, up to the limits described in the documentation for com.rti.ndds.example.FooDataReader.take(). |
sample_states | <<in>> Data samples matching one of these sample_states are returned. See the valid values for this parameter here: com.rti.dds.subscription.SampleStateKind. |
view_states | <<in>> Data samples matching one of these view_state are returned. See the valid values for this parameter here: com.rti.dds.subscription.ViewStateKind. |
instance_states | <<in>> Data samples matching ones of these instance_state are returned. See the valid values for this parameter here: com.rti.dds.subscription.InstanceStateKind. |