RTI Routing Service  Version 6.0.1
 All Data Structures Files Functions Typedefs Enumerations Enumerator Groups Pages
rti::routing::processor::Route Class Reference

Representation of the Route object that owns a Processor. More...

#include <Route.hpp>

Public Member Functions

int32_t input_count () const
 Returns the total number of inputs in this Route.
 
int32_t output_count () const
 Returns the total number of outputs in this Route.
 
Inputinput (int32_t index)
 Returns the Input object at the specified index.
 
Inputinput (const std::string &name)
 Returns the Input object with the specified name.
 
template<typename DataRep , typename InfoRep >
TypedInput< DataRep, InfoRep > input (int32_t index)
 Returns the TypedInput object at the specified index.
 
template<typename DataRep >
TypedInput< DataRep > input (int32_t index)
 Same as input<DataRep, InfoRep>(int32_t) with InfoRep = dds::sub::SampleInfo.
 
template<typename DataRep , typename InfoRep >
TypedInput< DataRep, InfoRep > input (const std::string &name)
 Same as input<DataRep, InfoRep>(int32_t) but using the configuration name of the input.
 
template<typename DataRep >
TypedInput< DataRep > input (const std::string &name)
 Same as input<DataRep, InfoRep>(std::string&) with InfoRep = dds::sub::SampleInfo.
 
Outputoutput (int32_t index)
 Returns the Output object at the specified index.
 
Outputoutput (const std::string &name)
 Returns the Output object with the specified name.
 
template<typename DataRep , typename InfoRep >
TypedOutput< DataRep, InfoRep > output (int32_t index)
 Returns the TypedOutput object at the specified index.
 
template<typename DataRep >
TypedOutput< DataRep > output (int32_t index)
 Same as output<DataRep, InfoRep>(int32_t) with InfoRep = dds::sub::SampleInfo.
 
template<typename DataRep , typename InfoRep >
TypedOutput< DataRep, InfoRep > output (const std::string &name)
 Same as output<DataRep, InfoRep>(int32_t) but using the configuration name of the output.
 
template<typename DataRep >
TypedOutput< DataRep > output (const std::string &name)
 Same as output<DataRep, InfoRep>(std::string&) with InfoRep = dds::sub::SampleInfo.
 
template<typename DataRep , typename InfoRep >
Inputs< DataRep, InfoRep > inputs ()
 Returns an accessor for the contained inputs.
 
template<typename DataRep >
Inputs< DataRep > inputs ()
 Same as Inputs<DataRep, InfoRep> inputs() with InfoRep = dds::sub::SampleInfo.
 
template<typename DataRep , typename InfoRep >
Outputs< DataRep, InfoRep > outputs ()
 Returns an accessor for the contained outputs.
 
template<typename DataRep >
Outputs< DataRep > outputs ()
 Same as Inputs<DataRep, InfoRep> outputs() with InfoRep = dds::sub::SampleInfo.
 
void period (const dds::core::Duration &period)
 Changes the event period of the Session.
 

Detailed Description

Representation of the Route object that owns a Processor.

This class provides an interface to access the capabilities of a Route, such as retrieving any of its inputs and outputs. Usage of this class is restricted within the Processor context where the object is passed.

An example of how to use this object is shown below. This example illustrates a simple use case of reading from all inputs and writing to all outputs, assuming that the sample data and info have the same representation and type.

{.c++}
using dds::core::xtypes::DynamicData;
using dds::sub::SampleInfo;
using namespace rti::routing::processor;
...
for (auto input : route.inputs<DynamicData>()) {
LoanedSamples<DynamicData> samples = input->read();
for (auto output : route.outputs<DynamicData>()) {
for(auto sample = samples) {
output.write(sample.data(), sample.info());
}
}
}

Member Function Documentation

int32_t rti::routing::processor::Route::input_count ( ) const
inline

Returns the total number of inputs in this Route.

int32_t rti::routing::processor::Route::output_count ( ) const
inline

Returns the total number of outputs in this Route.

Input& rti::routing::processor::Route::input ( int32_t  index)
inline

Returns the Input object at the specified index.

Input indexes are assigned in increasing creation order, starting at 0. The creation order is the same order than the inputs are defined within the Route configuration.

The returned object can be used to construct the appropriate TypedInput, which can be used for reading data.

Parameters
[in]indexThe index of the Input to be retrieved.
Returns
The Input at the specified index.
See Also
TypedInput

Referenced by input().

Input& rti::routing::processor::Route::input ( const std::string &  name)
inline

Returns the Input object with the specified name.

Parameters
[in]nameThe input configuration name
Returns
The object with the specified name or throws
See Also
TypedInput::name
Exceptions
std::logic_error
template<typename DataRep , typename InfoRep >
TypedInput<DataRep, InfoRep> rti::routing::processor::Route::input ( int32_t  index)
inline

Returns the TypedInput object at the specified index.

The returned object is typed so it can read samples whose type is DataRep for data, and InfoRep for info. These types must match the expected type representations of the underlying rti::routing::adapter::StreamReader.

Typically, these template arguments are typed dds::core::xtypes::DynamicData and dds::sub::SampleInfo, respectively.

Warning
This operation performs no type integrity check. It is responsibility of the caller to ensure the provided template arguments match with the expected types of the input. Otherwise behavior accessing the input is undefined.
Returns
The TypedInput object at the specified index.
See Also
input(int32_t)
TypedInput

References input().

template<typename DataRep >
TypedInput<DataRep> rti::routing::processor::Route::input ( int32_t  index)
inline

Same as input<DataRep, InfoRep>(int32_t) with InfoRep = dds::sub::SampleInfo.

template<typename DataRep , typename InfoRep >
TypedInput<DataRep, InfoRep> rti::routing::processor::Route::input ( const std::string &  name)
inline

Same as input<DataRep, InfoRep>(int32_t) but using the configuration name of the input.

References input().

template<typename DataRep >
TypedInput<DataRep> rti::routing::processor::Route::input ( const std::string &  name)
inline

Same as input<DataRep, InfoRep>(std::string&) with InfoRep = dds::sub::SampleInfo.

Output& rti::routing::processor::Route::output ( int32_t  index)
inline

Returns the Output object at the specified index.

Output indexes are assigned in increasing creation order, starting at 0. The creation order is the same order than the outputs are defined within the Route configuration.

The returned object can be used to construct the appropriate TypedOutput, which can be used for writing data.

Parameters
[in]indexThe index of the Output to be retrieved.
Returns
The Output at the specified index.
See Also
TypedOutput

Referenced by output().

Output& rti::routing::processor::Route::output ( const std::string &  name)
inline

Returns the Output object with the specified name.

Parameters
[in]nameThe output configuration name
Returns
The object with the specified name or throws
See Also
TypedOutput::name
Exceptions
std::logic_error
template<typename DataRep , typename InfoRep >
TypedOutput<DataRep, InfoRep> rti::routing::processor::Route::output ( int32_t  index)
inline

Returns the TypedOutput object at the specified index.

The returned object is typed so it can write samples whose type is DataRep for data, and InfoRep for info. These types must match the expected type representations of the underlying rti::routing::adapter::StreamWriter.

Typically, these template arguments are typed dds::core::xtypes::DynamicData and dds::sub::SampleInfo, respectively.

Warning
This operation performs no type integrity check. It is responsibility of the caller to ensure the provided template arguments match with the expected types of the output. Otherwise behavior accessing the output is undefined.
Returns
The TypedOutput object at the specified index.
See Also
input(int32_t)

References output().

template<typename DataRep >
TypedOutput<DataRep> rti::routing::processor::Route::output ( int32_t  index)
inline

Same as output<DataRep, InfoRep>(int32_t) with InfoRep = dds::sub::SampleInfo.

template<typename DataRep , typename InfoRep >
TypedOutput<DataRep, InfoRep> rti::routing::processor::Route::output ( const std::string &  name)
inline

Same as output<DataRep, InfoRep>(int32_t) but using the configuration name of the output.

References output().

template<typename DataRep >
TypedOutput<DataRep> rti::routing::processor::Route::output ( const std::string &  name)
inline

Same as output<DataRep, InfoRep>(std::string&) with InfoRep = dds::sub::SampleInfo.

template<typename DataRep , typename InfoRep >
Inputs<DataRep, InfoRep> rti::routing::processor::Route::inputs ( )
inline

Returns an accessor for the contained inputs.

The returned object that allows iterating over the contained inputs, treating them as TypedInput<DataRep, InfoRep>.

See Also
Inputs<DataRep, InfoRep>
TypedInput<DataRep, InfoRep> input(int32_t index)
template<typename DataRep >
Inputs<DataRep> rti::routing::processor::Route::inputs ( )
inline

Same as Inputs<DataRep, InfoRep> inputs() with InfoRep = dds::sub::SampleInfo.

template<typename DataRep , typename InfoRep >
Outputs<DataRep, InfoRep> rti::routing::processor::Route::outputs ( )
inline

Returns an accessor for the contained outputs.

The returned object that allows iterating over the contained outputs, treating them as TypedOutput<DataRep, InfoRep>.

See Also
Outputs<DataRep, InfoRep>
TypedOutput<DataRep, InfoRep> input(int32_t index)
template<typename DataRep >
Outputs<DataRep> rti::routing::processor::Route::outputs ( )
inline

Same as Inputs<DataRep, InfoRep> outputs() with InfoRep = dds::sub::SampleInfo.

void rti::routing::processor::Route::period ( const dds::core::Duration &  period)
inline

Changes the event period of the Session.

This operation can be called many times within the same periodic event, in which only the last call will have effect. If many Routes within a Session are calling this operation, then only the call made by the last Route will have effect.

The operation has no effect if the periodic event is not enabled in the session.

Parameters
[in]periodNew session period

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