CoreDX DDS Modern C++ API
Namespaces | Classes | Functions
dds::sub Namespace Reference

Sub namespace. More...

Namespaces

 qos
 Namespace for Subscription related QoS collections.
 

Classes

class  AnyDataReader
 Typeless base class for the typed DataReader. More...
 
class  AnyDataReaderListener
 Base un-typed Listener that can be associated with a AnyDataReader. More...
 
class  DataReader
 The type specific DataReader. More...
 
class  DataReaderListener
 Base typed Listener that can be associated with a DataReader. More...
 
class  LoanedSamples
 This class encapsulate and automates the management of loaned samples. More...
 
class  NoOpAnyDataReaderListener
 Derives from the base AnyDataReader Listener. More...
 
class  NoOpDataReaderListener
 Derives from the typed DataReader Listener. More...
 
class  NoOpSubscriberListener
 Derives from the base Subscriber Listener. More...
 
class  Query
 Query objects contain expressions that allow the application to specify a filter on the locally available data. More...
 
class  Rank
 This class encapsulates the concept of rank for a sample. More...
 
class  Sample
 This class encapsulate the data and meta-data associated with DDS samples. More...
 
class  SampleInfo
 This class implements the DDS SampleInfo. More...
 
class  SharedSamples
 The class SharedSamples is used as a container safe and sharable version of the LoanedSamples class. More...
 
class  Subscriber
 Subscriber is a container for DataReaders. More...
 
class  SubscriberListener
 Base Listener that can be associated with a Subscriber. More...
 

Functions

const dds::sub::Subscriber OMG_DDS_API builtin_subscriber (const dds::domain::DomainParticipant &dp)
 Retrieves the built-in subscriber for the given domain participant. More...
 
template<typename READER , typename FwdIterator >
uint32_t find (const dds::sub::Subscriber &sub, 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 &sub, 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 &sub, const dds::topic::TopicDescription &topic_description, 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 T , typename BinIterator >
uint32_t find (const dds::sub::Subscriber &sub, const dds::topic::TopicDescription &topic_description, 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 FwdIterator >
uint32_t find (const dds::sub::Subscriber &sub, const dds::sub::status::DataState &rs, FwdIterator begin, uint32_t max_size)
 This function retrieves a previously-created DataReader belonging to the Subscriber that is in a specific state.
 
template<typename READER , typename BinIterator >
uint32_t find (const dds::sub::Subscriber &sub, const dds::sub::status::DataState &rs, BinIterator begin)
 This function retrieves a previously-created DataReader belonging to the Subscriber that is in a specific state.
 
void ignore (const dds::domain::DomainParticipant &dp, const dds::core::InstanceHandle &handle)
 Ignore subscriptions. More...
 
template<typename FwdIterator >
void ignore (const dds::domain::DomainParticipant &dp, FwdIterator begin, FwdIterator end)
 Ignore subscriptions. More...
 
template<typename T >
const dds::core::InstanceHandleSeq matched_publications (const dds::sub::DataReader< T > &dw)
 This operation retrieves the list of publications currently “associated” with the DataReader; that is, publications that have a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the dds::domain::ignore operation. More...
 
template<typename T , typename FwdIterator >
dds::core::InstanceHandleSeq & matched_publications (const dds::sub::DataReader< T > &dw, FwdIterator begin, FwdIterator end)
 This operation retrieves the list of publications currently “associated” with the DataReader; that is, publications that have a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the dds::domain::ignore operation. More...
 
template<typename T >
const dds::topic::SubscriptionBuiltinTopicData matched_publications_data (const dds::sub::DataReader< T > &dw, const dds::core::InstanceHandle &h)
 This operation retrieves information on a publication that is currently associated with the DataReader; that is, a subscription with a matching Topic and compatible QoS that the application has not indicated should be ignored by means of the DomainParticipant ignore_subscription operation. More...
 
template<typename SELECTOR >
SELECTOR & read (SELECTOR &selector)
 Stream manipulator that indicates samples should be accessed by a 'read' operation. More...
 
template<typename SELECTOR >
SELECTOR & take (SELECTOR &selector)
 Stream manipulator that indicates samples should be accessed by a 'take' operation. More...
 
dds::sub::functors::MaxSamplesManipulatorFunctor max_samples (uint32_t n)
 Limit the number of samples, read by the DataReader stream operator>>. More...
 
dds::sub::functors::ContentFilterManipulatorFunctor content (const dds::sub::Query &query)
 Filter the samples by the query, read by the DataReader stream operator>>. More...
 
dds::sub::functors::StateFilterManipulatorFunctor state (const dds::sub::status::DataState &s)
 Filter the samples based on their state, read by the DataReader stream operator>>. More...
 
dds::sub::functors::InstanceManipulatorFunctor instance (const dds::core::InstanceHandle &h)
 Filter the samples of an instance, read by the DataReader stream operator>>. More...
 
dds::sub::functors::NextInstanceManipulatorFunctor next_instance (const dds::core::InstanceHandle &h)
 Filter the samples of the next instance, read by the DataReader stream operator>>. More...
 

Detailed Description

Sub namespace.

Function Documentation

◆ builtin_subscriber()

const dds::sub::Subscriber OMG_DDS_API dds::sub::builtin_subscriber ( const dds::domain::DomainParticipant dp)

Retrieves the built-in subscriber for the given domain participant.

Parameters
dpthe domain participant.

◆ content()

dds::sub::functors::ContentFilterManipulatorFunctor dds::sub::content ( const dds::sub::Query query)
inline

Filter the samples by the query, read by the DataReader stream operator>>.

Reading data can be done by the DataReader stream operator>>. Normally, that would read all data samples that is available within the reader. However, it is possible to manipulate what samples are read.

By adding this operation as a selection in the read or as a manipulator in the read streaming operator, it is explicitly indicated that samples will be filtered according to the given dds::sub::Query.

// Assume data type has an element called long_1
dds::sub::Query query(reader, "long_1 > 1 and long_1 < 7");
// Read samples, filtered by content
reader >> dds::sub::dds::sub::content(query) >> samples;

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader stream operator>>
Query

◆ find() [1/4]

template<typename READER , typename FwdIterator >
uint32_t dds::sub::find ( const dds::sub::Subscriber sub,
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.

If no such DataReader exists, the operation will return an empty container. The use of this operation on the built-in Subscriber allows access to the built-in DataReader entities for the built-in topics

Returns
the total number of elements found. Notice that at most max_size will be copied using the provided iterator.

◆ find() [2/4]

template<typename READER , typename BinIterator >
uint32_t dds::sub::find ( const dds::sub::Subscriber sub,
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.

If no such DataReader exists, the operation will return an empty container. The use of this operation on the built-in Subscriber allows access to the built-in DataReader entities for the built-in topics

Returns
the total number of elements found and copied over.

◆ find() [3/4]

template<typename READER , typename T , typename FwdIterator >
uint32_t dds::sub::find ( const dds::sub::Subscriber sub,
const dds::topic::TopicDescription topic_description,
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.

If no such DataReader exists, the operation will return an empty container. The use of this operation on the built-in Subscriber allows access to the built-in DataReader entities for the built-in topics

◆ find() [4/4]

template<typename READER , typename T , typename BinIterator >
uint32_t dds::sub::find ( const dds::sub::Subscriber sub,
const dds::topic::TopicDescription topic_description,
BinIterator  begin 
)

This function retrieves a previously-created DataReader belonging to the Subscriber that is attached to a Topic with a matching topic_name.

If no such DataReader exists, the operation will return an empty container. The use of this operation on the built-in Subscriber allows access to the built-in DataReader entities for the built-in topics

◆ ignore() [1/2]

void dds::sub::ignore ( const dds::domain::DomainParticipant dp,
const dds::core::InstanceHandle handle 
)

Ignore subscriptions.

Parameters
dpthe DomainParticipant for which the remote entity will be ignored
handlethe InstanceHandle of the remote entity that has to be ignored
Not Yet Supported:

◆ ignore() [2/2]

template<typename FwdIterator >
void dds::sub::ignore ( const dds::domain::DomainParticipant dp,
FwdIterator  begin,
FwdIterator  end 
)

Ignore subscriptions.

Parameters
dpthe DomainParticipant for which the remote entity will be ignored
beginan iterator marking the beginning
endan iterator marking the ending
Not Yet Supported:

◆ instance()

Filter the samples of an instance, read by the DataReader stream operator>>.

Reading data can be done by the DataReader stream operator>>. Normally, that would read all data samples that is available within the reader. However, it is possible to manipulate what samples are read.

By adding this operation as a selection in the read or as a manipulator in the read streaming operator, it is explicitly indicated that only samples of the given instance are read. For example:

dds::core::InstanceHandle hdl = someValidInstanceHandle;
// Read samples, filtered by instance
reader >> dds::sub::instance(hdl) >> samples;

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader stream operator>>
Instance Handle

◆ matched_publications() [1/2]

template<typename T >
const dds::core::InstanceHandleSeq dds::sub::matched_publications ( const dds::sub::DataReader< T > &  dw)

This operation retrieves the list of publications currently “associated” with the DataReader; that is, publications that have a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the dds::domain::ignore operation.

The handles returned in the 'publication_handles' list are the ones that are used by the DDS implementation to locally identify the corresponding matched DataWriter entities. These handles match the ones that appear in the 'instance_handle' field of the SampleInfo when reading the “DCPSPublications” builtin topic. The operation may fail if the infrastructure does not locally maintain the connectivity information.

Not Yet Supported:

◆ matched_publications() [2/2]

template<typename T , typename FwdIterator >
dds::core::InstanceHandleSeq& dds::sub::matched_publications ( const dds::sub::DataReader< T > &  dw,
FwdIterator  begin,
FwdIterator  end 
)

This operation retrieves the list of publications currently “associated” with the DataReader; that is, publications that have a matching Topic and compatible QoS that the application has not indicated should be “ignored” by means of the dds::domain::ignore operation.

The handles returned in the 'publication_handles' list are the ones that are used by the DDS implementation to locally identify the corresponding matched DataWriter entities. These handles match the ones that appear in the 'instance_handle' field of the SampleInfo when reading the “DCPSPublications” builtin topic. The operation may fail if the infrastructure does not locally maintain the connectivity information.

Not Yet Supported:

◆ matched_publications_data()

template<typename T >
const dds::topic::SubscriptionBuiltinTopicData dds::sub::matched_publications_data ( const dds::sub::DataReader< T > &  dw,
const dds::core::InstanceHandle h 
)

This operation retrieves information on a publication that is currently associated with the DataReader; that is, a subscription with a matching Topic and compatible QoS that the application has not indicated should be ignored by means of the DomainParticipant ignore_subscription operation.

The publication handle must correspond to a publication currently associated with the DataReader, otherwise the operation will fail and throw a BadParameterError. The operation matched_subscriptions can be used to find the subscriptions that are currently matched with the DataWriter.

The operation may also fail if the infrastructure does not hold the information necessary to fill in the subscription_data. In this case the operation will throw UnsupportedError.

Not Yet Supported:

◆ max_samples()

dds::sub::functors::MaxSamplesManipulatorFunctor dds::sub::max_samples ( uint32_t  n)
inline

Limit the number of samples, read by the DataReader stream operator>>.

Reading data can be done by the DataReader stream operator>>. Normally, that would read all data samples that is available within the reader. However, it is possible to manipulate what samples are read.

By adding this operation as a selection in the read or as a manipulator in the read streaming operator, it is explicitly indicated that a maximum of n samples will be read.

// Read a maximum of three samples
reader >> dds::sub::max_samples(3) >> samples;

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader stream operator>>

◆ next_instance()

Filter the samples of the next instance, read by the DataReader stream operator>>.

Reading data can be done by the DataReader stream operator>>. Normally, that would read all data samples that is available within the reader. However, it is possible to manipulate what samples are read.

By adding this operation as a selection in the read or as a manipulator in the read streaming operator, it is explicitly indicated that only samples of the next instance of the given instance are read. When the given instance is a nil handle, then the first instance will be read. For example:

// Read all samples, instance by instance
{
// Get sample(s) of first instance
reader >> dds::sub::next_instance(hdl) >> samples;
while (samples.length() > 0) {
// Handle the sample(s) of this instance (just the first one in this case)
const dds::sub::Sample<Foo::Bar>& sample = *(samples.begin());
// Get sample(s) of the next instance
hdl = sample.info().instance_handle();
reader >> dds::sub::next_instance(hdl) >> samples;
}
}

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader stream operator>>
Instance Handle

◆ read()

template<typename SELECTOR >
SELECTOR & dds::sub::read ( SELECTOR &  selector)

Stream manipulator that indicates samples should be accessed by a 'read' operation.

Reading data can be done by the DataReader stream operator>>. The default of that operator is to read samples (not to take them). However, it is possible to manipulate if the samples are read or taken.

By adding this manipulator in the stream operator>>, it is explicitly indicated that the samples will be read and not taken. For example:

// Read all samples implicitly
reader >> samples;
// Read all samples explicitly
reader >> dds::sub::read >> samples;

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader stream operator>>

◆ state()

Filter the samples based on their state, read by the DataReader stream operator>>.

Reading data can be done by the DataReader stream operator>>. Normally, that would read all data samples that is available within the reader. However, it is possible to manipulate what samples are read.

By adding this operation as a selection in the read or as a manipulator in the read streaming operator, it is explicitly indicated that samples will be filtered according to the given dds::sub::status::DataState.

// DataState to filter only new data
// Read samples, filtered by state
reader >> dds::sub::state(newData) >> samples;

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader select()
DataReader stream operator>>
Query

◆ take()

template<typename SELECTOR >
SELECTOR & dds::sub::take ( SELECTOR &  selector)

Stream manipulator that indicates samples should be accessed by a 'take' operation.

Reading data can be done by the DataReader stream operator>>. The default of that operator is to read samples (not to take them). However, it is possible to manipulate if the samples are read or taken.

By adding this manipulator in the stream operator>>, it is explicitly indicated that the samples will be taken and not read. For example:

// Read all samples implicitly
reader >> samples;
// Take all samples explicitly
reader >> dds::sub::take >> samples;

Adding a manipulater operation in the stream operator>>, will create and use a dds::sub::DataReader::ManipulatorSelector implicitly.

See also
DataReader stream operator>>

© 2009-2020 Twin Oaks Computing, Inc
Castle Rock, CO 80104
All rights reserved.