RTI Connext Modern C++ API  Version 6.1.0
dds::core::xtypes::AliasType Class Reference

<<value-type>> Represents and IDL typedef More...

#include <dds/core/xtypes/AliasType.hpp>

Inheritance diagram for dds::core::xtypes::AliasType:
dds::core::xtypes::DynamicType

Public Member Functions

 AliasType (const std::string &name, const DynamicTypeImpl &related_type, bool is_pointer=false)
 Creates an alias with a name and a related type. More...
 
const dds::core::xtypes::DynamicTyperelated_type () const
 Gets the related type. More...
 
bool is_pointer () const
 <<extension>> Gets whether this alias makes related_type a pointer. More...
 
- Public Member Functions inherited from dds::core::xtypes::DynamicType
dds::core::xtypes::TypeKind kind () const
 Gets the type kind. More...
 
std::string name () const
 Gets the name. More...
 

Related Functions

(Note that these are not member functions.)

const dds::core::xtypes::DynamicTyperesolve_alias (const dds::core::xtypes::DynamicType &type)
 <<extension>> If the type is an alias returns its related type recursively until it is not an alias. More...
 

Detailed Description

<<value-type>> Represents and IDL typedef

Constructor & Destructor Documentation

◆ AliasType()

dds::core::xtypes::AliasType::AliasType ( const std::string &  name,
const DynamicTypeImpl &  related_type,
bool  is_pointer = false 
)

Creates an alias with a name and a related type.

Parameters
nameThe name of this alias
related_typeThe aliased type
is_pointerWhether this alias makes the type a pointer

For example, to create the following two IDL aliases:

typedef long my_long;
typedef long * my_long_ptr;

We can use the following code:

AliasType my_long("my_long", primitive_type<int32_t>());
AliasType my_long_ptr("my_long_ptr", primitive_type<int32_t>(), true);

Member Function Documentation

◆ related_type()

const dds::core::xtypes::DynamicType& dds::core::xtypes::AliasType::related_type ( ) const

Gets the related type.

◆ is_pointer()

bool dds::core::xtypes::AliasType::is_pointer ( ) const

<<extension>> Gets whether this alias makes related_type a pointer.

Friends And Related Function Documentation

◆ resolve_alias()

const dds::core::xtypes::DynamicType & resolve_alias ( const dds::core::xtypes::DynamicType type)
related

<<extension>> If the type is an alias returns its related type recursively until it is not an alias.