RTI Routing Service  Version 7.0.0
rti::routing::TypeInfo Class Reference

Definition of the type information associated with a RTI Routing Service stream. More...

#include <TypeInfo.hpp>

Inherits NativeValueType< TypeInfo >.

Public Types

typedef RTI_RoutingServiceTypeRepresentation TypeRepresentationType
 Type representation defined as an opaque pointer. More...
 

Public Member Functions

 TypeInfo (const std::string &the_type_name, TypeRepresentationKind the_type_representation_kind=TypeRepresentationKind::DYNAMIC_TYPE)
 Constructs a TypeInfo with the minimum required information. More...
 
std::string type_name () const
 Getter (see setter with the same name) More...
 
TypeInfotype_name (const std::string &the_type_name)
 Sets the registered name of the type associated with the data. More...
 
TypeRepresentationKind type_representation_kind () const
 Getter (see setter with the same name) More...
 
TypeInfotype_representation_kind (TypeRepresentationKind the_type_representation_kind)
 Sets the type representation kind. More...
 
TypeRepresentationType type_representation () const
 Getter (see setter with the same name) More...
 
TypeInfotype_representation (TypeRepresentationType the_type_representation)
 Sets the type representation value. More...
 
const dds::core::xtypes::DynamicType & dynamic_type () const
 Returns the type_representation as DynamicType object. More...
 
void dynamic_type (const dds::core::xtypes::DynamicType *dynamic_type)
 Sets the type representation value as DynamicType object. More...
 

Detailed Description

Definition of the type information associated with a RTI Routing Service stream.

See also
StreamInfo.

Member Typedef Documentation

◆ TypeRepresentationType

typedef RTI_RoutingServiceTypeRepresentation rti::routing::TypeInfo::TypeRepresentationType

Type representation defined as an opaque pointer.

How this opaque is interpreted depends on the TypeRepresentationKind.

Constructor & Destructor Documentation

◆ TypeInfo()

rti::routing::TypeInfo::TypeInfo ( const std::string &  the_type_name,
TypeRepresentationKind  the_type_representation_kind = TypeRepresentationKind::DYNAMIC_TYPE 
)
inline

Constructs a TypeInfo with the minimum required information.

Parameters
the_type_name<<in>> Registered name of the type associated with the data.
the_type_representation_kind<<in>> Indicates the representation of the object that describes the type. Default: TypeRepresentationKind::DYNAMIC_TYPE.

Member Function Documentation

◆ type_name() [1/2]

std::string rti::routing::TypeInfo::type_name ( ) const
inline

Getter (see setter with the same name)

◆ type_name() [2/2]

TypeInfo& rti::routing::TypeInfo::type_name ( const std::string &  the_type_name)
inline

Sets the registered name of the type associated with the data.

RTI Routing Service uses the type name to provide the right type information to StreamReader and StreamWriter. Namely, a type match is performed by comparing this type name with the value specified in the tag <registered_type_name> within the <input> and <output> tags.

◆ type_representation_kind() [1/2]

TypeRepresentationKind rti::routing::TypeInfo::type_representation_kind ( ) const
inline

Getter (see setter with the same name)

Referenced by type_representation_kind().

◆ type_representation_kind() [2/2]

TypeInfo& rti::routing::TypeInfo::type_representation_kind ( TypeRepresentationKind  the_type_representation_kind)
inline

Sets the type representation kind.

This member indicates how to interpret the type representation.

See also
TypeRepresentationKind

References type_representation_kind().

◆ type_representation() [1/2]

TypeRepresentationType rti::routing::TypeInfo::type_representation ( ) const
inline

Getter (see setter with the same name)

Referenced by type_representation().

◆ type_representation() [2/2]

TypeInfo& rti::routing::TypeInfo::type_representation ( TypeRepresentationType  the_type_representation)
inline

Sets the type representation value.

This member is defined as an opaque pointer that can hold any type representation. How to interpret this pointer is determined by the TypeRepresentationKind, which shall be consistent with the object set in this member.

References type_representation().

◆ dynamic_type() [1/2]

const dds::core::xtypes::DynamicType& rti::routing::TypeInfo::dynamic_type ( ) const
inline

Returns the type_representation as DynamicType object.

The operation throws if type_representation_kind is not DYNAMIC_TYPE

◆ dynamic_type() [2/2]

void rti::routing::TypeInfo::dynamic_type ( const dds::core::xtypes::DynamicType *  dynamic_type)
inline

Sets the type representation value as DynamicType object.

The provided DynamicType pointer must point to an object that remains valid until the StreamInfo object is destroyed.

See also
type_representation(TypeRepresentationType the_type_representation)