RTI Routing Service  Version 6.0.1
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
rti::routing::processor::TypedInput< Data, Info > Class Template Reference

Representation of an Input whose data representation is DataRep, whose info representation is InfoRep. More...

#include <Input.hpp>

Public Member Functions

const rti::routing::StreamInfostream_info () const
 Returns the StreamInfo associated with this object.
 
const std::string & name () const
 Returns the name of this output.
 
LoanedSamples< Data, Info > take ()
 Returns all the available samples in this object.
 
LoanedSamples< Data, Info > read ()
 Same as take() but this calls rti::routing::adapter::StreamReader::read instead.
 
Selector select ()
 Gets a Selector to perform complex data selections, such as per-instance selection, content and status filtering.
 
bool active ()
 Indicates whether this input has received new data since the last time any variant of the read operations was called.
 
Data create_data ()
 Creates a new data sample from this input.
 
dds::sub::DataReader< Data > dds_data_reader ()
 Returns the underlying DDS DataReader that is part of this StreamReader implementation, assuming this input holds a DDS StreamReader.
 

Friends

class rti::routing::processor::Selector< Data, Info >
 
class rti::routing::processor::Route
 

Detailed Description

template<typename Data, typename Info>
class rti::routing::processor::TypedInput< Data, Info >

Representation of an Input whose data representation is DataRep, whose info representation is InfoRep.

Member Function Documentation

template<typename Data , typename Info >
const rti::routing::StreamInfo & TypedInput< Data, Info >::stream_info ( ) const

Returns the StreamInfo associated with this object.

The associated StreamInfo represents an equivalent object to the one used to create the underlying rti::routing::adapter::StreamReader.

template<typename Data , typename Info >
const std::string & TypedInput< Data, Info >::name ( ) const

Returns the name of this output.

The name is given by the name of the corresponding XML configuration tag.

template<typename Data , typename Info >
LoanedSamples< Data, Info > TypedInput< Data, Info >::take ( )

Returns all the available samples in this object.

This operation will call rti::routing::adapter::StreamReader::take on the underlying rti::routing::adapter::StreamReader.

The returned samples are interpreted to contain data represented as Data and info represented as Info.

See Also
LoanedSamples
rti::routing::adapter::StreamReader::take
template<typename Data , typename Info >
LoanedSamples< Data, Info > TypedInput< Data, Info >::read ( )
template<typename Data , typename Info >
rti::routing::processor::Selector< Data, Info > TypedInput< Data, Info >::select ( )

Gets a Selector to perform complex data selections, such as per-instance selection, content and status filtering.

The selector can be used as follows:

{.c++}
LoanedSamples<DynamicData> samples = input.select()
.instance(handle)
.content(query)
.state(state)
.take();

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 read() or take().

Returns
A Selector, typically used in-line to configure it and finally call Selector::read() or Selector::take().
See Also
Selector for the different parameters that can be set to configure which samples to read or take. Selecting what samples to read.
template<typename Data , typename Info >
bool TypedInput< Data, Info >::active ( )

Indicates whether this input has received new data since the last time any variant of the read operations was called.

Note
Given the time decoupling between the notification of new data and when it the data is read, it is possible this function may return true and yet there is no data to be returned.
Returns
True if this input has new data received since the last read access.
template<typename Data , typename Info >
Data TypedInput< Data, Info >::create_data ( )

Creates a new data sample from this input.

The data constructor called in this operation depends on the data representation kind of the TypeInfo associated with this input. If the type representation is a dynamic type, then it will assume the following constructor:

Data(const dds::core::xtypes::DynamicType&)

and will use the type code object downcasted from the value returned by TypeInfo::type_representation.

Otherwise:

Data()
Returns
A new data sample
template<typename Data, typename Info>
dds::sub::DataReader<Data> rti::routing::processor::TypedInput< Data, Info >::dds_data_reader ( )
inline

Returns the underlying DDS DataReader that is part of this StreamReader implementation, assuming this input holds a DDS StreamReader.

This operation will throw an exception if this input does not hold a DDS StreamReader.

Note
The access to the underlying DataReader is allowed only as long as this Input remains enabled. The object representing the DataReader must be invalidated before the input is disabled, otherwise the behavior is undefined.
Exceptions
std::exception
Returns
dds::sub::DataReader<Data>

RTI Routing Service Version 6.0.1 Copyright © Sun Nov 17 2019 Real-Time Innovations, Inc