#include <DataTypeInfoDynamicWrapper.h>
wrap a DataTypeInfo type_traits in an AbstractTypeInfo More...
wrap a DataTypeInfo type_traits in an AbstractTypeInfo
Example of use:
Public Member Functions | |
const AbstractTypeInfo * | BaseType () const override |
const AbstractTypeInfo * | ValueType () const override |
const TypeInfoId & | getBaseTypeId () const override |
const TypeInfoId & | getValueTypeId () const override |
std::string | name () const override |
Returns the name of this type. More... | |
std::string | getTypeName () const override |
bool | ValidInfo () const override |
bool | FixedSize () const override |
bool | ZeroConstructor () const override |
True iff the default constructor of this type is equivalent to setting the memory to 0. More... | |
bool | SimpleCopy () const override |
True iff copying the data can be done with a memcpy(). More... | |
bool | SimpleLayout () const override |
bool | Integer () const override |
True iff this type uses integer values. More... | |
bool | Scalar () const override |
True iff this type uses scalar values. More... | |
bool | Text () const override |
True iff this type uses text values. More... | |
bool | CopyOnWrite () const override |
True iff this type uses copy-on-write. More... | |
bool | Container () const override |
sofa::Size | size () const override |
sofa::Size | byteSize () const override |
sofa::Size | size (const void *data) const override |
bool | setSize (void *data, sofa::Size size) const override |
Resize data to size elements, if relevant. More... | |
long long | getIntegerValue (const void *data, Index index) const override |
double | getScalarValue (const void *data, Index index) const override |
virtual std::string | getTextValue (const void *data, Index index) const override |
Get the value at index of data as a string. More... | |
void | setIntegerValue (void *data, Index index, long long value) const override |
Set the value at index of data from an integer value. More... | |
void | setScalarValue (void *data, Index index, double value) const override |
Set the value at index of data from a scalar value. More... | |
virtual void | setTextValue (void *data, Index index, const std::string &value) const override |
Set the value at index of data from a string value. More... | |
const void * | getValuePtr (const void *data) const override |
void * | getValuePtr (void *data) const override |
virtual const std::type_info * | type_info () const override |
Get the type_info for this type. More... | |
Public Member Functions inherited from sofa::defaulttype::AbstractTypeInfo | |
virtual | ~AbstractTypeInfo ()=default |
const std::string & | getCompilationTarget () const |
void | setCompilationTarget (const std::string &target) |
Static Public Member Functions | |
static AbstractTypeInfo * | get () |
Protected Member Functions | |
DataTypeInfoDynamicWrapper () | |
Protected Member Functions inherited from sofa::defaulttype::AbstractTypeInfo | |
AbstractTypeInfo () | |
|
inlineprotected |
|
inlineoverridevirtual |
If the type is a container, returns the TypeInfo for the type of the values inside this container. For example, if the type is fixed_array<fixed_array<int, 2> 3>
, it returns the TypeInfo for fixed_array<int, 2>
.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
The size in bytes of the ValueType For example, the size of a fixed_array<fixed_array<int, 2>, 3>` is 4 on most systems, as it is the byte size of the smallest dimension in the array (int -> 32bit)
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff this type is a container of some sort.
That is, if it can contain several values. In particular, strings are not considered containers.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff this type uses copy-on-write.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff this type has a fixed size. (It cannot be resized)
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlinestatic |
|
inlineoverridevirtual |
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Get the value at index of data as an integer. Relevant only if this type can be casted to long long
.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Get the value at index of data as a scalar. Relevant only if this type can be casted to double
.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Get the value at index of data as a string.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Get a read pointer to the underlying memory Relevant only if this type is SimpleLayout
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Get a write pointer to the underlying memory Relevant only if this type is SimpleLayout
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff this type uses integer values.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Returns the name of this type.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff this type uses scalar values.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Set the value at index of data from an integer value.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Set the value at index of data from a scalar value.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Resize data to size elements, if relevant.
But resizing is not always relevant, for example:
Returns true iff the data was resizable
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Set the value at index of data from a string value.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff copying the data can be done with a memcpy().
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff the layout in memory is simply N values of the same base type. It means that you can use the abstract index system to iterate over the elements of the type. (It doesn't mean that the BaseType is of a fixed size)
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
The size of this type, in number of elements. For example, the size of a fixed_array<fixed_array<int, 2>, 3>
is 6, and those six elements are conceptually numbered from 0 to 5. This is relevant only if FixedSize() is true. I FixedSize() is false, the return value will be equivalent to the one of byteSize()
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
The size of data, in number of iterable elements (For containers, that'll be the number of elements in the 1st dimension). For example, with type == `
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff this type uses text values.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Get the type_info for this type.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff the TypeInfo for this type contains valid information. A Type is considered "Valid" if there's at least one specialization of the ValueType
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
Returns the TypeInfo for the type of the values accessible by the get*Value() functions. For example, if the type is fixed_array<fixed_array<int, 2> 3>
, it returns the TypeInfo for int
.
Implements sofa::defaulttype::AbstractTypeInfo.
|
inlineoverridevirtual |
True iff the default constructor of this type is equivalent to setting the memory to 0.
Implements sofa::defaulttype::AbstractTypeInfo.