RTI Connext Modern C++ API  Version 5.3.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
dds::sub::DataReader< T >::ManipulatorSelector Class Reference

A Selector class enabling the streaming API. More...

#include <TDataReader.hpp>

Public Member Functions

ManipulatorSelectoroperator>> (dds::sub::LoanedSamples< T > &samples)
 Streaming operator taking a LoanedSamples object.
 
ManipulatorSelectoroperator>> (bool(*manipulator)(ReadModeDummyType))
 Streaming operator taking in a stream manipulator that will determine whether the samples will be read or taken.
 
template<typename Functor >
ManipulatorSelectoroperator>> (Functor f)
 Streaming operator taking in a Functor.
 

Detailed Description

template<typename T>
class dds::sub::DataReader< T >::ManipulatorSelector

A Selector class enabling the streaming API.

Similar to the Selector class, the ManipulatorSelector class is used by the DataReader to compose read and take operations using the streaming operator >>.

A ManipulatorSelector has an associated DataReader and configures the behavior of the read or take operation performed by that DataReader.

The ManipulatorSelector works by using a number of functions which configure the stream:

The above functions all return functors. You do not and should not use these functors directly:

  • dds::sub::functors::MaxSamplesManipulatorFunctor
  • dds::sub::functors::ContentFilterManipulatorFunctor
  • dds::sub::functors::ConditionManipulatorFunctor
  • dds::sub::functors::StateFilterManipulatorFunctor
  • dds::sub::functors::InstanceManipulatorFunctor
  • dds::sub::functors::NextInstanceManipulatorFunctor

For example, to perform a read of at most 5 unread samples:

LoanedSamples<Foo> samples;
reader >> read
>> max_samples(5)
>> samples;
See Also
Accessing Received Data

Member Function Documentation

template<typename T>
ManipulatorSelector& dds::sub::DataReader< T >::ManipulatorSelector::operator>> ( dds::sub::LoanedSamples< T > &  samples)
inline

Streaming operator taking a LoanedSamples object.

This operator allows you to direct the outcome of a string of stream operators into a LoanedSamples object.

Parameters
samplesThe LoanedSamples container to fill with the read/taken samples.
template<typename T>
ManipulatorSelector& dds::sub::DataReader< T >::ManipulatorSelector::operator>> ( bool(*)(ReadModeDummyType manipulator)
inline

Streaming operator taking in a stream manipulator that will determine whether the samples will be read or taken.

The provided manipulator for this operator will be either dds::sub::read or dds::sub::take.

Parameters
manipulatorEither dds::sub::read or dds::sub::take
See Also
dds::sub::read(dds::sub::ReadModeDummyType)
dds::sub::take(dds::sub::ReadModeDummyType)
template<typename T>
template<typename Functor >
ManipulatorSelector& dds::sub::DataReader< T >::ManipulatorSelector::operator>> ( Functor  f)
inline

RTI Connext Modern C++ API Version 5.3.0 Copyright © Sun Jun 25 2017 Real-Time Innovations, Inc