SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::defaulttype::NoTypeInfo Class Reference

#include <NoTypeInfo.h>

Inheritance diagram for sofa::defaulttype::NoTypeInfo:

Public Member Functions

 NoTypeInfo ()
 
const AbstractTypeInfoBaseType () const override
 
const AbstractTypeInfoValueType () 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 *) const override
 
bool setSize (void *, sofa::Size) const override
 Resize data to size elements, if relevant. More...
 
long long getIntegerValue (const void *, Index) const override
 
double getScalarValue (const void *, Index) const override
 
std::string getTextValue (const void *, Index) const override
 Get the value at index of data as a string. More...
 
void setIntegerValue (void *, Index, long long) const override
 Set the value at index of data from an integer value. More...
 
void setScalarValue (void *, Index, double) const override
 Set the value at index of data from a scalar value. More...
 
void setTextValue (void *, Index, const std::string &) const override
 Set the value at index of data from a string value. More...
 
const void * getValuePtr (const void *) const override
 
void * getValuePtr (void *) const override
 
const std::type_info * type_info () const override
 Get the type_info for this type. More...
 
- Public Member Functions inherited from sofa::defaulttype::AbstractTypeInfo
const std::string & getCompilationTarget () const
 
void setCompilationTarget (const std::string &target)
 

Static Public Member Functions

static AbstractTypeInfoGet ()
 

Protected Member Functions

const TypeInfoIdgetBaseTypeId () const override
 
const TypeInfoIdgetValueTypeId () const override
 
- Protected Member Functions inherited from sofa::defaulttype::AbstractTypeInfo
 AbstractTypeInfo ()
 
virtual ~AbstractTypeInfo ()
 

Constructor details

◆ NoTypeInfo()

sofa::defaulttype::NoTypeInfo::NoTypeInfo ( )
inline

Function details

◆ BaseType()

const AbstractTypeInfo* sofa::defaulttype::NoTypeInfo::BaseType ( ) const
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.

◆ byteSize()

sofa::Size sofa::defaulttype::NoTypeInfo::byteSize ( ) const
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.

◆ Container()

bool sofa::defaulttype::NoTypeInfo::Container ( ) const
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.

◆ CopyOnWrite()

bool sofa::defaulttype::NoTypeInfo::CopyOnWrite ( ) const
inlineoverridevirtual

True iff this type uses copy-on-write.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ FixedSize()

bool sofa::defaulttype::NoTypeInfo::FixedSize ( ) const
inlineoverridevirtual

True iff this type has a fixed size. (It cannot be resized)

Implements sofa::defaulttype::AbstractTypeInfo.

◆ Get()

static AbstractTypeInfo* sofa::defaulttype::NoTypeInfo::Get ( )
inlinestatic

◆ getBaseTypeId()

const TypeInfoId& sofa::defaulttype::NoTypeInfo::getBaseTypeId ( ) const
inlineoverrideprotectedvirtual

◆ getIntegerValue()

long long sofa::defaulttype::NoTypeInfo::getIntegerValue ( const void *  ,
Index   
) const
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.

◆ getScalarValue()

double sofa::defaulttype::NoTypeInfo::getScalarValue ( const void *  ,
Index   
) const
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.

◆ getTextValue()

std::string sofa::defaulttype::NoTypeInfo::getTextValue ( const void *  ,
Index   
) const
inlineoverridevirtual

Get the value at index of data as a string.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ getTypeName()

std::string sofa::defaulttype::NoTypeInfo::getTypeName ( ) const
inlineoverridevirtual

◆ getValuePtr() [1/2]

const void* sofa::defaulttype::NoTypeInfo::getValuePtr ( const void *  ) const
inlineoverridevirtual

Get a read pointer to the underlying memory Relevant only if this type is SimpleLayout

Implements sofa::defaulttype::AbstractTypeInfo.

◆ getValuePtr() [2/2]

void* sofa::defaulttype::NoTypeInfo::getValuePtr ( void *  ) const
inlineoverridevirtual

Get a write pointer to the underlying memory Relevant only if this type is SimpleLayout

Implements sofa::defaulttype::AbstractTypeInfo.

◆ getValueTypeId()

const TypeInfoId& sofa::defaulttype::NoTypeInfo::getValueTypeId ( ) const
inlineoverrideprotectedvirtual

◆ Integer()

bool sofa::defaulttype::NoTypeInfo::Integer ( ) const
inlineoverridevirtual

True iff this type uses integer values.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ name()

std::string sofa::defaulttype::NoTypeInfo::name ( ) const
inlineoverridevirtual

Returns the name of this type.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ Scalar()

bool sofa::defaulttype::NoTypeInfo::Scalar ( ) const
inlineoverridevirtual

True iff this type uses scalar values.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ setIntegerValue()

void sofa::defaulttype::NoTypeInfo::setIntegerValue ( void *  ,
Index  ,
long long   
) const
inlineoverridevirtual

Set the value at index of data from an integer value.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ setScalarValue()

void sofa::defaulttype::NoTypeInfo::setScalarValue ( void *  ,
Index  ,
double   
) const
inlineoverridevirtual

Set the value at index of data from a scalar value.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ setSize()

bool sofa::defaulttype::NoTypeInfo::setSize ( void *  ,
sofa::Size   
) const
inlineoverridevirtual

Resize data to size elements, if relevant.

But resizing is not always relevant, for example:

  • nothing happens if FixedSize() is true;
  • sets can't be resized; they are cleared instead;
  • nothing happens for vectors containing resizable values (i.e. when BaseType()::FixedSize() is false), because of the "single index" abstraction;

Returns true iff the data was resizable

Implements sofa::defaulttype::AbstractTypeInfo.

◆ setTextValue()

void sofa::defaulttype::NoTypeInfo::setTextValue ( void *  ,
Index  ,
const std::string &   
) const
inlineoverridevirtual

Set the value at index of data from a string value.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ SimpleCopy()

bool sofa::defaulttype::NoTypeInfo::SimpleCopy ( ) const
inlineoverridevirtual

True iff copying the data can be done with a memcpy().

Implements sofa::defaulttype::AbstractTypeInfo.

◆ SimpleLayout()

bool sofa::defaulttype::NoTypeInfo::SimpleLayout ( ) const
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.

◆ size() [1/2]

sofa::Size sofa::defaulttype::NoTypeInfo::size ( ) const
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.

◆ size() [2/2]

sofa::Size sofa::defaulttype::NoTypeInfo::size ( const void *  ) const
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.

◆ Text()

bool sofa::defaulttype::NoTypeInfo::Text ( ) const
inlineoverridevirtual

True iff this type uses text values.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ type_info()

const std::type_info* sofa::defaulttype::NoTypeInfo::type_info ( ) const
inlineoverridevirtual

Get the type_info for this type.

Implements sofa::defaulttype::AbstractTypeInfo.

◆ ValidInfo()

bool sofa::defaulttype::NoTypeInfo::ValidInfo ( ) const
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.

◆ ValueType()

const AbstractTypeInfo* sofa::defaulttype::NoTypeInfo::ValueType ( ) const
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.

◆ ZeroConstructor()

bool sofa::defaulttype::NoTypeInfo::ZeroConstructor ( ) const
inlineoverridevirtual

True iff the default constructor of this type is equivalent to setting the memory to 0.

Implements sofa::defaulttype::AbstractTypeInfo.