RTI Routing Service  Version 7.0.0
rti::routing::processor::TypedOutput< Data, Info > Class Template Reference

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

#include <Output.hpp>

Public Member Functions

const rti::routing::StreamInfostream_info () const
 Returns the StreamInfo associated with this object. More...
 
const std::string & name () const
 Returns the name of this output. More...
 
void write (const Data &sample, const Info &info)
 Writes the specified data and info sample in this output. More...
 
Data create_data ()
 Creates a new data sample that can be used to write in this output. More...
 
dds::pub::DataWriter< Data > dds_data_writer ()
 Returns the underlying DDS DataWriter that is part of this StreamWriter implementation, assuming this input holds a DDS StreamWriter. More...
 

Friends

class rti::routing::processor::Route
 

Detailed Description

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

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

Member Function Documentation

◆ stream_info()

template<typename Data , typename Info >
const rti::routing::StreamInfo & rti::routing::processor::TypedOutput< 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::StreamWriter.

◆ name()

template<typename Data , typename Info >
const std::string & rti::routing::processor::TypedOutput< Data, Info >::name ( ) const

Returns the name of this output.

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

◆ write()

template<typename Data , typename Info >
void rti::routing::processor::TypedOutput< Data, Info >::write ( const Data &  sample,
const Info &  info 
)

Writes the specified data and info sample in this output.

This operation will call rti::routing::adapter::StreamWriter::write on the underlying rti::routing::adapter::StreamWriter.

The provided sample is interpreted to contain data represented as Data and the info as Info.

See also
rti::routing::adapter::StreamWriter::write

◆ create_data()

template<typename Data , typename Info >
Data rti::routing::processor::TypedOutput< Data, Info >::create_data ( )

Creates a new data sample that can be used to write in this output.

The data constructor called in this operation depends on the data representation kind of the TypeInfo associated with this output. 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

◆ dds_data_writer()

template<typename Data, typename Info>
dds::pub::DataWriter<Data> rti::routing::processor::TypedOutput< Data, Info >::dds_data_writer ( )
inline

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

This operation will throw an exception if this output does not hold a DDS StreamWriter.

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