RTI Connext Modern C++ API
Version 7.0.0
|
<<reference-type>> 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 dds::sub::Subscriber. More...
#include "dds/sub/DataReader.hpp"
Classes | |
class | ManipulatorSelector |
A Selector class enabling the streaming API. More... | |
class | Selector |
The Selector class is used by the DataReader to compose read and take operations. More... | |
Public Member Functions | |
DataReader (const dds::sub::Subscriber &sub, const dds::topic::Topic< T > &topic) | |
Create a DataReader. More... | |
DataReader (const dds::sub::Subscriber &sub, const dds::topic::Topic< T > &topic, const dds::sub::qos::DataReaderQos &the_qos, dds::sub::DataReaderListener< T > *the_listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a DataReader. More... | |
DataReader (const dds::sub::Subscriber &sub, const dds::topic::Topic< T > &topic, const dds::sub::qos::DataReaderQos &the_qos, std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a DataReader. More... | |
DataReader (const dds::sub::Subscriber &sub, const dds::topic::ContentFilteredTopic< T > &topic) | |
Create a DataReader for a dds::topic::ContentFilteredTopic. More... | |
DataReader (const dds::sub::Subscriber &sub, const dds::topic::ContentFilteredTopic< T > &topic, const dds::sub::qos::DataReaderQos &the_qos, dds::sub::DataReaderListener< T > *the_listener=NULL, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a DataReader for a dds::topic::ContentFilteredTopic. More... | |
DataReader (const dds::sub::Subscriber &sub, const dds::topic::ContentFilteredTopic< T > &topic, const dds::sub::qos::DataReaderQos &the_qos, std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &mask=dds::core::status::StatusMask::all()) | |
Create a DataReader for a dds::topic::ContentFilteredTopic with a listener. More... | |
const dds::sub::status::DataState & | default_filter_state () |
Returns the default state for read/take operations. More... | |
DataReader & | default_filter_state (const dds::sub::status::DataState &state) |
Set the default state filter for read/take operations. More... | |
DataReader & | operator>> (dds::sub::LoanedSamples< T > &ls) |
Use the stream operator to take samples, placing them into a LoanedSamples container. More... | |
ManipulatorSelector | operator>> (bool(*manipulator)(ReadModeDummyType)) |
Use the stream operator to read or take samples. More... | |
template<typename Functor > | |
ManipulatorSelector | operator>> (Functor f) |
Use the stream operator to dictate the behavior of the read or take operation. More... | |
LoanedSamples< T > | read () |
Read all samples using the default filter state. More... | |
LoanedSamples< T > | take () |
Take all samples using the default filter state. More... | |
template<typename SamplesFWIterator > | |
uint32_t | read (SamplesFWIterator sfit, int32_t max_samples) |
Read up to max_samples samples using the default filter state. More... | |
template<typename SamplesFWIterator > | |
uint32_t | take (SamplesFWIterator sfit, int32_t max_samples) |
Take up to max_samples samples using the default filter state. More... | |
template<typename SamplesBIIterator > | |
uint32_t | read (SamplesBIIterator sbit) |
Read all samples available in the reader cache using the default filter state. More... | |
template<typename SamplesBIIterator > | |
uint32_t | take (SamplesBIIterator sbit) |
Take all samples available in the reader cache samples using the default filter state. More... | |
Selector | select () |
Get a Selector to perform complex data selections, such as per-instance selection, content and status filtering. More... | |
T & | key_value (T &key_holder, const dds::core::InstanceHandle &handle) |
Retrieve the instance key that corresponds to an instance handle. More... | |
dds::topic::TopicInstance< T > & | key_value (dds::topic::TopicInstance< T > &key_holder, const dds::core::InstanceHandle &handle) |
Retrieve the instance key that corresponds to an instance handle. More... | |
dds::core::InstanceHandle | lookup_instance (const T &key_holder) const |
Retrieve the InstanceHandle that corresponds to an instance key holder. More... | |
dds::topic::TopicDescription< DataType > | topic_description () const |
Returns the dds::topic::TopicDescription associated with the DataReader. More... | |
const dds::sub::Subscriber & | subscriber () const |
Returns the Subscriber to which the DataReader belongs. More... | |
void | listener (Listener *the_listener, const dds::core::status::StatusMask &event_mask) |
Sets the listener associated with this reader. More... | |
Listener * | listener () const |
Returns the listener currently associated with this DataReader. More... | |
void | set_listener (std::shared_ptr< Listener > the_listener, const dds::core::status::StatusMask &event_mask) |
Sets the listener associated with this reader. More... | |
void | set_listener (std::shared_ptr< Listener > the_listener) |
Sets the listener associated with this reader. More... | |
std::shared_ptr< Listener > | get_listener () const |
Returns the listener currently associated with this DataReader. More... | |
const dds::sub::qos::DataReaderQos | qos () const |
Get the QoS associated with this reader. More... | |
void | qos (const dds::sub::qos::DataReaderQos &the_qos) |
Set the QoS associated with this reader. More... | |
DataReader & | operator<< (const dds::sub::qos::DataReaderQos &the_qos) |
Set the QoS associated with this reader. More... | |
DataReader & | operator>> (dds::sub::qos::DataReaderQos &the_qos) |
Get the QoS associated with this reader. More... | |
void | wait_for_historical_data (const dds::core::Duration &max_wait) |
Waits until all "historical" data is received for DataReaders that have a non-VOLATILE Durability Qos kind. More... | |
dds::core::status::LivelinessChangedStatus | liveliness_changed_status () const |
Get the LivelinessChangedStatus for this DataReader. More... | |
dds::core::status::SampleRejectedStatus | sample_rejected_status () const |
Get the SampleRejectedStatus for this DataReader. More... | |
dds::core::status::SampleLostStatus | sample_lost_status () const |
Get the SampleLostStatus for this DataReader. More... | |
dds::core::status::RequestedDeadlineMissedStatus | requested_deadline_missed_status () |
Get the RequestedDeadlineMissedStatus for this DataReader. More... | |
dds::core::status::RequestedIncompatibleQosStatus | requested_incompatible_qos_status () const |
Get the RequestedIncompatibleQosStatus for this DataReader. More... | |
dds::core::status::SubscriptionMatchedStatus | subscription_matched_status () const |
Get the SubscriptionMatchedStatus for this DataReader. More... | |
rti::core::status::DataReaderCacheStatus | datareader_cache_status () const |
<<extension>> Get the DataReaderCacheStatus for this DataReader More... | |
rti::core::status::DataReaderProtocolStatus | datareader_protocol_status () const |
<<extension>> Get the DataReaderProtocolStatus for this DataReader More... | |
rti::core::status::DataReaderProtocolStatus | matched_publication_datareader_protocol_status (const dds::core::InstanceHandle &publication_handle) |
<<extension>> Get the DataReaderProtocolStatus for this DataReader More... | |
void | acknowledge_all () |
<<extension>> Acknowledge all previously accessed samples More... | |
void | acknowledge_all (const AckResponseData &response_data) |
<<extension>> Acknowledge all previously accessed samples More... | |
void | acknowledge_sample (const dds::sub::SampleInfo &sample_info) |
<<extension>> Acknowledge a single sample explicitly More... | |
void | acknowledge_sample (const dds::sub::SampleInfo &sample_info, const AckResponseData &response_data) |
<<extension>> Acknowledge a single sample explicitly More... | |
void | close_contained_entities () |
<<extension>> Closes all the entities created from this DataReader More... | |
bool | read (T &sample) |
<<extension>> Copies the next not-previously-accessed valid data value from the DataReader via a read operation. More... | |
bool | read (T &sample, dds::sub::SampleInfo &sample_info) |
<<extension>> Copies the next not-previously-accessed data value from the DataReader via a read operation. More... | |
bool | take (T &sample) |
<<extension>> Copies the next not-previously-accessed valid data value from the DataReader via a take operation. More... | |
bool | take (T &sample, dds::sub::SampleInfo &sample_info) |
<<extension>> Copies the next not-previously-accessed data value from the DataReader via a take operation. More... | |
bool | is_data_consistent (const T &sample, const dds::sub::SampleInfo &sample_info) |
<<extension>> Checks if the sample has been overwritten by the DataWriter More... | |
bool | is_data_consistent (const rti::sub::LoanedSample< T > &sample) |
<<extension>> Checks if the sample has been overwritten by the DataWriter More... | |
const std::string & | topic_name () const |
<<extension>> Get the topic name associated with this DataReader More... | |
const std::string & | type_name () const |
<<extension>> Get the type name associated with this DataReader More... | |
void | close () |
Close this DataReader. More... | |
Public Member Functions inherited from dds::core::Entity | |
void | enable () |
Enables this entity (if it was created disabled) More... | |
const dds::core::status::StatusMask | status_changes () |
Retrieves the list of communication statuses that are triggered. More... | |
const dds::core::InstanceHandle | instance_handle () const |
Get the instance handle that represents this entity. More... | |
void | close () |
Forces the destruction of this entity. More... | |
void | retain () |
Disables the automatic destruction of this entity. More... | |
Related Functions | |
(Note that these are not member functions.) | |
bool | read (dds::sub::ReadModeDummyType) |
The stream manipulator to indicate that the reader should read samples as opposed to taking the samples. More... | |
bool | take (dds::sub::ReadModeDummyType) |
The stream manipulator to indicate that the reader should take samples as opposed to reading the samples. More... | |
dds::sub::functors::MaxSamplesManipulatorFunctor | max_samples (uint32_t n) |
Stream manipulator to set the maximum number of samples to read or take. More... | |
dds::sub::functors::ContentFilterManipulatorFunctor | content (const dds::sub::Query &query) |
Stream manipulator to set a Query to use during the subsequent read/take operation. More... | |
dds::sub::functors::ConditionManipulatorFunctor | condition (const dds::sub::cond::ReadCondition &condition) |
Stream manipulator to set a QueryCondition to use during the subsequent read/take operation. More... | |
dds::sub::functors::StateFilterManipulatorFunctor | state (const dds::sub::status::DataState &s) |
Stream manipulator to specify the DataState of the samples that should be read/taken. More... | |
dds::sub::functors::InstanceManipulatorFunctor | instance (const dds::core::InstanceHandle &h) |
Stream manipulator to specify the instance whose samples should be read or taken. More... | |
dds::sub::functors::NextInstanceManipulatorFunctor | next_instance (const dds::core::InstanceHandle &h) |
Stream manipulator to specify the samples belonging to the 'next' instance after the provided instance handle should be accessed. More... | |
void | ignore (dds::domain::DomainParticipant &participant, const dds::core::InstanceHandle &handle) |
Instructs RTI Connext to locally ignore a subscription. More... | |
template<typename FwdIterator > | |
void | ignore (dds::domain::DomainParticipant &participant, FwdIterator begin, FwdIterator end) |
Instructs RTI Connext to locally ignore subscriptions. More... | |
template<typename T > | |
const ::dds::core::InstanceHandleSeq | matched_publications (const dds::sub::DataReader< T > &reader) |
Retrieve the list of publications currently "associated" with a DataReader. More... | |
template<typename T , typename FwdIterator > | |
FwdIterator | matched_publications (const dds::sub::DataReader< T > &reader, FwdIterator begin, FwdIterator end) |
Retrieve the list of publications currently "associated" with a DataReader. More... | |
template<typename T > | |
const dds::topic::PublicationBuiltinTopicData | matched_publication_data (const dds::sub::DataReader< T > &reader, const dds::core::InstanceHandle &handle) |
This operation retrieves the information on a publication that is currently "associated" with the DataReader. More... | |
template<typename T > | |
dds::topic::ParticipantBuiltinTopicData | matched_publication_participant_data (const dds::sub::DataReader< T > &reader, const dds::core::InstanceHandle &handle) |
<<extension>> This operation retrieves the information on the discovered dds::domain::DomainParticipant associated with the publication that is currently matching with the dds::sub::DataReader. More... | |
template<typename T > | |
bool | is_matched_publication_alive (const dds::sub::DataReader< T > &reader, const dds::core::InstanceHandle &handle) |
<<extension>> Check if a matched publication is alive. More... | |
template<typename T > | |
std::vector< dds::topic::PublicationBuiltinTopicData > | matched_publication_data (const dds::sub::DataReader< T > &reader) |
<<extension>> Obtain the PublicationBuiltinTopicData for all of the publications matched with a DataReader. More... | |
template<typename Reader , typename FwdIterator > | |
uint32_t | find (const dds::sub::Subscriber &subscriber, const std::string &topic_name, FwdIterator begin, uint32_t max_size) |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching topic name. More... | |
template<typename Reader , typename BinIterator > | |
uint32_t | find (const dds::sub::Subscriber &subscriber, const std::string &topic_name, BinIterator begin) |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching topic name. More... | |
template<typename READER , typename T , typename FwdIterator > | |
uint32_t | find (const dds::sub::Subscriber &subscriber, const dds::topic::TopicDescription< T > &topic_description, FwdIterator begin, uint32_t max_size) |
template<typename READER , typename T , typename BinIterator > | |
uint32_t | find (const dds::sub::Subscriber &subscriber, const dds::topic::TopicDescription< T > &topic_description, BinIterator begin) |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching TopicDescription. More... | |
template<typename AnyDataReaderBackInsertIterator > | |
uint32_t | find_datareaders (dds::sub::Subscriber subscriber, AnyDataReaderBackInsertIterator begin) |
<<extension>> Retrieve all the dds::sub::DataReader created from this dds::sub::Subscriber More... | |
template<typename AnyDataReaderForwardIterator > | |
uint32_t | find_datareaders (dds::sub::Subscriber subscriber, AnyDataReaderForwardIterator begin, uint32_t max_size) |
<<extension>> Retrieve all the readers created from a subscriber. More... | |
template<typename Reader > | |
Reader | find_datareader_by_topic_name (dds::sub::Subscriber subscriber, const std::string &topic_name) |
<<extension>> Retrieves a dds::sub::DataReader with the given topic name within the dds::sub::Subscriber More... | |
template<typename Reader > | |
Reader | find_datareader_by_name (dds::sub::Subscriber subscriber, const std::string &datareader_name) |
<<extension>> Retrieves a dds::sub::DataReader with the given name within the dds::sub::Subscriber More... | |
template<typename Reader , typename T > | |
Reader | find_datareader_by_topic_description (const dds::sub::Subscriber &subscriber, const dds::topic::TopicDescription< T > &topic_description) |
<<extension>> Retrieves a dds::sub::DataReader with the given TopicDescription within the dds::sub::Subscriber More... | |
template<typename Reader > | |
Reader | find_datareader_by_name (dds::domain::DomainParticipant participant, const std::string &datareader_name) |
<<extension>> Retrieves a dds::sub::DataReader within the dds::domain::DomainParticipant with the given name More... | |
Related Functions inherited from dds::core::Entity | |
template<typename TO , typename FROM > | |
TO | polymorphic_cast (const FROM &from) |
Downcasts an Entity to a subclass. More... | |
<<reference-type>> 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 dds::sub::Subscriber.
T | The topic-type that the DataReader subscribes to |
A dds::sub::DataReader refers to exactly one TopicDescription (either a dds::topic::Topic, a dds::topic::ContentFilteredTopic or a MultiTopic) 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
.
The following operations may be called even if the dds::sub::DataReader is not enabled. Other operations will fail with the value dds::core::NotEnabledError if called on a disabled dds::sub::DataReader:
All sample-accessing operations may fail with the expection dds::core::PreconditionNotMetError as described in dds::sub::CoherentAccess::CoherentAccess().
|
inline |
Create a DataReader.
It uses the default DataReaderQos, and no listener.
sub | the Subscriber owning this DataReader. |
topic | the Topic associated with this DataReader. |
|
inline |
Create a DataReader.
[DEPRECATED] When using a listener, prefer the constructor that receives a shared_ptr<Listener>
instead of a regular Listener*
pointer.
When a DataReader is created, only those transports already registered are available to the DataReader. See Built-in Transport Plugins for details on when a builtin transport is registered.
sub | the Subscriber owning this DataReader. |
topic | the Topic associated with this DataReader. |
the_qos | the QoS settings for this DataReader. |
the_listener | the listener. |
mask | the event mask associated to the DataReader listener. |
|
inline |
Create a DataReader.
When a DataReader is created, only those transports already registered are available to the DataReader. See Built-in Transport Plugins for details on when a builtin transport is registered.
sub | the Subscriber owning this DataReader. |
topic | the Topic associated with this DataReader. |
the_qos | the QoS settings for this DataReader. |
the_listener | A shared_ptr to the listener. See set_listener() for more information. |
mask | Indicates which status updates the listener will receive |
|
inline |
Create a DataReader for a dds::topic::ContentFilteredTopic.
This DataReader will only receive that data that matches the Filter associated with the ContentFilteredTopic. The QoS will be set to sub.default_datareader_qos().
sub | the Subscriber owning this DataReader. |
topic | the content filtered topic |
|
inline |
Create a DataReader for a dds::topic::ContentFilteredTopic.
[DEPRECATED] When using a listener, prefer the constructor that receives a shared_ptr<Listener>
instead of a regular Listener*
pointer.
This DataReader will only receive that data that mathes the Filter associated with the ContentFilteredTopic.
sub | the subscriber owning this DataReader. |
topic | the content filtered topic. |
the_qos | the QoS settings for this DataReader. |
the_listener | the listener. |
mask | the event mask associated to the DataReader listener. |
|
inline |
Create a DataReader for a dds::topic::ContentFilteredTopic with a listener.
This DataReader will only receive that data that mathes the Filter associated with the ContentFilteredTopic.
sub | the subscriber owning this DataReader. |
topic | the content filtered topic. |
the_qos | the QoS settings for this DataReader. |
the_listener | the listener. |
mask | the event mask associated to the DataReader listener. |
|
inline |
Returns the default state for read/take operations.
If left as default, it is set to dds::sub::status::DataState::any().
|
inline |
Set the default state filter for read/take operations.
state | the state mask that will be used to read/take samples. |
|
inline |
Use the stream operator to take samples, placing them into a LoanedSamples container.
For example:
If you want to read samples, instead of take, you must use the stream manipulator read(dds::sub::ReadModeDummyType) and operator>>(bool(*manipulator)(ReadModeDummyType))
For example:
ls | The LoanedSamples container to put the taken samples into |
|
inline |
Use the stream operator to read or take samples.
The read and take manipulators are defined externally to make it possible to control whether the stream operators reads or takes.
This stream operator can be chained together with operator>>(Functor f) to set other various properties of the read/take operation.
It is used as follows:
If either the read or take manipulator is not passed into the stream, the default behavior is to take.
manipulator | Either read or take |
|
inline |
Use the stream operator to dictate the behavior of the read or take operation.
There are a number of pre-defined stream manipulators (functions which return a functor that will be used by the stream operator). They dictate how the samples will be read or taken:
For example, to read up to 10 samples that have not been read before:
f | Each of the stream manipulators listed above return a Functor that will be passed to the stream operator. These Functors do not need to be accessed by the user directly. They should instead be passed indirectly via the return value of one of the provided stream manipulators. |
|
inline |
Read all samples using the default filter state.
This operation offers the same functionality and API as dds::sub::DataReader::take except that the samples returned remain in the dds::sub::DataReader such that they can be retrieved again by means of a read or take operation.
Please refer to the documentation of dds::sub::DataReader::take for details on the number of samples returned as well as the order in which the samples appear in these sequences.
The act of reading a sample changes its sample_state
to dds::sub::status::SampleState::read(). If the sample belongs to the most recent generation of the instance, it will also set the view_state
of the instance to be dds::sub::status::ViewState::not_new_view(). 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 dds::sub::DataReader by calling the dds::sub::LoanedSamples::return_loan() operation. The dds::sub::LoanedSamples destructor also takes care of returning the loan for you, so calling dds::sub::LoanedSamples::return_loan() explicitly is not required.
Important: When you loan data from the middleware, you must not keep any pointers to any part of the data samples or the dds::sub::SampleInfo objects after the call to dds::sub::LoanedSamples::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 dds::sub::LoanedSamples::return_loan() at some point, you do not have to do so before the next dds::sub::DataReader::take call. However, failure to return the loan will eventually deplete the dds::sub::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 dds::sub::DataReader is specified by the dds::core::policy::ResourceLimits and the rti::core::policy::DataReaderResourceLimits.
Important: If the samples "returned" by this method are loaned from RTI Connext (see dds::sub::DataReader::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.
One | of the Standard Exceptions, dds::core::PreconditionNotMetError, dds::core::NotEnabledError. |
|
inline |
Take all samples using the default filter state.
The operation will return the list of samples received by the dds::sub::DataReader since the last dds::sub::DataReader::take operation that matches the specified SampleStateMask, ViewStateMask and InstanceStateMask.
This operation may fail with dds::core::Error if the rti::core::policy::DataReaderResourceLimits::max_outstanding_reads limit has been exceeded.
The actual number of samples returned depends on the information that has been received by the middleware as well as the dds::core::policy::History, dds::core::policy::ResourceLimits, rti::core::policy::DataReaderResourceLimits and the characteristics of the data-type that is associated with the dds::sub::DataReader:
If the read or take succeeds and the number of samples returned has been limited (by means of a maximum limit, as listed above, or insufficient dds::sub::SampleInfo resources), the call will complete successfully and provide those samples the reader is able to return. The user may need to make additional calls, or return outstanding loaned buffers in the case of insufficient resources, in order to access remaining samples.
Note that in the case where the dds::topic::Topic associated with the dds::sub::DataReader is bound to a data-type that has no key definition, then there will be at most one instance in the dds::sub::DataReader. So the per-sample limits will apply.
The act of taking a sample removes it from RTI Connext so it cannot be read or taken again. If the sample belongs to the most recent generation of the instance, it will also set the view_state
of the sample's instance to dds::sub::status::ViewState::not_new_view(). It will not affect the instance_state
of the sample's instance.
Once the application completes its use of the samples it must 'return the loan' to the dds::sub::DataReader by calling the dds::sub::LoanedSamples::return_loan() operation. The dds::sub::LoanedSamples destructor also takes care of returning the loan for you, so calling dds::sub::LoanedSamples::return_loan() explicitly is not required.
Important: When you loan data from the middleware, you must not keep any pointers to any part of the data samples or the dds::sub::SampleInfo objects after the call to dds::sub::LoanedSamples::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 dds::sub::LoanedSamples::return_loan() at some point, you do not have to do so before the next dds::sub::DataReader::take call. However, failure to return the loan will eventually deplete the dds::sub::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 dds::sub::DataReader is specified by the dds::core::policy::ResourceLimits and the rti::core::policy::DataReaderResourceLimits.
To copy samples from the reader instead of taking a loan, you can use any of the read or take operations that receive an iterator to a container in which to copy the samples:
The order of the samples returned to the caller depends on the dds::core::policy::Presentation.
In all of the above cases, the relative order between the samples of one instance is consistent with the DESTINATION_ORDER policy:
source_timestamp
(FIFO, smaller values of source_timestamp
ahead of the larger values). In addition to the collection of samples, the read and take operations also use a collection of dds::sub::SampleInfo structures.
Some elements in the returned collection may not have valid data. If the instance_state in the dds::sub::SampleInfo is dds::sub::status::InstanceState::not_alive_disposed() or dds::sub::status::InstanceState::not_alive_no_writers(), then the last sample for that instance in the collection (that is, the one whose dds::sub::SampleInfo has sample_rank==0) does not contain valid data.
Samples that contain no data do not count towards the limits imposed by the dds::core::policy::ResourceLimits. The act of reading/taking a sample sets its sample_state to dds::sub::status::SampleState::read().
If the sample belongs to the most recent generation of the instance, it will also set the view_state of the instance to dds::sub::status::ViewState::not_new_view(). It will not affect the instance_state of the instance.
For an example on how take
can be used, please refer to the receive example.
One | of the Standard Exceptions, dds::core::PreconditionNotMetError, dds::core::NotEnabledError. |
Referenced by rti::request::SimpleReplier< RequestType, ReplyType >::SimpleReplier().
|
inline |
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.
SamplesFWIterator | A forward iterator whose value type is dds::sub::Sample<T> |
sfit | samples forward iterator |
max_samples | the maximum number of samples to read |
|
inline |
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.
SamplesFWIterator | A forward iterator whose value type is dds::sub::Sample<T> |
sfit | samples forward iterator. |
max_samples | the maximum number of samples to take. |
|
inline |
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.
SamplesBIIterator | A back-inserting iterator whose value type is dds::sub::Sample<T>. |
sbit | samples back-inserting iterator. |
For example:
|
inline |
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.
SamplesBIIterator | A back-inserting iterator whose value type is dds::sub::Sample<T> |
sbit | samples back-inserting iterator. |
|
inline |
Get a Selector to perform complex data selections, such as per-instance selection, content and status filtering.
The selector can be used as follows:
This shows how samples can be taken by selecting a specific instance, then filtering by state and content.
Note that when the application wants to access all available samples it can simply call DataReader::read() or DataReader::take().
|
inline |
Retrieve the instance key that corresponds to an instance handle.
Useful for keyed data types.
The operation will only fill the fields that form the key inside the key_holder
instance.
For keyed data types, this operation may fail with dds::core::InvalidArgumentError if the handle
does not correspond to an existing data-object known to the DataReader.
key_holder | A user data type specific key holder of type T whose key fields are filled by this operation. If T has no key, this operation has no effect. |
handle | The instance whose key is to be retrieved. If T has a key, handle must represent an existing instance of type T known to the DataReader. Otherwise, this method will fail with dds::core::InvalidArgumentError. If T has a key and handle is dds::core::InstanceHandle::nil(), this method will fail with dds::core::InvalidArgumentError. If T has a key and handle represents an instance of another type or an instance of type T that has been unregistered, this method will fail with dds::core::InvalidArgumentError. If T has no key, this method has no effect. |
|
inline |
Retrieve the instance key that corresponds to an instance handle.
Useful for keyed data types.
The operation will only fill the fields that form the key inside the key_holder
instance.
For keyed data types, this operation may fail with dds::core::InvalidArgumentError if the handle
does not correspond to an existing data-object known to the DataReader.
key_holder | A TopicInstance whose sample's key fields are filled by this operation. If T does not have a key, this method has no effect. |
handle | The instance whose key is to be retrieved. If T has a key, handle must represent an existing instance of type T known to the DataReader. Otherwise, this method will fail with dds::core::InvalidArgumentError. If T has a key and handle is dds::core::InstanceHandle::nil(), this method will fail with dds::core::InvalidArgumentError. If T has a key and handle represents an instance of another type or an instance of type T that has been unregistered, this method will fail with dds::core::InvalidArgumentError. If T has no key, this method has no effect. |
|
inline |
Retrieve the InstanceHandle that corresponds to an instance key holder.
Useful for keyed data types.
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. If the instance is unknown to the DataReader, or if for any other reason the Service is unable to provide an instance handle, the Service will return the special value dds::core::InstanceHandle::nil().
key_holder | <<in>> a user data type specific key holder. |
T
has no key, this method has no effect and returns dds::core::InstanceHandle::nil()
|
inline |
Returns the dds::topic::TopicDescription associated with the DataReader.
Returns that same TopicDescription that was used to create the dds::sub::DataReader.
|
inline |
Returns the Subscriber to which the DataReader belongs.
|
inline |
Sets the listener associated with this reader.
[DEPRECATED] The use of set_listener()
is recommended. Unlike this function, set_listener
receives a shared_ptr
which simplifies the management of listener's lifecycle.
the_listener | The DataReaderListener to set |
event_mask | The dds::core::status::StatusMask associated with the listener |
|
inline |
Returns the listener currently associated with this DataReader.
[DEPRECATED] Prefer get_listener()
instead of this function.
If there's no listener it returns NULL.
|
inline |
Sets the listener associated with this reader.
The DataReader will hold a shared_ptr
to the listener argument, ensuring that it is not deleted at least until this DataReader is deleted or the listener is reset with set_listener(nullptr)
.
the_listener | A shared pointer to the listener to receive status updates or nullptr to reset the current listener and stop receiving status updates. |
event_mask | A mask that indicates which status updates will be notified to the listener |
|
inline |
Sets the listener associated with this reader.
If the_listener
is not nullptr
, this overload is equivalent to:
If the_listener
is nullptr
, it is equivalent to:
the_listener | A shared pointer to the listener to receive status updates or nullptr to reset the current listener and stop receiving status updates. |
|
inline |
Returns the listener currently associated with this DataReader.
nullptr
if there is currently no listener associated to this entity.
|
inline |
Get the QoS associated with this reader.
|
inline |
Set the QoS associated with this reader.
This operation modifies the QoS of the DataReader.
The dds::core::policy::UserData, dds::core::policy::Deadline, dds::core::policy::LatencyBudget, dds::core::policy::TimeBasedFilter, dds::core::policy::ReaderDataLifecycle can be changed. The other policies are immutable.
the_qos | The DataReaderQos to be set to. Policies must be consistent. Immutable policies cannot be changed after the DataReader is enabled. dds::sub::Subscriber::default_datareader_qos() can be used to set the QoS of the DataReader to match the current default DataReaderQos set in the Subscriber. |
|
inline |
Set the QoS associated with this reader.
the_qos | the new qos for this DataReader. |
|
inline |
Get the QoS associated with this reader.
the_qos | the object to populate with the qos for this DataWriter. |
|
inline |
Waits until all "historical" data is received for DataReaders that have a non-VOLATILE Durability Qos kind.
This operation is intended only for dds::sub::DataReader entities that have a non-VOLATILE Durability QoS kind.
As soon as an application enables a non-VOLATILE dds::sub::DataReader, it will start receiving both "historical" data (i.e., the data that was written prior to the time the dds::sub::DataReader joined the domain) as well as any new data written by the dds::pub::DataWriter 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 dds::sub::DataReader::wait_for_historical_data operations.
dds::sub::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 dds::pub::DataWriter has been discovered before calling this operation. (One way to do this is by using dds::sub::DataReader::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. |
One | of the Standard Exceptions, dds::core::TimeoutError or dds::core::NotEnabledError. |
|
inline |
Get the LivelinessChangedStatus for this DataReader.
|
inline |
Get the SampleRejectedStatus for this DataReader.
|
inline |
Get the SampleLostStatus for this DataReader.
|
inline |
Get the RequestedDeadlineMissedStatus for this DataReader.
|
inline |
Get the RequestedIncompatibleQosStatus for this DataReader.
|
inline |
Get the SubscriptionMatchedStatus for this DataReader.
rti::core::status::DataReaderCacheStatus datareader_cache_status | ( | ) | const |
<<extension>> Get the DataReaderCacheStatus for this DataReader
rti::core::status::DataReaderProtocolStatus datareader_protocol_status | ( | ) | const |
<<extension>> Get the DataReaderProtocolStatus for this DataReader
rti::core::status::DataReaderProtocolStatus matched_publication_datareader_protocol_status | ( | const dds::core::InstanceHandle & | publication_handle | ) |
<<extension>> Get the DataReaderProtocolStatus for this DataReader
void acknowledge_all | ( | ) |
<<extension>> Acknowledge all previously accessed samples
Applicable only when dds::core::policy::Reliability::acknowledgment_kind = rti::core::policy::AcknowledgmentKind_def::APPLICATION_EXPLICIT
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 rti::core::RtpsReliableReaderProtocol::samples_per_app_ack and rti::core::RtpsReliableReaderProtocol::app_ack_period.
One | of the Standard Exceptions |
void acknowledge_all | ( | const AckResponseData & | response_data | ) |
<<extension>> Acknowledge all previously accessed samples
Applicable only when dds::core::policy::Reliability::acknowledgment_kind = rti::core::policy::AcknowledgmentKind_def::APPLICATION_EXPLICIT
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 rti::core::RtpsReliableReaderProtocol::samples_per_app_ack and rti::core::RtpsReliableReaderProtocol::app_ack_period.
The maximum length of the response is configured using rti::core::policy::DataReaderResourceLimits::max_app_ack_response_length.
response_data | <<in>> Response data sent to dds::pub::DataWriter upon acknowledgment |
One | of the Standard Exceptions |
void acknowledge_sample | ( | const dds::sub::SampleInfo & | sample_info | ) |
<<extension>> Acknowledge a single sample explicitly
Applicable only when dds::core::policy::Reliability::acknowledgment_kind = rti::core::policy::AcknowledgmentKind_def::APPLICATION_EXPLICIT
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 rti::core::RtpsReliableReaderProtocol::samples_per_app_ack and rti::core::RtpsReliableReaderProtocol::app_ack_period.
sample_info | <<in>> dds::sub::SampleInfo identifying the sample being acknowledged. |
One | of the Standard Exceptions |
void acknowledge_sample | ( | const dds::sub::SampleInfo & | sample_info, |
const AckResponseData & | response_data | ||
) |
<<extension>> Acknowledge a single sample explicitly
Applicable only when dds::core::policy::Reliability::acknowledgment_kind = rti::core::policy::AcknowledgmentKind_def::APPLICATION_EXPLICIT
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 rti::core::RtpsReliableReaderProtocol::samples_per_app_ack and rti::core::RtpsReliableReaderProtocol::app_ack_period.
The maximum length of the response is configured using rti::core::policy::DataReaderResourceLimits::max_app_ack_response_length
sample_info | <<in>> dds::sub::SampleInfo identifying the sample being acknowledged. |
response_data | <<in>> Response data sent to dds::pub::DataWriter upon acknowledgment (via dds::pub::DataWriterListener::on_application_acknowledgment) |
One | of the Standard Exceptions |
void close_contained_entities | ( | ) |
<<extension>> Closes all the entities created from this DataReader
Deletes all contained dds::sub::cond::ReadCondition, dds::sub::cond::QueryCondition, and rti::sub::TopicQuery objects.
The operation will fail with dds::core::PreconditionNotMetError if the any of the contained entities is in a state where it cannot be deleted.
One | of the Standard Exceptions, or dds::core::PreconditionNotMetError |
bool read | ( | T & | sample | ) |
<<extension>> Copies the next not-previously-accessed valid data value from the DataReader via a read operation.
This function ignores SampleInfo and therefore also skips samples with invalid data.
sample | The sample where to copy the values of the next unread sample if the function returned true, or undefinded values otherwise. |
bool read | ( | T & | sample, |
dds::sub::SampleInfo & | sample_info | ||
) |
<<extension>> Copies the next not-previously-accessed data value from the DataReader via a read operation.
This operation copies the next not-previously-accessed data value from the dds::sub::DataReader. This operation also copies the corresponding dds::sub::SampleInfo. The implied order among the samples stored in the dds::sub::DataReader is the same as for the dds::sub::DataReader::read operation.
The dds::sub::DataReader::read(T& sample, dds::sub::SampleInfo& sample_info) operation is semantically equivalent to the dds::sub::DataReader::read operation, where the sample_states=NOT_READ, the view_states=ANY_VIEW_STATE, and the instance_states=ANY_INSTANCE_STATE.
One | of the Standard Exceptions, dds::core::NotEnabledError. |
bool take | ( | T & | sample | ) |
<<extension>> Copies the next not-previously-accessed valid data value from the DataReader via a take operation.
This function ignores SampleInfo and therefore also skips samples with invalid data.
sample | The sample where to copy the values of the next unread sample if the function returned true, or undefinded values otherwise. |
Example:
bool take | ( | T & | sample, |
dds::sub::SampleInfo & | sample_info | ||
) |
<<extension>> Copies the next not-previously-accessed data value from the DataReader via a take operation.
This operation copies the next not-previously-accessed data value from the dds::sub::DataReader and 'removes' it from the dds::sub::DataReader so that it is no longer accessible. This operation also copies the corresponding dds::sub::SampleInfo. This operation is analogous to the dds::sub::DataReader::read(T& sample, dds::sub::SampleInfo& sample_info) except for the fact that the sample is removed from the dds::sub::DataReader.
The dds::sub::DataReader::take(T& sample, dds::sub::SampleInfo& sample_info) operation is semantically equivalent to the dds::sub::DataReader::take operation, where the sample_states=NOT_READ, the view_states=ANY_VIEW_STATE, and the instance_states=ANY_INSTANCE_STATE.
One | of the Standard Exceptions, |
bool is_data_consistent | ( | const T & | sample, |
const dds::sub::SampleInfo & | sample_info | ||
) |
<<extension>> Checks if the sample has been overwritten by the DataWriter
sample | Sample to be validated |
sample_info | dds::sub::SampleInfo object received with the sample |
bool is_data_consistent | ( | const rti::sub::LoanedSample< T > & | sample | ) |
<<extension>> Checks if the sample has been overwritten by the DataWriter
When a sample is received via Zero Copy transfer over shared memory, the sample can be reused by the DataWriter once it is removed from the DataWriter's send queue. Since there is no synchronization between the DataReader and the DataWriter, the sample could be overwritten by the DataWriter before it is processed by the DataReader. The dds::sub::DataReader::is_data_consistent operation can be used after processing the sample to check if it was overwritten by the DataWriter.
A precondition for using this operation is to set rti::core::DataWriterShmemRefTransferModeSettings::enable_data_consistency_check to true.
@language_binding(FLAT_DATA)
. Reading a FlatData sample delivered with Zero Copy transfer over shared memory while the DataWriter is overwriting it is undefined behavior. An application-level synchronization mechanism is required in this case. One | of the Standard Exceptions or dds::core::PreconditionNotMetError. |
const std::string & topic_name | ( | ) | const |
<<extension>> Get the topic name associated with this DataReader
const std::string & type_name | ( | ) | const |
<<extension>> Get the type name associated with this DataReader
void close | ( | ) |
Close this DataReader.
|
related |
The stream manipulator to indicate that the reader should read samples as opposed to taking the samples.
Usage:
|
related |
The stream manipulator to indicate that the reader should take samples as opposed to reading the samples.
Usage:
The default mode to access samples is to take, so the above is equivalent to:
|
related |
Stream manipulator to set the maximum number of samples to read or take.
Use this function to set the maximum number of samples to read/take by passing it to the DataReader::operator >>(Functor f) operator.
n | The maximum number of samples to take |
|
related |
Stream manipulator to set a Query to use during the subsequent read/take operation.
The effect of using this manipulator is that the subsequent read/take will filter the samples based on the Query's expression. If the DataReader has no samples that meet the constraints, the read/take will not return any data.
If this stream manipulator comes before a call to the condition(const dds::sub::cond::QueryCondition& query_condition) manipulator then it will be overridden and will not have any effect on the read or take operation. Similarly, if this operation follows a call to condition(), then the previously set QueryCondition will be cleared.
query | The Query to use during the read/take |
|
related |
Stream manipulator to set a QueryCondition to use during the subsequent read/take operation.
The effect of using this manipulator is that the subsequent read/take will filter the samples based on the QueryConditions's expression and state. If the DataReader has no samples that meet the constraints, the read/take will not return any data.
If this stream manipulator comes before a call to the content(const dds::sub::Query& query) manipulator then it will be overridden and will not have any effect on the read or take operation. Similarly, if this operation follows a call to content() and/or state(const dds::sub::status::DataState& s), then the previously set Query and DataState will be cleared.
This manipulator is effectively a combination of the content and state manipulators.
For example:
is equivalent to:
condition | The QueryCondition to use during the read/take |
|
related |
Stream manipulator to specify the DataState of the samples that should be read/taken.
By setting the dds::sub::status::DataState you can specify the state of the samples that should be read or taken. The DataState of a sample encapsulates the dds::sub::status::SampleState, dds::sub::status::ViewState, and dds::sub::status::InstanceState of a sample.
If this stream manipulator comes before a call to the condition(const dds::sub::cond::QueryCondition& query_condition) manipulator then it will be overridden and will not have any effect on the read or take operation.
s | The DataState of the samples to be read or taken |
|
related |
Stream manipulator to specify the instance whose samples should be read or taken.
This operation causes the subsequent read or take operation to access only samples belonging the single specified instance whose handle is h
.
Upon successful completion, the data collection will contain samples all belonging to the same instance. The corresponding SampleInfo verifies SampleInfo.instance_handle() == h
.
The subsequent read/take operation will be semantically equivalent to a read or take without specifying the instance, except in building the collection, the DataReader will check that the sample belongs to the specified instance and otherwise it will not place the sample in the returned collection.
The subsequent read/take may operation may fail with dds::core::InvalidArgumentError if the InstanceHandle does not correspond to an existing data-object known to the DataReader.
h | The handle of the instance to access |
|
related |
Stream manipulator to specify the samples belonging to the 'next' instance after the provided instance handle should be accessed.
This operation causes the subsequent read or take operation to access only samples belonging a single instance whose handle is considered 'next' after the provided InstanceHandle h
.
The accessed samples will all belong to the 'next' instance with InstanceHandle 'greater' than the specified previous handle that has available samples.
This operation implies the existence of a total order 'greater-than' relationship between the instance handles. The specifics of this relationship are not all important and are implementation specific. The important thing is that, according to the middleware, all instances are ordered relative to each other. This ordering is between the instance handles; It should not depend on the state of the instance (e.g. whether it has data or not) and must be defined even for instance handles that do not correspond to instances currently managed by the dds::sub::DataReader. For the purposes of the ordering, it should be 'as if' each instance handle was represented as unique integer.
The behavior of dds::sub::DataReader::Selector::next_instance is 'as if' the dds::sub::DataReader invoked dds::sub::instance(const dds::core::InstanceHandle& h), passing the smallest instance_handle
among all the ones that: (a) are greater than previous_handle
, and (b) have available samples (i.e. samples that meet the constraints imposed by the specified states).
The special value dds::core::InstanceHandle::nil() is guaranteed to be 'less than' any valid instance_handle
. So the use of the parameter value previous_handle
== dds::core::InstanceHandle::nil() will return the samples for the instance which has the smallest instance_handle
among all the instances that contain available samples.
previous_handle
== dds::core::InstanceHandle::nil(), examines the samples returned, and then uses the instance_handle
returned in the dds::sub::SampleInfo as the value of the previous_handle
argument to the next call to dds::sub::DataReader::Selector::next_instance. The iteration continues until the read/take operation doesn't return any more samples. This application-driven iteration is required to ensure that all samples on the reader queue are read. Note that it is possible to call the dds::sub::DataReader::Selector::next_instance operation with a previous_handle
that does not correspond to an instance currently managed by the dds::sub::DataReader. This is because as stated earlier the 'greater-than' relationship is defined even for handles not managed by the dds::sub::DataReader. One practical situation where this may occur is when an application is iterating though all the instances, takes all the samples of a dds::sub::status::InstanceState::not_alive_no_writers() instance, returns the loan (at which point the instance information may be removed, and thus the handle becomes invalid), and tries to read the next instance.
h | The reference instance. The instance after this one will be selected |
|
related |
Instructs RTI Connext to locally ignore a subscription.
A subscription is defined by the association of a topic name, user data, and partition set on the dds::sub::Subscriber (see dds::topic::SubscriptionBuiltinTopicData). After this call, any data received related to that subscription's dds::sub::DataReader will be ignored.
This operation can be used to ignore local and remote DataReaders.
The subscription to ignore is identified by the handle
argument.
handle
can be obtained from the dds::sub::SampleInfo retrieved when reading data samples from the built-in dds::sub::DataReader for the subscription topic. handle
can be obtained by calling dds::core::Entity::instance_handle() for the local DataReader. There is no way to reverse this operation.
One | of the Standard Exceptions, dds::core::OutOfResourcesError or dds::core::NotEnabledError |
participant | The DomainParticipant for which the remote entity will be ignored |
handle | The InstanceHandle of the remote entity that has to be ignored |
|
related |
Instructs RTI Connext to locally ignore subscriptions.
participant | The DomainParticipant for which the remote entity will be ignored |
begin | A forward iterator to the initial position in a dds::core::InstanceHandleSeq holding the handles to the remote DataReaders to be ignored. |
end | A forward iterator to the final position in a dds::core::InstanceHandleSeq holding the handles to the remote DataReaders to be ignored. |
|
related |
Retrieve the list of publications currently "associated" with a DataReader.
A publication is considered to be matching if all of the following criteria are true:
The handles returned in the publication_handles
list are the ones that are used by the RTI Connext implementation to locally identify the corresponding matched dds::pub::DataWriter entities. These handles match the ones that appear in the instance_handle
field of the dds::sub::SampleInfo when reading the dds::topic::publication_topic_name() builtin topic.
This API may return the publication handles of publications that are not alive. dds::sub::DataReader::is_matched_publication_alive can be used to check the liveliness of the remote publication.
One | of the Standard Exceptions, or dds::core::OutOfResourcesError if the sequence is too small and the system cannot resize it, or dds::core::NotEnabledError |
T | The topic-type that the DataReader subscribes to |
reader | The reader whose publications are being retrieved |
|
related |
Retrieve the list of publications currently "associated" with a DataReader.
A publication is considered to be matching if all of the following criteria are true:
The handles returned in the publication_handles
list are the ones that are used by the RTI Connext implementation to locally identify the corresponding matched dds::pub::DataWriter entities. These handles match the ones that appear in the instance_handle
field of the dds::sub::SampleInfo when reading the dds::topic::publication_topic_name() builtin topic.
This API may return the publication handles of publications that are not alive. dds::sub::DataReader::is_matched_publication_alive can be used to check the liveliness of the remote publication.
One | of the Standard Exceptions, or dds::core::OutOfResourcesError if the sequence is too small and the system cannot resize it, or dds::core::NotEnabledError |
T | The topic-type that the DataReader subscribes to |
FwdIterator | A forward iterator whose value type is dds::core::InstanceHandle |
reader | The reader whose publications are being retrieved |
begin | A forward iterator to the beginning position in the destination container of matching InstanceHandles |
end | A forward iterator to the ending position in the destination container of matching InstanceHandles |
|
related |
This operation retrieves the information on a publication that is currently "associated" with the DataReader.
The publication_handle
must correspond to a publication currently associated with the dds::sub::DataReader. Otherwise, the operation will fail with dds::core::InvalidArgumentError. Use the operation dds::sub::matched_publications to find the publications that are currently matched with the dds::sub::DataReader.
Note: This operation does not retrieve the dds::topic::PublicationBuiltinTopicData::type. This information is available through dds::sub::DataReaderListener::on_data_available() (if a reader listener is installed on the dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData>).
One | of the Standard Exceptions or dds::core::NotEnabledError |
T | The topic-type that the DataReader subscribes to |
reader | The reader associated with the publication whose data is being retrieved |
handle | The InstanceHandle Handle to a specific publication associated with the DataWriter. Must correspond to a publication currently associated with the DataReader. |
|
related |
<<extension>> This operation retrieves the information on the discovered dds::domain::DomainParticipant associated with the publication that is currently matching with the dds::sub::DataReader.
The publication_handle
must correspond to a publication currently associated with the dds::sub::DataReader. Otherwise, the operation will fail with dds::core::InvalidArgumentError. The operation may also fail with dds::core::PreconditionNotMetError if the publication corresponds to the same dds::domain::DomainParticipant that the DataReader belongs to. Use the operation dds::sub::matched_publications to find the publications that are currently matched with the dds::sub::DataReader.
One | of the Standard Exceptions or dds::core::NotEnabledError |
T | The topic-type that the DataReader subscribes to |
reader | The reader to lookup the matched participant data of |
handle | The InstanceHandle to a specific publication associated with a DataWriter. Must correspond to a publication currently associated with the DataReader. This handle is available in the dds::sub::SampleInfo::publication_handle() |
|
related |
<<extension>> Check if a matched publication is alive.
T | The topic-type that the DataReader subscribes to. |
reader | The DataReader. |
handle | The dds::core::InstanceHandle of the matched publication. |
This API is used for querying the endpoint liveliness of a matched publication. A matched publication will be marked as not alive if the liveliness that it committed to through its LIVELINESS QoS policy was not respected. Note that if the participant associated with the matched publication loses liveliness, the dds::core::InstanceHandle will become invalid and this function will fail with dds::core::InvalidArgumentError.
reader | <<in>> The DataReader. |
handle | <<in>> The dds::core::InstanceHandle of the matched publication. See dds::sub::matched_publications for a description of what is considered a matched publication. |
One | of the Standard Exceptions |
|
related |
<<extension>> Obtain the PublicationBuiltinTopicData for all of the publications matched with a DataReader.
This API retrieves the matched subscription data from all of the publications currently matched a DataReader.
T | The topic-type that the DataReader subscribes to. |
reader | The DataReader. |
|
related |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching topic name.
Use this operation on the built-in dds::sub::Subscriber (Built-in Topics) to access the built-in dds::sub::DataReader entities for the built-in topics.
The built-in dds::sub::DataReader is created when this operation is called on a built-in topic for the first time. The built-in dds::sub::DataReader is deleted automatically when the dds::domain::DomainParticipant is deleted.
To ensure that builtin dds::sub::DataReader entities receive all the discovery traffic, it is suggested that you lookup the builtin dds::sub::DataReader before the dds::domain::DomainParticipant is enabled. Looking up builtin dds::sub::DataReader may implicitly register builtin transports due to creation of dds::sub::DataReader (see Built-in Transport Plugins for details on when a builtin transport is registered). 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:
The returned dds::sub::DataReader may be enabled or disabled.
If more than one dds::sub::DataReader is attached to the dds::sub::Subscriber, this operation may return any one of them.
Reader | The type of the reader. It can be dds::sub::AnyDataReader, or an instantiation of dds::sub::DataReader<T> (if T is not the correct type, this function throws dds::core::InvalidDowncastError) |
FwdIterator | The type of forward iterator passed to this function |
subscriber | The dds::sub::Subscriber the DataReader belongs to |
topic_name | Name of the dds::topic::Topic associated with the DataReader that is to be looked up. |
begin | A forward iterator to the position in the destination container where the DataReaders will be copied into |
max_size | Only 1 DataReader will be returned from this function |
|
related |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching topic name.
Use this operation on the built-in dds::sub::Subscriber (Built-in Topics) to access the built-in dds::sub::DataReader entities for the built-in topics.
The built-in dds::sub::DataReader is created when this operation is called on a built-in topic for the first time. The built-in dds::sub::DataReader is deleted automatically when the dds::domain::DomainParticipant is deleted.
To ensure that builtin dds::sub::DataReader entities receive all the discovery traffic, it is suggested that you lookup the builtin dds::sub::DataReader before the dds::domain::DomainParticipant is enabled. Looking up builtin dds::sub::DataReader may implicitly register builtin transports due to creation of dds::sub::DataReader (see Built-in Transport Plugins for details on when a builtin transport is registered). 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:
The returned dds::sub::DataReader may be enabled or disabled.
If more than one dds::sub::DataReader is attached to the dds::sub::Subscriber, this operation may return any one of them.
Reader | The type of the reader. It can be dds::sub::AnyDataReader, or an instantiation of dds::sub::DataReader<T> (if T is not the correct type, this function throws dds::core::InvalidDowncastError) |
BinIterator | The type of back-inserting iterator passed to this function |
subscriber | The dds::sub::Subscriber the DataReader belongs to |
topic_name | Name of the dds::topic::Topic associated with the DataReader that is to be looked up. |
begin | A back-inserting iterator to the position in the destination container to insert the found DataReader into |
|
related |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching TopicDescription.
|
related |
This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching TopicDescription.
|
related |
<<extension>> Retrieve all the dds::sub::DataReader created from this dds::sub::Subscriber
AnyDataReaderBackInsertIterator | Type of the back-inserting iterator passed into this function, whose value_type must be dds::sub::AnyDataReader. |
subscriber | The dds::sub::Subscriber the DataReaders belong to |
begin | A back-inserting iterator to the position in the destination container to insert the found DataReaders into |
|
related |
<<extension>> Retrieve all the readers created from a subscriber.
AnyDataReaderForwardIterator | A forward iterator whose value_type is dds::sub::AnyDataReader |
subscriber | The dds::sub::Subscriber the readers belong to |
begin | A forward iterator to the position in the destination container where to begin copying the found readers into. |
max_size | The maximum number of readers to return |
|
related |
<<extension>> Retrieves a dds::sub::DataReader with the given topic name within the dds::sub::Subscriber
Use this operation on the built-in dds::sub::Subscriber (Built-in Topics) to access the built-in dds::sub::DataReader entities for the built-in topics.
The built-in dds::sub::DataReader is created when this operation is called on a built-in topic for the first time. The built-in dds::sub::DataReader is deleted automatically when the dds::domain::DomainParticipant is deleted.
To ensure that builtin dds::sub::DataReader entities receive all the discovery traffic, it is suggested that you lookup the builtin dds::sub::DataReader before the dds::domain::DomainParticipant is enabled. Looking up builtin dds::sub::DataReader may implicitly register builtin transports due to creation of dds::sub::DataReader (see Built-in Transport Plugins for details on when a builtin transport is registered). 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:
The returned dds::sub::DataReader may be enabled or disabled.
If more than one dds::sub::DataReader is attached to the dds::sub::Subscriber, this operation may return any one of them.
Reader | The type of the reader. It can be dds::sub::AnyDataReader, or an instantiation of dds::sub::DataReader<T> (if T is not the correct type, this function throws dds::core::InvalidDowncastError) |
subscriber | The dds::sub::Subscriber that created the DataReader to find |
topic_name | Topic name of the DataReader to find |
|
related |
<<extension>> Retrieves a dds::sub::DataReader with the given name within the dds::sub::Subscriber
Reader | The type of the reader. It can be dds::sub::AnyDataReader, or an instantiation of dds::sub::DataReader<T> (if T is not the correct type, this function throws dds::core::InvalidDowncastError) |
Every dds::sub::DataReader in the system has an entity name which is configured and stored in the <<extension>> EntityName policy, ENTITY_NAME.
This operation retrieves the dds::sub::DataReader within the dds::sub::Subscriber whose name matches the one specified. If there are several dds::sub::DataReader with the same name within the dds::sub::Subscriber, the operation returns the first matching occurrence.
subscriber | The dds::sub::Subscriber that created the DataReader to find |
datareader_name | Entity name of the DataReader to find |
|
related |
<<extension>> Retrieves a dds::sub::DataReader with the given TopicDescription within the dds::sub::Subscriber
Reader | The type of the reader returned, for example, dds::sub::DataReader<Foo>, or dds::sub::AnyDataReader |
T | The topic-type |
subscriber | The Subscriber to which the DataReader belongs |
topic_description | The TopicDescription identifying the DataReader to find |
|
related |
<<extension>> Retrieves a dds::sub::DataReader within the dds::domain::DomainParticipant with the given name
Reader | The type of the reader. It can be dds::sub::AnyDataReader, or an instantiation of dds::sub::DataReader<T> (if T is not the correct type, this function throws dds::core::InvalidDowncastError) |
Every dds::sub::DataReader in the system has an entity name which is configured and stored in the EntityName policy, ENTITY_NAME.
Every dds::sub::Subscriber in the system has an entity name which is also configured and stored in the EntityName policy, ENTITY_NAME.
This operation retrieves a dds::sub::DataReader within a dds::sub::Subscriber given the specified name which encodes both to the dds::sub::DataReader and the dds::sub::Subscriber name.
If there are several dds::sub::DataReader with the same name within the corresponding dds::sub::Subscriber this function returns the first matching occurrence.
The specified name might be given as a fully-qualified entity name or as a plain name.
The fully qualified entity name is a concatenation of the dds::sub::Subscriber to which the dds::sub::DataReader belongs and the entity name of of the dds::sub::DataReader itself, separated by a double colon "::". For example: MySubscriberName::MyDataReaderName
The plain name contains the dds::sub::DataReader name only. In this situation it is implied that the dds::sub::DataReader belongs to the implicit dds::sub::Subscriber so the use of a plain name is equivalent to specifying a fully qualified name with the dds::sub::Subscriber name part being "implicit". For example: the plain name "MyDataReaderName" is equivalent to specifiying the fully qualified name "implicit::MyDataReaderName"
The dds::sub::DataReader is only looked up within the dds::sub::Subscriber specified in the fully qualified name, or within the implicit dds::sub::Subscriber if the name was not fully qualified.
participant | The dds::domain::DomainParticipant within which the dds::sub::DataReader exists |
datareader_name | EntityName of the DataReader to find |