RTI Routing Service Version 7.1.0
rti::routing::adapter::TStreamReader< Data, Info > Class Template Referenceabstract

A wrapper implementation of a StreamReader that provides a strongly-typed interface through template parameters for data and info representation. More...

#include <StreamReader.hpp>

Inheritance diagram for rti::routing::adapter::TStreamReader< Data, Info >:
rti::routing::adapter::StreamReader rti::routing::UpdatableEntity rti::routing::adapter::NoOpStreamReader< Data, Info >

Public Types

typedef Data DataRep
 The data type. More...
 
typedef Info InfoRep
 The info type. More...
 

Public Member Functions

void take (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq) RTI_FINAL
 Performs the conversion between the vector of data and info pointers to strongly-type pointers. More...
 
void read (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq) RTI_FINAL
 Performs the conversion between the vector of data and info pointers to strongly-type pointers. More...
 
void take (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq, const SelectorState &selector_state) RTI_FINAL
 Performs the conversion between the vector of data and info pointers to strongly-type pointers. More...
 
void read (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq, const SelectorState &selector_state) RTI_FINAL
 Performs the conversion between the vector of data and info pointers to strongly-type pointers. More...
 
void return_loan (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq) RTI_FINAL
 Performs the conversion between the vector of data and info pointers to strongly-type pointers. More...
 
virtual void take (std::vector< Data * > &sample_seq, std::vector< Info * > &info_seq)=0
 Interface redefinition. More...
 
virtual void read (std::vector< Data * > &sample_seq, std::vector< Info * > &info_seq)=0
 Interface redefinition. More...
 
virtual void take (std::vector< Data * > &sample_seq, std::vector< Info * > &info_seq, const SelectorState &selector_state)=0
 Interface redefinition. More...
 
virtual void read (std::vector< Data * > &sample_seq, std::vector< Info * > &info_seq, const SelectorState &selector_state)=0
 Interface redefinition. More...
 
virtual void return_loan (std::vector< Data * > &sample_seq, std::vector< Info * > &info_seq)=0
 Interface redefinition. More...
 
virtual void take (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Takes a collection of all data samples and info samples available from an input stream. More...
 
virtual void take (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq, const SelectorState &selector_state)=0
 Variation of StreamReader::take where the returned samples shall represent the subset specified by the SelectorState. More...
 
virtual void read (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Variation of StreamReader::take where the returned samples will remain in the StreamReader's cache, so they can be read again by subsequence StreamReader::take or StreamReader::read operations. More...
 
virtual void read (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq, const SelectorState &selector_state)=0
 Variation of StreamReader::read where the returned samples shall represent the subset specified by the SelectorState. More...
 
virtual void return_loan (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Returns a loan on the read or taken data samples and info samples. More...
 
- Public Member Functions inherited from rti::routing::adapter::StreamReader
virtual void take (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Takes a collection of all data samples and info samples available from an input stream. More...
 
virtual void read (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Variation of StreamReader::take where the returned samples will remain in the StreamReader's cache, so they can be read again by subsequence StreamReader::take or StreamReader::read operations. More...
 
virtual void take (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq, const SelectorState &selector_state)=0
 Variation of StreamReader::take where the returned samples shall represent the subset specified by the SelectorState. More...
 
virtual void read (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq, const SelectorState &selector_state)=0
 Variation of StreamReader::read where the returned samples shall represent the subset specified by the SelectorState. More...
 
virtual void return_loan (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Returns a loan on the read or taken data samples and info samples. More...
 
virtual void * create_content_query (void *old_query_data, const dds::topic::Filter &filter)=0
 Creates a query object that selects the data with the specified filter. More...
 
virtual void delete_content_query (void *query_data)=0
 Deletes a content query created from this StreamReader. More...
 
virtual ~StreamReader ()
 Virtual destructor. More...
 
- Public Member Functions inherited from rti::routing::UpdatableEntity
virtual void update (const std::map< std::string, std::string > &properties)
 Updates a pluggable entity. More...
 
virtual ~UpdatableEntity ()
 Virtual destructor. More...
 

Detailed Description

template<typename Data, typename Info>
class rti::routing::adapter::TStreamReader< Data, Info >

A wrapper implementation of a StreamReader that provides a strongly-typed interface through template parameters for data and info representation.

You can implement this interface as a convenience to manipulate the data and info representation without dealing with opaque pointers.

Member Typedef Documentation

◆ DataRep

template<typename Data , typename Info >
typedef Data rti::routing::adapter::TStreamReader< Data, Info >::DataRep

The data type.

◆ InfoRep

template<typename Data , typename Info >
typedef Info rti::routing::adapter::TStreamReader< Data, Info >::InfoRep

The info type.

Member Function Documentation

◆ take() [1/6]

template<typename Data , typename Info >
void rti::routing::adapter::TStreamReader< Data, Info >::take ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
inlinevirtual

Performs the conversion between the vector of data and info pointers to strongly-type pointers.

Implements rti::routing::adapter::StreamReader.

References rti::routing::adapter::TStreamReader< Data, Info >::take().

Referenced by rti::routing::adapter::TStreamReader< Data, Info >::take().

◆ read() [1/6]

template<typename Data , typename Info >
void rti::routing::adapter::TStreamReader< Data, Info >::read ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
inlinevirtual

Performs the conversion between the vector of data and info pointers to strongly-type pointers.

Implements rti::routing::adapter::StreamReader.

References rti::routing::adapter::TStreamReader< Data, Info >::read().

Referenced by rti::routing::adapter::TStreamReader< Data, Info >::read().

◆ take() [2/6]

template<typename Data , typename Info >
void rti::routing::adapter::TStreamReader< Data, Info >::take ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq,
const SelectorState selector_state 
)
inlinevirtual

Performs the conversion between the vector of data and info pointers to strongly-type pointers.

Implements rti::routing::adapter::StreamReader.

References rti::routing::adapter::TStreamReader< Data, Info >::take().

◆ read() [2/6]

template<typename Data , typename Info >
void rti::routing::adapter::TStreamReader< Data, Info >::read ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq,
const SelectorState selector_state 
)
inlinevirtual

Performs the conversion between the vector of data and info pointers to strongly-type pointers.

Implements rti::routing::adapter::StreamReader.

References rti::routing::adapter::TStreamReader< Data, Info >::read().

◆ return_loan() [1/3]

template<typename Data , typename Info >
void rti::routing::adapter::TStreamReader< Data, Info >::return_loan ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
inlinevirtual

Performs the conversion between the vector of data and info pointers to strongly-type pointers.

Implements rti::routing::adapter::StreamReader.

References rti::routing::adapter::TStreamReader< Data, Info >::return_loan().

Referenced by rti::routing::adapter::TStreamReader< Data, Info >::return_loan().

◆ take() [3/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::TStreamReader< Data, Info >::take ( std::vector< Data * > &  sample_seq,
std::vector< Info * > &  info_seq 
)
pure virtual

Interface redefinition.

See also
StreamReader::take

Implemented in rti::routing::adapter::NoOpStreamReader< Data, Info >.

◆ read() [3/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::TStreamReader< Data, Info >::read ( std::vector< Data * > &  sample_seq,
std::vector< Info * > &  info_seq 
)
pure virtual

Interface redefinition.

See also
StreamReader::read

Implemented in rti::routing::adapter::NoOpStreamReader< Data, Info >.

◆ take() [4/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::TStreamReader< Data, Info >::take ( std::vector< Data * > &  sample_seq,
std::vector< Info * > &  info_seq,
const SelectorState selector_state 
)
pure virtual

Interface redefinition.

See also
StreamReader::take(std::vector&, std::vector&,const SelectorState&);

Implemented in rti::routing::adapter::NoOpStreamReader< Data, Info >.

◆ read() [4/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::TStreamReader< Data, Info >::read ( std::vector< Data * > &  sample_seq,
std::vector< Info * > &  info_seq,
const SelectorState selector_state 
)
pure virtual

Interface redefinition.

See also
StreamReader::read(std::vector&, std::vector&,const SelectorState&);

Implemented in rti::routing::adapter::NoOpStreamReader< Data, Info >.

◆ return_loan() [2/3]

template<typename Data , typename Info >
virtual void rti::routing::adapter::TStreamReader< Data, Info >::return_loan ( std::vector< Data * > &  sample_seq,
std::vector< Info * > &  info_seq 
)
pure virtual

◆ take() [5/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::StreamReader::take ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
virtual

Takes a collection of all data samples and info samples available from an input stream.

When RTI Routing Service is done using the samples, it will 'return the loan' to the StreamReader by calling StreamReader::return_loan. Note that multiple calls to this operation can be made before returning the loans.

The samples provided with this operation are considered 'removed' from the StreamReader cache, and they shall no longer be returned by subsequent StreamReader::take or StreamReader::read operations.

This operation represents the minimum required behavior by RTI Routing Service in order to forward data.

Parameters
sample_seq<<inout>> Vector that will hold the output samples. RTI Routing Service provides this vector to the StreamReader to fill. For each call, the size of the vector is zero. The data representation associated with the samples will be given by the value of TypeInfo::data_representation_kind that is part of the StreamInfo object passed at StreamWriter creation time. Usually the data representation is dynamic type, which corresponds to dds::core::xtypes::DynamicData.
info_seq<<inout>> Vector that will hold the output info samples. RTI Routing Service provides this vector to the StreamReader to fill. For each call, the size of the vector is zero. The implementation may leave the vector untouched if it does not support the concept of sample info. The info representation is dependent of the StreamWriter implementation. Usually when data representation is dynamic type, the sample info is dds::sub::SampleInfo.
Exceptions
std::exception

Implements rti::routing::adapter::StreamReader.

◆ take() [6/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::StreamReader::take ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq,
const SelectorState selector_state 
)
virtual

Variation of StreamReader::take where the returned samples shall represent the subset specified by the SelectorState.

SelectorState is configured accordingly from the values set on rti::routing::processor::Selector. This operation will be called only by custom rti::routing::processor::Processor implementations.

Parameters
sample_seq
info_seq
selector_state<<in>> A description of the subset of samples that shall be returned.
See also
SelectorState.

Implements rti::routing::adapter::StreamReader.

◆ read() [5/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::StreamReader::read ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
virtual

Variation of StreamReader::take where the returned samples will remain in the StreamReader's cache, so they can be read again by subsequence StreamReader::take or StreamReader::read operations.

See also
StreamReader::take

Implements rti::routing::adapter::StreamReader.

◆ read() [6/6]

template<typename Data , typename Info >
virtual void rti::routing::adapter::StreamReader::read ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq,
const SelectorState selector_state 
)
virtual

Variation of StreamReader::read where the returned samples shall represent the subset specified by the SelectorState.

SelectorState is configured accordingly from the values set on rti::routing::processor::Selector. This operation will be called only by custom rti::routing::processor::Processor implementations.

Parameters
sample_seq
info_seq
selector_state<<in>> A description of the subset of samples that shall be returned.
See also
SelectorState.

Implements rti::routing::adapter::StreamReader.

◆ return_loan() [3/3]

template<typename Data , typename Info >
virtual void rti::routing::adapter::StreamReader::return_loan ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
virtual

Returns a loan on the read or taken data samples and info samples.

RTI Routing Service calls this method to indicate that it is done accessing the collection of data samples and info samples obtained by an earlier invocation of any variation of StreamReader::take.

Parameters
sample_seq<<in>> Vector of loaned data samples.
info_seq<<in>> Vector of loaned info samples.
Exceptions
std::exception

Implements rti::routing::adapter::StreamReader.