RTI Routing Service  Version 6.0.0
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
rti::routing::adapter::StreamReader Class Referenceabstract

Provides a way to read samples of a specific type from a data domain. In the XML configuration file, StreamReaders are associated with the tag <input> within <route> and <auto_route>. More...

#include <StreamReader.hpp>

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

Public Member Functions

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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
virtual void delete_content_query (void *query_data)=0
 Deletes a content query created from this StreamReader.
 
virtual ~StreamReader ()
 Virtual destructor.
 
- Public Member Functions inherited from rti::routing::UpdatableEntity
virtual void update (const std::map< std::string, std::string > &properties)
 Updates a pluggable entity.
 
virtual ~UpdatableEntity ()
 Virtual destructor.
 

Detailed Description

Provides a way to read samples of a specific type from a data domain. In the XML configuration file, StreamReaders are associated with the tag <input> within <route> and <auto_route>.

Multi-threading safety:
Partially Safe All operations on a concrete StreamReader objects are safe and always serialized on a given Session. Operations on different StreamReader objects can be called concurrently if the StreamReader objects belong to different Sessions.

Constructor & Destructor Documentation

virtual rti::routing::adapter::StreamReader::~StreamReader ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

virtual void rti::routing::adapter::StreamReader::take ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
pure 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

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

virtual void rti::routing::adapter::StreamReader::read ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
pure 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

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

virtual void rti::routing::adapter::StreamReader::take ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq,
const SelectorState selector_state 
)
pure 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.

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

virtual void rti::routing::adapter::StreamReader::read ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq,
const SelectorState selector_state 
)
pure 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.

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

virtual void rti::routing::adapter::StreamReader::return_loan ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
pure 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

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

virtual void* rti::routing::adapter::StreamReader::create_content_query ( void *  old_query_data,
const dds::topic::Filter &  filter 
)
pure virtual

Creates a query object that selects the data with the specified filter.

This operation allows to read data with a SelectorState that contains a query object returned by this operation.

A query object type is implementation dependent and it's guaranteed to to be used only within the same StreamReader that created it. Because a query object may be a expensive resource, this operation allows to receive a previously created query for a potential reuse and update of its filter.

Parameters
[in]old_query_dataA previously created query object that that is provided for potential reuse and update of its filter.
[in]filterThe query content filter
Returns
The new or updated query object.
Exceptions
std::exception

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

virtual void rti::routing::adapter::StreamReader::delete_content_query ( void *  query_data)
pure virtual

Deletes a content query created from this StreamReader.

Parameters
[in]query_datathe query object to be deleted.

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


RTI Routing Service Version 6.0.0 Copyright © Sun Mar 3 2019 Real-Time Innovations, Inc