#include <DataTypeInfo.h>
Type traits class for objects stored in Data.
DataTypeInfo is part of the introspection/reflection capabilities of the Sofa scene graph API; it is used to manipulate Data values generically in template code, working transparently with different types of containers (vector, fixed_array, etc), and different types of values (integers, scalars (float, double), strings, etc). For example, it can be used to work with arrays without having to handle all the possible array classes used in Sofa: fixed or dynamic size, CPU or GPU, etc.
Iterate over the values of a DataType in templated code:
The getValue() and setValue() methods take an index as a parameter, with the following conventions:
Additional Inherited Members | |
Static Public Member Functions inherited from sofa::defaulttype::DefaultDataTypeInfo< TDataType > | |
static sofa::Size | size () |
static sofa::Size | byteSize () |
static sofa::Size | size (const DataType &) |
template<typename T > | |
static void | getValue (const DataType &, Index, T &) |
static bool | setSize (DataType &, sofa::Size) |
template<typename T > | |
static void | setValue (DataType &, Index, const T &) |
static void | getValueString (const DataType &, Index, std::string &) |
static void | setValueString (DataType &, Index, const std::string &) |
static const void * | getValuePtr (const DataType &) |
static void * | getValuePtr (DataType &) |
static const std::string | name () |
static const std::string | GetTypeName () |