SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::core::objectmodel::vectorData< T > Class Template Reference

#include <vectorData.h>

Inheritance diagram for sofa::core::objectmodel::vectorData< T >:

Detailed Description

template<class T>
class sofa::core::objectmodel::vectorData< T >

A helper class which implements a vector of a variable number of Data

When the owner component is a DataEngine, the Data can be automatically added as inputs or outputs

Warning
The first index is 1 in the Data name
Author
Thomas Lemaire
Date
2014

Protected Attributes

core::objectmodel::Basem_component
 
std::string m_name
 
std::string m_help
 
DataEngineDataType m_dataEngineDataType
 only valid if m_component is a DataEngine More...
 
m_defaultValue
 

Public Member Functions

 vectorData (core::objectmodel::Base *component, std::string const &name, std::string const &help, DataEngineDataType dataEngineDataType=DataEngineDataType::DataEngineNothing, const T &defaultValue=T())
 'dataEngineInOut' is only valid if 'component' is a DataEngine More...
 
 ~vectorData ()
 
void parseSizeData (sofa::core::objectmodel::BaseObjectDescription *arg, Data< unsigned int > &size)
 
void parseFieldsSizeData (const std::map< std::string, std::string * > &str, Data< unsigned int > &size)
 
void resize (const unsigned int count)
 
- Public Member Functions inherited from sofa::type::vector< core::objectmodel::Data< T > * >
 vector ()
 Basic constructor. More...
 
 vector (Size n, const core::objectmodel::Data< T > * &value)
 Constructor. More...
 
 vector (Size n)
 Constructor. More...
 
 vector (const std::vector< core::objectmodel::Data< T > *, Alloc > &x)
 Constructor. More...
 
 vector (const std::initializer_list< core::objectmodel::Data< T > * > &t)
 Brace initalizer constructor. More...
 
 vector (std::vector< core::objectmodel::Data< T > *, Alloc > &&v)
 Move constructor. More...
 
 vector (typename vector< core::objectmodel::Data< T > * >::const_iterator first, typename vector< core::objectmodel::Data< T > * >::const_iterator last)
 Constructor. More...
 
vectoroperator= (const std::vector< core::objectmodel::Data< T > *, Alloc > &x)
 Copy operator. More...
 
vectoroperator= (std::vector< core::objectmodel::Data< T > *, Alloc > &&v)
 Move assignment operator. More...
 
reference operator[] (Size n)
 Read/write random access. More...
 
const_reference operator[] (Size n) const
 Read-only random access. More...
 
std::ostream & write (std::ostream &os) const
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 Specialization for writing vectors of unsigned char. More...
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
SOFA_TYPE_API std::ostream & write (std::ostream &os) const
 
std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 Specialization for reading vectors of int and unsigned int using "A-B" notation for all integers between A and B. More...
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
SOFA_TYPE_API std::istream & read (std::istream &in)
 
void fill (const core::objectmodel::Data< T > * &value)
 Sets every element to 'value'. More...
 
void fastResize (Size n)
 

Static Public Member Functions

static void merge (Data< T > &outputData, const vectorData< T > &vectorData)
 merging several Data from a VectorData into a large Data (of the same type) More...
 

Attribute details

◆ m_component

template<class T >
core::objectmodel::Base* sofa::core::objectmodel::vectorData< T >::m_component
protected

◆ m_dataEngineDataType

template<class T >
DataEngineDataType sofa::core::objectmodel::vectorData< T >::m_dataEngineDataType
protected

only valid if m_component is a DataEngine

◆ m_defaultValue

template<class T >
T sofa::core::objectmodel::vectorData< T >::m_defaultValue
protected

◆ m_help

template<class T >
std::string sofa::core::objectmodel::vectorData< T >::m_help
protected

◆ m_name

template<class T >
std::string sofa::core::objectmodel::vectorData< T >::m_name
protected

Constructor details

◆ vectorData()

template<class T >
sofa::core::objectmodel::vectorData< T >::vectorData ( core::objectmodel::Base component,
std::string const &  name,
std::string const &  help,
DataEngineDataType  dataEngineDataType = DataEngineDataType::DataEngineNothing,
const T &  defaultValue = T() 
)
inline

'dataEngineInOut' is only valid if 'component' is a DataEngine

◆ ~vectorData()

template<class T >
sofa::core::objectmodel::vectorData< T >::~vectorData ( )
inline

Function details

◆ merge()

template<class T >
static void sofa::core::objectmodel::vectorData< T >::merge ( Data< T > &  outputData,
const vectorData< T > &  vectorData 
)
inlinestatic

merging several Data from a VectorData into a large Data (of the same type)

◆ parseFieldsSizeData()

template<class T >
void sofa::core::objectmodel::vectorData< T >::parseFieldsSizeData ( const std::map< std::string, std::string * > &  str,
Data< unsigned int > &  size 
)
inline

◆ parseSizeData()

template<class T >
void sofa::core::objectmodel::vectorData< T >::parseSizeData ( sofa::core::objectmodel::BaseObjectDescription arg,
Data< unsigned int > &  size 
)
inline

◆ resize()

template<class T >
void sofa::core::objectmodel::vectorData< T >::resize ( const unsigned int  count)
inline