DDS-PSM-C++ 1.0 ISO C++ API for OpenSplice DDS |
#include <TDataReader.hpp>
Classes | |
class | ManipulatorSelector |
class | Selector |
Public Types | |
typedef T | DataType |
typedef ::dds::sub::DataReaderListener < T > | Listener |
Additional Inherited Members | |
![]() | |
DELEGATE_REF_T | impl_ |
Definition at line 40 of file TDataReader.hpp.
typedef T dds::sub::DataReader< T, DELEGATE >::DataType |
Definition at line 43 of file TDataReader.hpp.
typedef ::dds::sub::DataReaderListener<T> dds::sub::DataReader< T, DELEGATE >::Listener |
Definition at line 44 of file TDataReader.hpp.
dds::sub::DataReader< T, DELEGATE >::DataReader | ( | const dds::sub::Subscriber & | sub, |
const ::dds::topic::Topic< T > & | topic | ||
) |
Create a DataReader
. The QoS will be the same as "sub.default_datareader_qos()".
sub | the subscriber owning this DataReader . |
topic | the topic associated with this DataReader . |
dds::sub::DataReader< T, DELEGATE >::DataReader | ( | const dds::sub::Subscriber & | sub, |
const ::dds::topic::Topic< T > & | topic, | ||
const dds::sub::qos::DataReaderQos & | qos, | ||
dds::sub::DataReaderListener< T > * | listener = NULL , | ||
const dds::core::status::StatusMask & | mask = ::dds::core::status::StatusMask::all() | ||
) |
Create a DataReader
.
sub | the subscriber owning this DataReader . |
topic | the topic associated with this DataReader . |
qos | the QoS settings for this DataReader . |
listener | the listener. |
mask | the event mask associated to the DataReader listener. |
dds::sub::DataReader< T, DELEGATE >::~DataReader | ( | ) |
const dds::sub::status::DataState& dds::sub::DataReader< T, DELEGATE >::default_filter_state | ( | ) |
Returns the default read-state (if not changed, it is set to ReaderState::any()).
DataReader& dds::sub::DataReader< T, DELEGATE >::default_filter_state | ( | const dds::sub::status::DataState & | state | ) |
Set the default state filter for read/take operations.
state | the state mask that will be used to read/take samples. |
dds::topic::TopicInstance<T> dds::sub::DataReader< T, DELEGATE >::key_value | ( | const dds::core::InstanceHandle & | h | ) |
This operation can be used to retrieve the instance key that corresponds to an instance_handle. The operation will only fill the fields that form the key inside the key_holder instance. This operation may raise a BadParameter exception if the InstanceHandle does not correspond to an existing data-object known to the DataWriter. If the implementation is not able to check invalid handles, then the result in this situation is unspecified.
T& dds::sub::DataReader< T, DELEGATE >::key_value | ( | T & | sample, |
const dds::core::InstanceHandle & | h | ||
) |
This operation can be used to retrieve the instance key that corresponds to an instance_handle. The operation will only fill the fields that form the key inside the key_holder instance. This operation may raise a BadParameter exception if the InstanceHandle does not correspond to an existing data-object known to the DataWriter. If the implementation is not able to check invalid handles, then the result in this situation is unspecified.
void dds::sub::DataReader< T, DELEGATE >::listener | ( | Listener * | the_listener, |
const dds::core::status::StatusMask & | event_mask | ||
) |
Set/Re-set the listener associated with this reader.
the_listener | the listener. |
event_mask | the event mask associated with the listener. |
Listener* dds::sub::DataReader< T, DELEGATE >::listener | ( | ) | const |
Get the listener associated with this reader.
const dds::core::status::LivelinessChangedStatus& dds::sub::DataReader< T, DELEGATE >::liveliness_changed_status | ( | ) | const |
const dds::core::InstanceHandle dds::sub::DataReader< T, DELEGATE >::lookup_instance | ( | const T & | key | ) | const |
This operation takes as a parameter an instance and returns a handle that can be used in subsequent operations that accept an instance handle as an argument. The instance parameter is only used for the purpose of examining the fields that define the key. This operation does not register the instance in question. If the instance has not been previously registered, or if for any other reason the Service is unable to provide an instance handle, the Service will return a TopicInstance whose handle will be set to the HANDLE_NIL value.
DataReader& dds::sub::DataReader< T, DELEGATE >::operator<< | ( | const dds::sub::qos::DataReaderQos & | the_qos | ) |
Get the QoS associated with this reader.
DataReader& dds::sub::DataReader< T, DELEGATE >::operator>> | ( | dds::sub::LoanedSamples< T > & | ls | ) |
Manipulators are defined externally to make it possible to control whether the streaming operators reads or takes. dr >> read >> loanedSamples; dr >> take >> loanedSamples;
ManipulatorSelector dds::sub::DataReader< T, DELEGATE >::operator>> | ( | ManipulatorSelector & | manipulator)(ManipulatorSelector & | ) |
ManipulatorSelector dds::sub::DataReader< T, DELEGATE >::operator>> | ( | Functor | f | ) |
DataReader& dds::sub::DataReader< T, DELEGATE >::operator>> | ( | dds::sub::qos::DataReaderQos & | the_qos | ) |
Set the QoS associated with this reader.
the_qos | the new QoS. |
const dds::sub::qos::DataReaderQos& dds::sub::DataReader< T, DELEGATE >::qos | ( | ) | const |
Get the QoS associated with this reader.
void dds::sub::DataReader< T, DELEGATE >::qos | ( | const dds::sub::qos::DataReaderQos & | the_qos | ) |
Set the QoS associated with this reader.
the_qos | the new QoS. |
LoanedSamples<T> dds::sub::DataReader< T, DELEGATE >::read | ( | ) |
Read all samples using the default filter state. The memory used for storing the sample may be loaned by the middleware thus allowing zero copy operations. Implementation should strike to makethis read implementation exception safe.
uint32_t dds::sub::DataReader< T, DELEGATE >::read | ( | SamplesFWIterator | sfit, |
uint32_t | max_samples | ||
) |
Read up to max_samples
samples using the default filter state. The samples are copied into the application provided container using the forward iterator parameter.
sfit | samples forward iterator |
max_samples | the maximum number of samples to read |
uint32_t dds::sub::DataReader< T, DELEGATE >::read | ( | SamplesBIIterator | sbit | ) |
Read all samples available in the reader cache using the default filter state. The samples are copied into the application provided container using a back-inserting iterator. Notice that as a consequence of using a back-inserting iterator, this operation may allocate memory to resize the underlying container.
sbit | samples back-inserting iterator. |
const dds::core::status::RequestedDeadlineMissedStatus& dds::sub::DataReader< T, DELEGATE >::requested_deadline_missed_status | ( | ) |
const dds::core::status::RequestedIncompatibleQosStatus& dds::sub::DataReader< T, DELEGATE >::requested_incompatible_qos_status | ( | ) | const |
const dds::core::status::SampleLostStatus& dds::sub::DataReader< T, DELEGATE >::sample_lost_status | ( | ) | const |
const dds::core::status::SampleRejectedStatus& dds::sub::DataReader< T, DELEGATE >::sample_rejected_status | ( | ) | const |
Selector dds::sub::DataReader< T, DELEGATE >::select | ( | ) |
Get a Selector
to perform complex data selections, such as per-instance selection, content and status filtering.
The selector can be used as follows:
dr.select() .instance(handle) .content(query) .state(state) .take(sbit);
This shows how samples can be taken by selecting a specific instance, then filtering by state and content.
const dds::sub::Subscriber& dds::sub::DataReader< T, DELEGATE >::subscriber | ( | ) | const |
Get the subscriber owning this reader.
const dds::core::status::SubscriptionMatchedStatus& dds::sub::DataReader< T, DELEGATE >::subscription_matched_status | ( | ) | const |
LoanedSamples<T> dds::sub::DataReader< T, DELEGATE >::take | ( | ) |
Take all samples using the default filter state. The memory used for storing the sample may be loaned by the middleware thus allowing zero copy operations. Implementation should strike to make this read implementation exception safe.
uint32_t dds::sub::DataReader< T, DELEGATE >::take | ( | SamplesFWIterator | sfit, |
uint32_t | max_samples | ||
) |
Take up to max_samples
samples using the default filter state. The samples are copied into the application provided container using the forward iterator parameter.
sfit | samples forward iterator. |
max_samples | the maximum number of samples to take. |
uint32_t dds::sub::DataReader< T, DELEGATE >::take | ( | SamplesBIIterator | sbit | ) |
Take all samples available in the reader cache samples using the default filter state. The samples are copied into the application provided container using a back-inserting iterator. Notice that as a consequence of using a back-inserting iterator, this operation may allocate memory to resize the underlying container.
sbit | samples back-inserting iterator. |
dds::topic::TopicDescription<DataType> dds::sub::DataReader< T, DELEGATE >::topic_description | ( | ) | const |
Get the TopicDescription
associated with this reader.
void dds::sub::DataReader< T, DELEGATE >::wait_for_historical_data | ( | const dds::core::Duration & | timeout | ) |
Wait for historical data for a given amount of time. This time may be set to infinite.
timeout | the time to wait for historical data. |