SOFA API  83276a98
Open source framework for multi-physics simuation
sofa::core::BaseVecId Class Reference

#include <VecId.h>

Inheritance diagram for sofa::core::BaseVecId:

Detailed Description

This is a base class for TVecId that contains all the data stored.

Note
TVecId itself stores no data, in order to be able to convert between templates inplace with reinterpret_cast for performance reasons (typically when working with TMultiVecId instances, which would otherwise copy maps of TVecId). This is (a little) less efficient for non V_ALL versions, but is without comparison with the loss of performance with the typical operation of passing a stored "TMultiVecId<!V_ALL,V_WRITE>" to a method taking a "const TMultiVecId<V_ALL,V_READ>&".

Public Attributes

VecType type
 
unsigned int index
 

Public Member Functions

constexpr VecType getType () const
 
constexpr unsigned int getIndex () const
 

Protected Member Functions

constexpr BaseVecId (VecType t, unsigned int i)
 

Attribute details

◆ index

unsigned int sofa::core::BaseVecId::index

◆ type

VecType sofa::core::BaseVecId::type

Constructor details

◆ BaseVecId()

constexpr sofa::core::BaseVecId::BaseVecId ( VecType  t,
unsigned int  i 
)
inlineconstexprprotected

Function details

◆ getIndex()

constexpr unsigned int sofa::core::BaseVecId::getIndex ( ) const
inlineconstexpr

◆ getType()

constexpr VecType sofa::core::BaseVecId::getType ( ) const
inlineconstexpr