RTI Connext DDS Micro C++ API  Version 3.0.3
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
DDSDataReaderListener Class Reference

<<interface>> <<cert>> DDSListener for reader status. More...

#include <dds_cpp_subscription.hxx>

Inheritance diagram for DDSDataReaderListener:
DDSListener DDSSubscriberListener

List of all members.

Public Member Functions

virtual void on_data_available (DDSDataReader *)
 <<cert>> Handle the DDS_DATA_AVAILABLE_STATUS communication status.
virtual void on_requested_deadline_missed (DDSDataReader *, const DDS_RequestedDeadlineMissedStatus &)
 <<cert>> Handles the DDS_REQUESTED_DEADLINE_MISSED_STATUS communication status.
virtual void on_liveliness_changed (DDSDataReader *, const DDS_LivelinessChangedStatus &)
 <<cert>> Handles the DDS_LIVELINESS_CHANGED_STATUS communication status.
virtual void on_requested_incompatible_qos (DDSDataReader *, const DDS_RequestedIncompatibleQosStatus &)
 <<cert>> Handles the DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS communication status.
virtual void on_sample_rejected (DDSDataReader *, const DDS_SampleRejectedStatus &)
 <<cert>> Handles the DDS_SAMPLE_REJECTED_STATUS communication status.
virtual void on_subscription_matched (DDSDataReader *, const DDS_SubscriptionMatchedStatus &)
 <<cert>> Handles the DDS_SUBSCRIPTION_MATCHED_STATUS communication status.
virtual void on_sample_lost (DDSDataReader *, const DDS_SampleLostStatus &)
 <<cert>> Handles the DDS_SAMPLE_LOST_STATUS communication status.
virtual void on_instance_replaced (DDSDataReader *, const DDS_DataReaderInstanceReplacedStatus &)
 <<cert>> Handles the DDS_INSTANCE_REPLACED_STATUS communication status.
virtual DDS_Boolean on_before_sample_deserialize (DDSDataReader *, NDDS_Type_Plugin *, CDR_Stream_t *, DDS_Boolean *)
 <<cert>> Callback to filter a received sample based on serialized data
virtual DDS_Boolean on_before_sample_commit (DDSDataReader *, const void *const, const struct DDS_SampleInfo *const, DDS_Boolean *)
 <<cert>> Callback to filter a received sample based on deserialized data

Detailed Description


Member Function Documentation

virtual void DDSDataReaderListener::on_data_available ( DDSDataReader )
inlinevirtual

<<cert>> Handle the DDS_DATA_AVAILABLE_STATUS communication status.

virtual void DDSDataReaderListener::on_requested_deadline_missed ( DDSDataReader ,
const DDS_RequestedDeadlineMissedStatus  
)
inlinevirtual

<<cert>> Handles the DDS_REQUESTED_DEADLINE_MISSED_STATUS communication status.

virtual void DDSDataReaderListener::on_liveliness_changed ( DDSDataReader ,
const DDS_LivelinessChangedStatus  
)
inlinevirtual

<<cert>> Handles the DDS_LIVELINESS_CHANGED_STATUS communication status.

virtual void DDSDataReaderListener::on_requested_incompatible_qos ( DDSDataReader ,
const DDS_RequestedIncompatibleQosStatus  
)
inlinevirtual

<<cert>> Handles the DDS_REQUESTED_INCOMPATIBLE_QOS_STATUS communication status.

virtual void DDSDataReaderListener::on_sample_rejected ( DDSDataReader ,
const DDS_SampleRejectedStatus  
)
inlinevirtual

<<cert>> Handles the DDS_SAMPLE_REJECTED_STATUS communication status.

virtual void DDSDataReaderListener::on_subscription_matched ( DDSDataReader ,
const DDS_SubscriptionMatchedStatus  
)
inlinevirtual

<<cert>> Handles the DDS_SUBSCRIPTION_MATCHED_STATUS communication status.

virtual void DDSDataReaderListener::on_sample_lost ( DDSDataReader ,
const DDS_SampleLostStatus  
)
inlinevirtual

<<cert>> Handles the DDS_SAMPLE_LOST_STATUS communication status.

virtual void DDSDataReaderListener::on_instance_replaced ( DDSDataReader ,
const DDS_DataReaderInstanceReplacedStatus  
)
inlinevirtual

<<cert>> Handles the DDS_INSTANCE_REPLACED_STATUS communication status.

This listener may only be called when the instance replacement policy is set to DDS_REPLACE_OLDEST_INSTANCE_REPLACEMENT_QOS. When a new instance is detected and resources are exhausted the oldest instance will be removed even if samples with a not read state exists for the instance. Thus, this is a forceful removal of samples and the instance. The freed instance resources will be re-used for the newly detected instance. If there are outstanding loans for the replaced instance the samples can not be freed until returned. However, when the loan is returned the samples are automatically freed. Note that the instance will not be rejected.

virtual DDS_Boolean DDSDataReaderListener::on_before_sample_deserialize ( DDSDataReader ,
NDDS_Type_Plugin *  ,
CDR_Stream_t *  ,
DDS_Boolean  
)
inlinevirtual

<<cert>> Callback to filter a received sample based on serialized data

When a DataReader receives a (serialized) sample, it will deserialize it before storing it in its queue. On_before_sample_deserialize() is called before deserialization. It allows the application to determine whether or not to drop the sample, before it is read or taken.

The callback controls whether the sample is filter out of the DataReader's queue, with the sample_dropped parameter. If user code within the callback determines that the sample should be dropped, the user should set sample_dropped to true; consequently, when the callback returns, the DataReader will drop the sample before it is committed to the queue. Otherwise, returning the callback with sample_dropped as false will allow the sample to be read or taken.

Compared to on_before_sample_commit(), the sample would be dropped with less processing (without deserialization) by the subscribing application, but with the added complexity of filtering on serialized data.

The callback is not associated with a DDS Status. It is enabled when the callback in the listener is assigned, to a non-NULL callback.

virtual DDS_Boolean DDSDataReaderListener::on_before_sample_commit ( DDSDataReader ,
const void *  const,
const struct DDS_SampleInfo const,
DDS_Boolean  
)
inlinevirtual

<<cert>> Callback to filter a received sample based on deserialized data

When a DataReader receives a (serialized) sample, it will deserialize it before storing it in its queue. On_before_sample_commit() is called after deserialization, but before the sample is stored into the DataReader's queue. It allows the application to determine whether or not to drop the sample, before it is read or taken.

The callback controls whether the sample is filter out of the DataReader's queue, with the sample_dropped parameter. If user code within the callback determines that the sample should be dropped, the user should set sample_dropped to true; consequently, when the callback returns, the DataReader will drop the sample before it is committed to the queue. Otherwise, returning the callback with sample_dropped as false will allow the sample to be read or taken.

Compared to on_before_sample_deserialize(), the sample would be dropped with more processing (with deserialization) by the subscribing application, but with the lesser complexity of filtering on deserialized data.

The callback is not associated with a DDS Status. It is enabled when the callback in the listener is assigned, to a non-NULL callback.

The following fields are valid in the DDS_SampleInfo structure:

  • source_timestamp
  • instance_handle
  • publication_handle
  • valid_data
  • encapsulation_id

RTI Connext DDS Micro C++ API Version 3.0.3 Copyright © Wed Jun 24 2020 Real-Time Innovations, Inc