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

Provides a way to transform input samples into output samples of a different format and/or content. More...

#include <Transformation.hpp>

Inheritance diagram for rti::routing::transf::Transformation:
rti::routing::UpdatableEntity rti::routing::transf::TypedTransformation< Data, Info >

Public Member Functions

virtual void transform (std::vector< SamplePtr > &output_sample_seq, std::vector< InfoPtr > &output_info_seq, const std::vector< SamplePtr > &input_sample_seq, const std::vector< InfoPtr > &input_info_seq)=0
 Transforms a vector of input samples into a vector of output samples.
 
virtual void return_loan (std::vector< SamplePtr > &sample_seq, std::vector< InfoPtr > &info_seq)=0
 Returns a loan on the transformed data samples and info samples.
 
- 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 transform input samples into output samples of a different format and/or content.

Multi-threading safety:
Partially Safe All operations on a concrete Transformation object are safe and always serialized on a given Output. Operations on different Transformations objects may be called concurrently if they belong to different Outputs from different Routes.

Member Function Documentation

virtual void rti::routing::transf::Transformation::transform ( std::vector< SamplePtr > &  output_sample_seq,
std::vector< InfoPtr > &  output_info_seq,
const std::vector< SamplePtr > &  input_sample_seq,
const std::vector< InfoPtr > &  input_info_seq 
)
pure virtual

Transforms a vector of input samples into a vector of output samples.

When RTI Routing Service is done using the output samples, it will 'return the loan' to the transformation by calling Transformation::return_loan. It is guaranteed RTI Routing Service takes one outstanding loan at time.

The number of output samples can be different than the number of input samples.

The format associated with the input and output data samples and info samples depends on the format provided and consumed by the input's rti::routing::adapter::StreamReader and the output's rti::routing::adapter::StreamWriter.

For the built-in DDS adapter, the format of the samples is dds::core::xtypes::DynamicData and the format of the sample info is dds::sub::SampleInfo.

Parameters
output_sample_seq<<inout>> Vector that will hold the output data samples. RTI Routing Service provides this vector to the Transformation to fill. For each call, the size of the vector is zero.
output_info_seq<<inout>> Vector that will hold the input info samples. RTI Routing Service provides this vector to the Transformation to fill. For each call, the size of the vector is zero.
input_sample_seq<<in>> Vector of input data samples. This vector contains the list of samples that need to be transformed before calling rti::routing::adapter::StreamWriter::write.
input_info_seq<<in>> Vector of input info sample. This vector contains the list of samples that need to be transformed before calling rti::routing::adapter::StreamWriter::write.
Exceptions
std::exception

Implemented in rti::routing::transf::TypedTransformation< Data, Info >.

virtual void rti::routing::transf::Transformation::return_loan ( std::vector< SamplePtr > &  sample_seq,
std::vector< InfoPtr > &  info_seq 
)
pure virtual

Returns a loan on the transformed 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 Transformation::transform.

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

Implemented in rti::routing::transf::TypedTransformation< Data, Info >.


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