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

<<value-type>> Represents an IDL array type. More...

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

Inheritance diagram for dds::core::xtypes::ArrayType:
dds::core::xtypes::CollectionType dds::core::xtypes::DynamicType

Public Member Functions

 ArrayType (const dds::core::xtypes::DynamicType &type, uint32_t the_dimension)
 Creates an unidimensional array. More...
 
template<typename IntegerFwdIterator >
 ArrayType (const dds::core::xtypes::DynamicType &type, IntegerFwdIterator dimensions_begin, IntegerFwdIterator dimensions_end)
 Creates a multidimensional array. More...
 
 ArrayType (const dds::core::xtypes::DynamicType &type, std::initializer_list< uint32_t > dimensions)
 <<C++11>> Creates a multidimensional array More...
 
 ArrayType (dds::core::xtypes::DynamicType &&type, uint32_t the_dimension)
 <<C++11>> Creates an unidimensional array More...
 
template<typename IntegerFwdIterator >
 ArrayType (dds::core::xtypes::DynamicType &&type, IntegerFwdIterator dimensions_begin, IntegerFwdIterator dimensions_end)
 <<C++11>> Creates a multidimensional array More...
 
 ArrayType (dds::core::xtypes::DynamicType &&type, std::initializer_list< uint32_t > dimensions)
 <<C++11>> Creates a multidimensional array More...
 
uint32_t dimension_count () const
 Returns the number of dimensions. More...
 
uint32_t dimension (uint32_t dimension_index) const
 Returns the ith dimension. More...
 
uint32_t total_element_count () const
 Returns the sum of all the dimensions. More...
 
- Public Member Functions inherited from dds::core::xtypes::CollectionType
const dds::core::xtypes::DynamicTypecontent_type () const
 Gets the type of the elements of this collection. 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...
 

Additional Inherited Members

Detailed Description

<<value-type>> Represents an IDL array type.

Constructor & Destructor Documentation

◆ ArrayType() [1/6]

dds::core::xtypes::ArrayType::ArrayType ( const dds::core::xtypes::DynamicType type,
uint32_t  the_dimension 
)
inline

Creates an unidimensional array.

Parameters
typeThe element type
the_dimensionThe dimension of this unidimensional array

◆ ArrayType() [2/6]

template<typename IntegerFwdIterator >
dds::core::xtypes::ArrayType::ArrayType ( const dds::core::xtypes::DynamicType type,
IntegerFwdIterator  dimensions_begin,
IntegerFwdIterator  dimensions_end 
)
inline

Creates a multidimensional array.

For example, to create the following IDL array:

double x[10][20];

We can use this code:

std::vector<uint32_t> dim(2);
dim[0] = 10;
dim[1] = 20;
ArrayType my_array(primitive_type<double>(), dim.begin(), dim.end());
Parameters
typeThe element type
dimensions_beginThe beginning of range of dimensions (uint32_t)
dimensions_endThe end of a range of dimensions (uint32_t)

◆ ArrayType() [3/6]

dds::core::xtypes::ArrayType::ArrayType ( const dds::core::xtypes::DynamicType type,
std::initializer_list< uint32_t >  dimensions 
)
inline

<<C++11>> Creates a multidimensional array

For example, to create the following IDL array:

double x[10][20];

We can use this code:

ArrayType my_array(primitive_type<double>(), {10, 20});
Parameters
typeThe element type
dimensionsThe dimensions of this array

◆ ArrayType() [4/6]

dds::core::xtypes::ArrayType::ArrayType ( dds::core::xtypes::DynamicType &&  type,
uint32_t  the_dimension 
)
inline

<<C++11>> Creates an unidimensional array

Parameters
typeThe element type (to be moved)
the_dimensionThe dimension of this unidimensional array

◆ ArrayType() [5/6]

template<typename IntegerFwdIterator >
dds::core::xtypes::ArrayType::ArrayType ( dds::core::xtypes::DynamicType &&  type,
IntegerFwdIterator  dimensions_begin,
IntegerFwdIterator  dimensions_end 
)
inline

<<C++11>> Creates a multidimensional array

Parameters
typeThe element type (to be moved)
dimensions_beginThe beginning of range of dimensions (uint32_t)
dimensions_endThe end of a range of dimensions (uint32_t)

◆ ArrayType() [6/6]

dds::core::xtypes::ArrayType::ArrayType ( dds::core::xtypes::DynamicType &&  type,
std::initializer_list< uint32_t >  dimensions 
)
inline

<<C++11>> Creates a multidimensional array

Parameters
typeThe element type (to be moved)
dimensionsThe dimensions of this array

Member Function Documentation

◆ dimension_count()

uint32_t dds::core::xtypes::ArrayType::dimension_count ( ) const

Returns the number of dimensions.

◆ dimension()

uint32_t dds::core::xtypes::ArrayType::dimension ( uint32_t  dimension_index) const

Returns the ith dimension.

◆ total_element_count()

uint32_t dds::core::xtypes::ArrayType::total_element_count ( ) const

Returns the sum of all the dimensions.