RTI Connext Modern C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
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.
 
template<typename IntegerFwdIterator >
 ArrayType (const dds::core::xtypes::DynamicType &type, IntegerFwdIterator dimensions_begin, IntegerFwdIterator dimensions_end)
 Creates a multidimensional array.
 
 ArrayType (const dds::core::xtypes::DynamicType &type, std::initializer_list< uint32_t > dimensions)
 <<C++11>> Creates a multidimensional array
 
 ArrayType (dds::core::xtypes::DynamicType &&type, uint32_t the_dimension)
 <<C++11>> Creates an unidimensional array
 
template<typename IntegerFwdIterator >
 ArrayType (dds::core::xtypes::DynamicType &&type, IntegerFwdIterator dimensions_begin, IntegerFwdIterator dimensions_end)
 <<C++11>> Creates a multidimensional array
 
 ArrayType (dds::core::xtypes::DynamicType &&type, std::initializer_list< uint32_t > dimensions)
 <<C++11>> Creates a multidimensional array
 
uint32_t dimension_count () const
 Returns the number of dimensions.
 
uint32_t dimension (uint32_t dimension_index) const
 Returns the ith dimension.
 
uint32_t total_element_count () const
 Returns the sum of all the dimensions.
 
- Public Member Functions inherited from dds::core::xtypes::CollectionType
const
dds::core::xtypes::DynamicType
content_type () const
 Gets the type of the elements of this collection.
 
- Public Member Functions inherited from dds::core::xtypes::DynamicType
dds::core::xtypes::TypeKind kind () const
 Gets the type kind.
 
std::string name () const
 Gets the name.
 

Additional Inherited Members

Detailed Description

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

Constructor & Destructor Documentation

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
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)
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
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
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)
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

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

Returns the number of dimensions.

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

Returns the ith dimension.

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

Returns the sum of all the dimensions.


RTI Connext Modern C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc