RTI Connext Modern C++ API Version 7.2.0
dds::core::xtypes::AbstractConstructedType< MemberType > Class Template Reference

The base class of types that have members and an extensibility kind. More...

#include <DynamicTypeImpl.hpp>

Inheritance diagram for dds::core::xtypes::AbstractConstructedType< MemberType >:
dds::core::xtypes::DynamicType

Public Types

typedef MemberType Member
 The member type (specified by the subclasses of this class) More...
 
typedef uint32_t MemberIndex
 The member index type. More...
 

Public Member Functions

dds::core::xtypes::ExtensibilityKind extensibility_kind () const
 Gets the extensibility kind. More...
 
size_t member_count () const
 Gets the number of members. More...
 
const MemberType & member (MemberIndex index) const
 Gets a member by its index. More...
 
const MemberType & member (const std::string &name) const
 Gets a member by its name. More...
 
MemberIndex find_member_by_name (const std::string &name) const
 Obtains the member index from its name. More...
 
std::vector< MemberType > members () const
 Gets a copy of all the members. More...
 
uint32_t cdr_serialized_sample_max_size (dds::core::policy::DataRepresentationId representation_id=DDS_AUTO_DATA_REPRESENTATION) const
 Gets the maximum serialized size of samples of this type. More...
 
uint32_t cdr_serialized_sample_min_size (dds::core::policy::DataRepresentationId representation_id=DDS_AUTO_DATA_REPRESENTATION) const
 Gets the minimum serialized size of samples of this type. More...
 
uint32_t cdr_serialized_sample_key_max_size (dds::core::policy::DataRepresentationId representation_id=DDS_AUTO_DATA_REPRESENTATION) const
 Gets the maximum serialized size of sample keys of this type. 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...
 

Static Public Attributes

static OMG_DDS_API_CLASS_VARIABLE const MemberIndex INVALID_INDEX
 Indicates that a member doesn't exist. More...
 

Additional Inherited Members

Detailed Description

template<typename MemberType>
class dds::core::xtypes::AbstractConstructedType< MemberType >

The base class of types that have members and an extensibility kind.

Template Parameters
MemberTypeThe concrete member type, specified by the subclasses, can be Member, UnionMember and EnumMember

This is the base class of StructType, UnionType and EnumType.

Member Typedef Documentation

◆ Member

template<typename MemberType >
typedef MemberType dds::core::xtypes::AbstractConstructedType< MemberType >::Member

The member type (specified by the subclasses of this class)

◆ MemberIndex

template<typename MemberType >
typedef uint32_t dds::core::xtypes::AbstractConstructedType< MemberType >::MemberIndex

The member index type.

Member Function Documentation

◆ extensibility_kind()

template<typename MemberType >
dds::core::xtypes::ExtensibilityKind dds::core::xtypes::AbstractConstructedType< MemberType >::extensibility_kind ( ) const

Gets the extensibility kind.

◆ member_count()

template<typename MemberType >
size_t dds::core::xtypes::AbstractConstructedType< MemberType >::member_count ( ) const

Gets the number of members.

◆ member() [1/2]

template<typename MemberType >
const MemberType & dds::core::xtypes::AbstractConstructedType< MemberType >::member ( MemberIndex  index) const

Gets a member by its index.

Parameters
indexThe index of the member (0 to member_count() - 1)

◆ member() [2/2]

template<typename MemberType >
const MemberType & dds::core::xtypes::AbstractConstructedType< MemberType >::member ( const std::string &  name) const

Gets a member by its name.

◆ find_member_by_name()

template<typename MemberType >
MemberIndex dds::core::xtypes::AbstractConstructedType< MemberType >::find_member_by_name ( const std::string &  name) const

Obtains the member index from its name.

This method is applicable to dds::core::xtypes::DynamicType objects representing structs (dds::core::xtypes::TypeKind_def::STRUCTURE_TYPE) and union (dds::core::xtypes::TypeKind_def::UNION_TYPE) types.

Parameters
name<<in>> The member name.
Returns
The index of the member of the given name or dds::core::xtypes::AbstractConstructedType::INVALID_INDEX if the member is not found.
MT Safety:
SAFE.

◆ members()

template<typename MemberType >
std::vector< MemberType > dds::core::xtypes::AbstractConstructedType< MemberType >::members ( ) const

Gets a copy of all the members.

◆ cdr_serialized_sample_max_size()

template<typename MemberType >
uint32_t dds::core::xtypes::AbstractConstructedType< MemberType >::cdr_serialized_sample_max_size ( dds::core::policy::DataRepresentationId  representation_id = DDS_AUTO_DATA_REPRESENTATION) const

Gets the maximum serialized size of samples of this type.

Obtains the maximum possible size in bytes of any serialized data sample of this type.

Precondition
The type is an aggregation type (struct, union)
Parameters
representation_idThe serialized data representation for which we calculate the maximum size.
Returns
The maximum size

◆ cdr_serialized_sample_min_size()

template<typename MemberType >
uint32_t dds::core::xtypes::AbstractConstructedType< MemberType >::cdr_serialized_sample_min_size ( dds::core::policy::DataRepresentationId  representation_id = DDS_AUTO_DATA_REPRESENTATION) const

Gets the minimum serialized size of samples of this type.

Obtains the minimum possible size in bytes of any serialized data sample of this type.

Precondition
The type is an aggregation type (struct, union)
Parameters
representation_idThe serialized data representation for which we calculate the minimum size.
Returns
The minimum size

◆ cdr_serialized_sample_key_max_size()

template<typename MemberType >
uint32_t dds::core::xtypes::AbstractConstructedType< MemberType >::cdr_serialized_sample_key_max_size ( dds::core::policy::DataRepresentationId  representation_id = DDS_AUTO_DATA_REPRESENTATION) const

Gets the maximum serialized size of sample keys of this type.

Obtains the maximum possible size in bytes of the serialized keys of any data sample of this type

Precondition
The type is an aggregation type (struct, union)
Parameters
representation_idThe serialized data representation for which we calculate the maximum key size.
Returns
The maximum key size

Member Data Documentation

◆ INVALID_INDEX

template<typename MemberType >
OMG_DDS_API_CLASS_VARIABLE const MemberIndex dds::core::xtypes::AbstractConstructedType< MemberType >::INVALID_INDEX
static

Indicates that a member doesn't exist.