SOFA API  c4ac86de
Open source framework for multi-physics simuation
sofa::core::objectmodel::Base Class Reference

#include <Base.h>

Base class for everything. More...

Inheritance diagram for sofa::core::objectmodel::Base:

Detailed Description

Base class for everything.

This class contains all functionnality shared by every objects in SOFA. Most importantly it defines how to retrieve information about an object (name, type, data fields). All classes deriving from Base should use the SOFA_CLASS macro within their declaration (see BaseClass.h).

Public Attributes

helper::system::SofaOStream< helper::logging::Message::Warningserr
 
helper::system::SofaOStream< helper::logging::Message::Infosout
 
helper::system::SofaEndl< Basesendl
 runs the stream processing More...
 
Data< std::string > name
 Name of the object. More...
 
Data< boolf_printLog
 if true, emits extra messages at runtime. More...
 
Data< sofa::core::objectmodel::TagSetf_tags
 list of the subsets the objet belongs to More...
 
Data< sofa::defaulttype::BoundingBoxf_bbox
 this object bounding box More...
 
Data< ComponentStated_componentstate
 the object state More...
 
Data< ComponentState > & m_componentstate {d_componentstate}
 TODO bruno: uncomment once c++17 is enabled in SOFA. More...
 
std::string m_definitionSourceFileName {""}
 
int m_definitionSourceFilePos {-1}
 
std::string m_instanciationSourceFileName {""}
 
int m_instanciationSourceFilePos {-1}
 

Protected Attributes

VecData m_vecData
 List of fields (Data instances) More...
 
MapData m_aliasData
 name -> Data multi-map (includes names and aliases) More...
 
VecLink m_vecLink
 List of links. More...
 
MapLink m_aliasLink
 name -> Link multi-map (includes names and aliases) More...
 

Public Member Functions

virtual const BaseClassgetClass () const
 
const std::string & getName () const
 Accessor to the object name. More...
 
void setName (const std::string &n)
 Set the name of this object. More...
 
void setName (const std::string &n, int counter)
 Set the name of this object, adding an integer counter. More...
 
virtual std::string getTypeName () const
 Get the type name of this object (i.e. class and template types) More...
 
virtual std::string getClassName () const
 Get the class name of this object. More...
 
virtual std::string getTemplateName () const
 Get the template type names (if any) used to instantiate this object. More...
 
void setDefinitionSourceFileName (const std::string &sourceFileName)
 Set the source filename (where the component is implemented) More...
 
const std::string & getDefinitionSourceFileName () const
 Get the source filename (where the component is implemented) More...
 
void setDefinitionSourceFilePos (const int)
 Set the source location (where the component is implemented) More...
 
int getDefinitionSourceFilePos () const
 Get the source location (where the component is implemented) More...
 
void setInstanciationSourceFileName (const std::string &sourceFileName)
 
const std::string & getInstanciationSourceFileName () const
 
void setInstanciationSourceFilePos (const int)
 
int getInstanciationSourceFilePos () const
 
const std::string getWarnings () const
 
const std::string getOutputs () const
 use getLoggedMessageAsString() or getLoggedMessage instead. More...
 
void clearWarnings ()
 use getLoggedMessageAsString() or getLoggedMessage instead. More...
 
void clearOutputs ()
 use clearLoggedMessages() instead More...
 
void processStream (std::ostream &out)
 use clearLoggedMessages() instead More...
 
void addMessage (const sofa::helper::logging::Message &m) const
 
size_t countLoggedMessages (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
const std::deque< sofa::helper::logging::Message > & getLoggedMessages () const
 
const std::string getLoggedMessagesAsString (sofa::helper::logging::Message::TypeSet t=sofa::helper::logging::Message::AnyTypes) const
 
void clearLoggedMessages () const
 
bool notMuted () const
 
tags

Methods related to tagged subsets

const sofa::core::objectmodel::TagSetgetTags () const
 Represents the subsets the object belongs to. More...
 
bool hasTag (Tag t) const
 Return true if the object belong to the given subset. More...
 
void addTag (Tag t)
 Add a subset qualification to the object. More...
 
void removeTag (Tag t)
 Remove a subset qualification to the object. More...
 
componentstate

Methods related to component state

ComponentState getComponentState () const
 
bool isComponentStateValid () const
 

Static Public Member Functions

static const MyClassGetClass ()
 
template<class T >
static void dynamicCast (T *&ptr, Base *b)
 
template<class T >
static std::string typeName (const T *ptr=nullptr)
 
template<class T >
static std::string className (const T *ptr=nullptr)
 
template<class T >
static std::string namespaceName (const T *ptr=nullptr)
 
template<class T >
static std::string templateName (const T *ptr=nullptr)
 
template<class T >
static std::string shortName (const T *ptr=nullptr, BaseObjectDescription *=nullptr)
 

Protected Member Functions

 Base ()
 
virtual ~Base ()
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used by initData() More...
 
void initData0 (BaseData *field, BaseData::BaseInitData &res, const char *name, const char *help, BaseData::DataFlags dataFlags)
 Helper method used by initData() More...
 
template<class T >
void initData0 (Data< T > *field, typename Data< T >::InitData &res, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used by initData() More...
 

Friends

void intrusive_ptr_add_ref (Base *p)
 
void intrusive_ptr_release (Base *p)
 

fields

Data fields management

typedef helper::vector< BaseData * > VecData
 
typedef std::multimap< std::string, BaseData * > MapData
 
typedef helper::vector< BaseLink * > VecLink
 
typedef std::multimap< std::string, BaseLink * > MapLink
 
virtual bool parseField (const std::string &attribute, const std::string &value)
 Assign one field value (Data or Link) More...
 
virtual bool hasField (const std::string &attribute) const
 Check if a given Data field or Link exists. More...
 
virtual void parse (BaseObjectDescription *arg)
 Parse the given description to assign values to this object's fields and potentially other parameters. More...
 
void parseFields (const std::list< std::string > &str)
 Assign the field values stored in the given list of name + value pairs of strings. More...
 
virtual void parseFields (const std::map< std::string, std::string * > &str)
 Assign the field values stored in the given map of name -> value pairs. More...
 
void writeDatas (std::map< std::string, std::string * > &str)
 Write the current field values to the given map of name -> value pairs. More...
 
void writeDatas (std::ostream &out, const std::string &separator=" ")
 
BaseDatafindData (const std::string &name) const
 
std::vector< BaseData * > findGlobalField (const std::string &name) const
 Find data fields given a name: several can be found as we look into the alias map. More...
 
BaseLinkfindLink (const std::string &name) const
 
std::vector< BaseLink * > findLinks (const std::string &name) const
 Find link fields given a name: several can be found as we look into the alias map. More...
 
virtual void updateLinks (bool logErrors=true)
 Update pointers in case the pointed-to objects have appeared. More...
 
template<class T >
BaseData::BaseInitData initData (Data< T > *field, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used to initialize a data field containing a value of type T. More...
 
template<class T >
Data< T >::InitData initData (Data< T > *field, const T &value, const char *name, const char *help, bool isDisplayed=true, bool isReadOnly=false)
 Helper method used to initialize a data field containing a value of type T. More...
 
void addData (BaseData *f, const std::string &name)
 
void addData (BaseData *f)
 
void removeData (BaseData *f)
 Remove a data field. More...
 
void addAlias (BaseData *field, const char *alias)
 Add an alias to a Data. More...
 
void addLink (BaseLink *l)
 Add a link. More...
 
void removeLink (BaseLink *l)
 Remove a link. More...
 
void addAlias (BaseLink *link, const char *alias)
 Add an alias to a Link. More...
 
const VecDatagetDataFields () const
 Accessor to the vector containing all the fields of this object. More...
 
const MapDatagetDataAliases () const
 Accessor to the map containing all the aliases of this object. More...
 
const VecLinkgetLinks () const
 Accessor to the vector containing all the fields of this object. More...
 
const MapLinkgetLinkAliases () const
 Accessor to the map containing all the aliases of this object. More...
 
virtual bool findDataLinkDest (BaseData *&ptr, const std::string &path, const BaseLink *link)
 
virtual void * findLinkDestClass (const BaseClass *destType, const std::string &path, const BaseLink *link)
 
template<class T >
bool findLinkDest (T *&ptr, const std::string &path, const BaseLink *link)
 
virtual void copyAspect (int destAspect, int srcAspect)
 Copy the source aspect to the destination aspect for each Data in the component. More...
 
virtual void releaseAspect (int aspect)
 Release memory allocated for the specified aspect. More...
 

Attribute details

Data< ComponentState > sofa::core::objectmodel::Base::d_componentstate

the object state

Data< sofa::defaulttype::BoundingBox > sofa::core::objectmodel::Base::f_bbox

this object bounding box

Data<bool> sofa::core::objectmodel::Base::f_printLog

if true, emits extra messages at runtime.

Data< sofa::core::objectmodel::TagSet > sofa::core::objectmodel::Base::f_tags

list of the subsets the objet belongs to

MapData sofa::core::objectmodel::Base::m_aliasData
protected

name -> Data multi-map (includes names and aliases)

MapLink sofa::core::objectmodel::Base::m_aliasLink
protected

name -> Link multi-map (includes names and aliases)

Data< ComponentState >& sofa::core::objectmodel::Base::m_componentstate {d_componentstate}

TODO bruno: uncomment once c++17 is enabled in SOFA.

the object state

std::string sofa::core::objectmodel::Base::m_definitionSourceFileName {""}
int sofa::core::objectmodel::Base::m_definitionSourceFilePos {-1}
std::string sofa::core::objectmodel::Base::m_instanciationSourceFileName {""}
int sofa::core::objectmodel::Base::m_instanciationSourceFilePos {-1}
VecData sofa::core::objectmodel::Base::m_vecData
protected

List of fields (Data instances)

VecLink sofa::core::objectmodel::Base::m_vecLink
protected

List of links.

Data<std::string> sofa::core::objectmodel::Base::name

Name of the object.

helper::system::SofaEndl<Base> sofa::core::objectmodel::Base::sendl
mutable

runs the stream processing

helper::system::SofaOStream<helper::logging::Message::Warning> sofa::core::objectmodel::Base::serr
mutable

write into component buffer + Message processedby message handlers default message type = Warning

helper::system::SofaOStream<helper::logging::Message::Info> sofa::core::objectmodel::Base::sout
mutable

write into component buffer. Message is processed by message handlers only if printLog==true /// default message type = Info

Constructor details

Base::Base ( )
protected

Constructor cannot be called directly Use the New() method instead

Base::~Base ( )
protectedvirtual

Direct calls to destructor are forbidden. Smart pointers must be used to manage creation/destruction of objects

Function details

void Base::addAlias ( BaseData field,
const char *  alias 
)

Add an alias to a Data.

void Base::addAlias ( BaseLink link,
const char *  alias 
)

Add an alias to a Link.

void Base::addData ( BaseData f,
const std::string &  name 
)

Add a data field. Note that this method should only be called if the Data was not initialized with the initData method

Add a data field. Note that this method should only be called if the field was not initialized with the initData method

void Base::addData ( BaseData f)

Add a data field. Note that this method should only be called if the Data was not initialized with the initData method

Add a data field. Note that this method should only be called if the field was not initialized with the initData method

void Base::addLink ( BaseLink l)

Add a link.

Add a link. Note that this method should only be called if the link was not initialized with the initLink method

void Base::addMessage ( const sofa::helper::logging::Message m) const
void Base::addTag ( Tag  t)

Add a subset qualification to the object.

template<class T >
static std::string sofa::core::objectmodel::Base::className ( const T ptr = nullptr)
inlinestatic

Helper method to get the class name of a type derived from this class

This method should be used as follow :

T* ptr = nullptr; std::string type = T::className(ptr);

This way derived classes can redefine the className method

void Base::clearLoggedMessages ( ) const
void Base::clearOutputs ( )

use clearLoggedMessages() instead

void Base::clearWarnings ( )

use getLoggedMessageAsString() or getLoggedMessage instead.

void Base::copyAspect ( int  destAspect,
int  srcAspect 
)
virtual

Copy the source aspect to the destination aspect for each Data in the component.

Reimplemented in sofa::core::objectmodel::BaseObject.

template<class T >
static void sofa::core::objectmodel::Base::dynamicCast ( T *&  ptr,
Base b 
)
inlinestatic
BaseData * Base::findData ( const std::string &  name) const

Find a data field given its name. Return nullptr if not found. If more than one field is found (due to aliases), only the first is returned.

bool Base::findDataLinkDest ( BaseData *&  ptr,
const std::string &  path,
const BaseLink link 
)
virtual
std::vector< BaseData * > Base::findGlobalField ( const std::string &  name) const

Find data fields given a name: several can be found as we look into the alias map.

Find fields given a name: several can be found as we look into the alias map.

BaseLink * Base::findLink ( const std::string &  name) const

Find a link given its name. Return nullptr if not found. If more than one link is found (due to aliases), only the first is returned.

template<class T >
bool sofa::core::objectmodel::Base::findLinkDest ( T *&  ptr,
const std::string &  path,
const BaseLink link 
)
inline
void * Base::findLinkDestClass ( const BaseClass destType,
const std::string &  path,
const BaseLink link 
)
virtual
std::vector< BaseLink * > Base::findLinks ( const std::string &  name) const

Find link fields given a name: several can be found as we look into the alias map.

Find links given a name: several can be found as we look into the alias map.

static const MyClass* sofa::core::objectmodel::Base::GetClass ( )
inlinestatic
virtual const BaseClass* sofa::core::objectmodel::Base::getClass ( ) const
inlinevirtual
std::string Base::getClassName ( ) const
virtual

Get the class name of this object.

ComponentState sofa::core::objectmodel::Base::getComponentState ( ) const
inline
const MapData& sofa::core::objectmodel::Base::getDataAliases ( ) const
inline

Accessor to the map containing all the aliases of this object.

const VecData& sofa::core::objectmodel::Base::getDataFields ( ) const
inline

Accessor to the vector containing all the fields of this object.

const std::string & Base::getDefinitionSourceFileName ( ) const

Get the source filename (where the component is implemented)

int Base::getDefinitionSourceFilePos ( ) const

Get the source location (where the component is implemented)

const std::string & Base::getInstanciationSourceFileName ( ) const

Get the file where the instance has been created This is useful to store where the component was emitted from

int Base::getInstanciationSourceFilePos ( ) const

Get the file location (line number) where the instance has been created This is useful to store where the component was emitted from

const MapLink& sofa::core::objectmodel::Base::getLinkAliases ( ) const
inline

Accessor to the map containing all the aliases of this object.

const VecLink& sofa::core::objectmodel::Base::getLinks ( ) const
inline

Accessor to the vector containing all the fields of this object.

const std::deque< sofa::helper::logging::Message > & Base::getLoggedMessages ( ) const
const std::string Base::getLoggedMessagesAsString ( sofa::helper::logging::Message::TypeSet  t = sofa::helper::logging::Message::AnyTypes) const
const std::string& sofa::core::objectmodel::Base::getName ( ) const
inline

Accessor to the object name.

const std::string Base::getOutputs ( ) const

use getLoggedMessageAsString() or getLoggedMessage instead.

const sofa::core::objectmodel::TagSet& sofa::core::objectmodel::Base::getTags ( ) const
inline

Represents the subsets the object belongs to.

std::string Base::getTemplateName ( ) const
virtual

Get the template type names (if any) used to instantiate this object.

Reimplemented in sofa::component::visualmodel::VisualModelImpl, sofa::component::mass::DiagonalMass< DataTypes, TMassType >, sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::linearsolver::MatrixLinearSolver< Matrix, Vector, NoThreadManager >, sofa::core::Mapping< TIn, TOut >, sofa::core::Mapping< defaulttype::Vec3Types, DataTypes >, sofa::core::behavior::PairInteractionForceField< TDataTypes >, sofa::core::behavior::PairInteractionForceField< DataTypes >, sofa::core::Multi2Mapping< TIn1, TIn2, TOut >, sofa::core::Multi2Mapping< TIn, TInRoot, TOut >, sofa::component::collision::TriangleCollisionModel< TDataTypes >, sofa::core::behavior::ForceField< TDataTypes >, sofa::core::behavior::ForceField< _DataTypes >, sofa::core::behavior::ForceField< DataTypes >, sofa::core::MultiMapping< TIn, TOut >, sofa::component::engine::Distances< DataTypes >, sofa::core::behavior::MixedInteractionForceField< TDataTypes1, TDataTypes2 >, sofa::core::behavior::PairInteractionProjectiveConstraintSet< TDataTypes >, sofa::core::behavior::PairInteractionProjectiveConstraintSet< DataTypes >, sofa::component::collision::TOBBModel< TDataTypes >, sofa::component::collision::LineCollisionModel< TDataTypes >, sofa::core::behavior::ProjectiveConstraintSet< DataTypes >, sofa::core::behavior::ProjectiveConstraintSet< TDataTypes >, sofa::component::collision::CapsuleCollisionModel< sofa::defaulttype::StdRigidTypes< 3, MyReal > >, sofa::component::collision::SphereCollisionModel< TDataTypes >, sofa::component::collision::CapsuleCollisionModel< TDataTypes >, sofa::core::behavior::PairInteractionConstraint< TDataTypes >, sofa::core::behavior::PairInteractionConstraint< sofa::defaulttype::sofa::defaulttype::StdVectorTypes >, sofa::core::behavior::PairInteractionConstraint< DataTypes >, sofa::core::behavior::ConstraintCorrection< TDataTypes >, sofa::component::controller::MechanicalStateController< DataTypes >, sofa::core::State< TDataTypes >, sofa::core::State< sofa::defaulttype::Vec3Types >, sofa::core::State< In >, sofa::core::State< Out >, sofa::core::State< InRoot >, sofa::core::State< DataTypes >, sofa::component::collision::CylinderCollisionModel< TDataTypes >, sofa::core::behavior::MixedInteractionConstraint< TDataTypes1, TDataTypes2 >, sofa::component::collision::PointCollisionModel< TDataTypes >, sofa::component::misc::EvalPointsDistance< TDataTypes >, sofa::core::behavior::LMConstraint< DataTypes1, DataTypes2 >, sofa::core::behavior::LMConstraint< DataTypes, DataTypes >, sofa::component::engine::DisplacementMatrixEngine< DataTypes >, sofa::component::collision::MouseInteractor< DataTypes >, sofa::component::engine::TransformPosition< DataTypes >, sofa::component::controller::LCPForceFeedback< TDataTypes >, sofa::component::constraintset::DOFBlockerLMConstraint< DataTypes >, sofa::component::engine::BoxROI< DataTypes >, sofa::component::misc::DevAngleCollisionMonitor< TDataTypes >, sofa::component::engine::GenerateRigidMass< DataTypes, MassType >, sofa::component::engine::SphereROI< DataTypes >, sofa::component::engine::SubsetTopology< DataTypes >, sofa::component::engine::PlaneROI< DataTypes >, sofa::component::engine::ValuesFromPositions< DataTypes >, sofa::component::engine::MeshROI< DataTypes >, sofa::component::engine::PairBoxROI< DataTypes >, sofa::component::constraintset::DistanceLMConstraint< DataTypes >, sofa::component::engine::ClusteringEngine< DataTypes >, sofa::component::constraintset::FixedLMConstraint< DataTypes >, sofa::component::engine::ProximityROI< DataTypes >, sofa::component::constraintset::DistanceLMContactConstraint< DataTypes >, sofa::component::misc::BlenderExporter< T >, sofa::component::engine::NearestPointROI< DataTypes >, sofa::component::misc::DevTensionMonitor< TDataTypes >, sofa::component::engine::MeshSplittingEngine< DataTypes >, sofa::component::engine::ShapeMatching< DataTypes >, sofa::core::behavior::MechanicalState< TDataTypes >, sofa::core::behavior::MechanicalState< sofa::defaulttype::StdRigidTypes >, sofa::core::behavior::MechanicalState< defaulttype::sofa::defaulttype::StdVectorTypes >, sofa::core::behavior::MechanicalState< DataTypes2 >, sofa::core::behavior::MechanicalState< DataTypes1 >, sofa::core::behavior::MechanicalState< DataTypes >, sofa::component::engine::MeshSampler< DataTypes >, sofa::component::misc::DevMonitor< TDataTypes >, sofa::component::misc::DevMonitor< sofa::defaulttype::Vec3Types >, sofa::component::misc::DevMonitor< sofa::defaulttype::Vec1Types >, sofa::component::engine::PointsFromIndices< DataTypes >, sofa::component::misc::Monitor< DataTypes >, sofa::component::engine::MeshBarycentricMapperEngine< DataTypes >, sofa::component::engine::GenerateSphere< DataTypes >, sofa::component::engine::HausdorffDistance< DataTypes >, sofa::component::engine::MeshClosingEngine< DataTypes >, sofa::component::forcefield::HexahedronFEMForceFieldAndMass< DataTypes >, sofa::component::engine::DisplacementTransformEngine< DataTypes, OutputType >, sofa::component::engine::DisplacementTransformEngine< DataTypes, defaulttype::Mat4x4f >, sofa::component::engine::GenerateGrid< DataTypes >, sofa::component::engine::MeshSubsetEngine< DataTypes >, sofa::component::engine::AverageCoord< DataTypes >, sofa::component::engine::TextureInterpolation< DataTypes >, sofa::component::engine::ComplementaryROI< DataTypes >, sofa::component::engine::GroupFilterYoungModulus< DataTypes >, sofa::component::engine::SmoothMeshEngine< DataTypes >, sofa::component::engine::ValuesFromIndices< T >, sofa::component::engine::GenerateCylinder< DataTypes >, sofa::component::engine::IndicesFromValues< T >, sofa::component::engine::NormalsFromPoints< DataTypes >, sofa::component::engine::RandomPointDistributionInSurface< DataTypes >, sofa::component::engine::DilateEngine< DataTypes >, sofa::component::engine::ExtrudeQuadsAndGenerateHexas< DataTypes >, sofa::component::engine::MergeMeshes< DataTypes >, sofa::component::engine::QuatToRigidEngine< DataTypes >, sofa::component::engine::RigidToQuatEngine< DataTypes >, sofa::component::engine::ExtrudeSurface< DataTypes >, sofa::component::engine::MergeVectors< VecT >, sofa::component::engine::ProjectiveTransformEngine< DataTypes >, sofa::component::engine::ExtrudeEdgesAndGenerateQuads< DataTypes >, sofa::component::engine::MathOp< VecT >, sofa::component::engine::Spiral< DataTypes >, sofa::component::engine::TransformEngine< DataTypes >, sofa::component::engine::Vertex2Frame< DataTypes >, sofa::component::engine::MergePoints< DataTypes >, sofa::component::engine::MeshBoundaryROI, sofa::component::engine::ROIValueMapper, sofa::component::engine::SelectConnectedLabelsROI< _T >, sofa::component::engine::JoinPoints< DataTypes >, sofa::component::engine::Indices2ValuesMapper< DataTypes >, sofa::component::engine::DifferenceEngine< TDataType >, sofa::component::engine::SelectLabelROI< _T >, sofa::component::engine::IndexValueMapper< DataTypes >, sofa::component::engine::MergeROIs, sofa::component::engine::NormEngine< TDataType >, and sofa::component::engine::SumEngine< TDataType >.

std::string Base::getTypeName ( ) const
virtual

Get the type name of this object (i.e. class and template types)

const std::string Base::getWarnings ( ) const

DEPRECATED SECTION /////////////////////////////////////////////////// Everything below this point is deprecated and will be removed soon ! Do not use it anymore. For each function a replacement is suggested.

bool Base::hasField ( const std::string &  attribute) const
virtual

Check if a given Data field or Link exists.

bool Base::hasTag ( Tag  t) const

Return true if the object belong to the given subset.

template<class T >
BaseData::BaseInitData sofa::core::objectmodel::Base::initData ( Data< T > *  field,
const char *  name,
const char *  help,
bool  isDisplayed = true,
bool  isReadOnly = false 
)
inline

Helper method used to initialize a data field containing a value of type T.

template<class T >
Data<T>::InitData sofa::core::objectmodel::Base::initData ( Data< T > *  field,
const T value,
const char *  name,
const char *  help,
bool  isDisplayed = true,
bool  isReadOnly = false 
)
inline

Helper method used to initialize a data field containing a value of type T.

void Base::initData0 ( BaseData field,
BaseData::BaseInitData res,
const char *  name,
const char *  help,
bool  isDisplayed = true,
bool  isReadOnly = false 
)
protected

Helper method used by initData()

void Base::initData0 ( BaseData field,
BaseData::BaseInitData res,
const char *  name,
const char *  help,
BaseData::DataFlags  dataFlags 
)
protected

Helper method used by initData()

template<class T >
void sofa::core::objectmodel::Base::initData0 ( Data< T > *  field,
typename Data< T >::InitData &  res,
const T value,
const char *  name,
const char *  help,
bool  isDisplayed = true,
bool  isReadOnly = false 
)
inlineprotected

Helper method used by initData()

bool sofa::core::objectmodel::Base::isComponentStateValid ( ) const
inline
template<class T >
static std::string sofa::core::objectmodel::Base::namespaceName ( const T ptr = nullptr)
inlinestatic

Helper method to get the namespace name of a type derived from this class

This method should be used as follow :

T* ptr = nullptr; std::string type = T::namespaceName(ptr);

This way derived classes can redefine the namespaceName method

bool sofa::core::objectmodel::Base::notMuted ( ) const
inline
void Base::parse ( BaseObjectDescription arg)
virtual

Parse the given description to assign values to this object's fields and potentially other parameters.

Reimplemented in sofa::component::mass::DiagonalMass< DataTypes, TMassType >, sofa::component::mass::DiagonalMass< DataTypes, MassType >, sofa::component::visualmodel::MergeVisualModels, sofa::component::visualmodel::VisualModelImpl, sofa::component::topology::GridTopology, sofa::component::mass::UniformMass< DataTypes, TMassType >, sofa::component::mapping::RigidMapping< TIn, TOut >, sofa::component::forcefield::PlaneForceField< DataTypes >, sofa::component::visualmodel::OglShader, sofa::simulation::Node, sofa::component::odesolver::StaticSolver, sofa::component::forcefield::TriangularFEMForceFieldOptim< DataTypes >, sofa::component::visualmodel::OglModel, sofa::component::forcefield::ConstantForceField< DataTypes >, sofa::component::engine::MeshSplittingEngine< DataTypes >, sofa::component::topology::MeshTopology, sofa::component::forcefield::RestShapeSpringsForceField< DataTypes >, sofa::component::container::MechanicalObject< DataTypes >, sofa::core::objectmodel::BaseObject, sofa::component::engine::SelectConnectedLabelsROI< _T >, sofa::core::loader::MeshLoader, sofa::component::engine::ROIValueMapper, sofa::component::topology::RegularGridTopology, sofa::component::visualmodel::OglLabel, sofa::component::engine::MergeROIs, sofa::component::engine::ComplementaryROI< DataTypes >, sofa::component::misc::RequiredPlugin, sofa::component::engine::MergeMeshes< DataTypes >, sofa::component::engine::MergeVectors< VecT >, sofa::component::engine::MathOp< VecT >, sofa::component::misc::BaseAddResourceRepository, sofa::core::loader::SceneLoader, sofa::component::topology::CubeTopology, sofa::core::loader::BaseLoader, and sofa::component::animationloop::FreeMotionAnimationLoop.

bool Base::parseField ( const std::string &  attribute,
const std::string &  value 
)
virtual

Assign one field value (Data or Link)

void Base::parseFields ( const std::list< std::string > &  str)

Assign the field values stored in the given list of name + value pairs of strings.

void Base::processStream ( std::ostream &  out)

use clearLoggedMessages() instead

void Base::releaseAspect ( int  aspect)
virtual

Release memory allocated for the specified aspect.

Reimplemented in sofa::core::objectmodel::BaseObject.

void Base::removeData ( BaseData f)

Remove a data field.

void sofa::core::objectmodel::Base::removeLink ( BaseLink l)

Remove a link.

void Base::removeTag ( Tag  t)

Remove a subset qualification to the object.

void Base::setDefinitionSourceFileName ( const std::string &  sourceFileName)

Set the source filename (where the component is implemented)

void Base::setDefinitionSourceFilePos ( const int  linenum)

Set the source location (where the component is implemented)

void Base::setInstanciationSourceFileName ( const std::string &  filename)

Set the file where the instance has been created This is useful to store where the component was emitted from

void Base::setInstanciationSourceFilePos ( const int  lineco)

Set the file location (line number) where the instance has been created This is useful to store where the component was emitted from

void Base::setName ( const std::string &  n)

Set the name of this object.

void Base::setName ( const std::string &  n,
int  counter 
)

Set the name of this object, adding an integer counter.

template<class T >
static std::string sofa::core::objectmodel::Base::shortName ( const T ptr = nullptr,
BaseObjectDescription = nullptr 
)
inlinestatic

Helper method to get the shortname of a type derived from this class. The default implementation return the class name.

This method should be used as follow :

T* ptr = nullptr; std::string type = T::shortName(ptr);

This way derived classes can redefine the shortName method

template<class T >
static std::string sofa::core::objectmodel::Base::templateName ( const T ptr = nullptr)
inlinestatic

Helper method to get the template name of a type derived from this class

This method should be used as follow :

T* ptr = nullptr; std::string type = T::templateName(ptr);

This way derived classes can redefine the templateName method

template<class T >
static std::string sofa::core::objectmodel::Base::typeName ( const T ptr = nullptr)
inlinestatic

Helper method to get the type name of a type derived from this class

This method should be used as follow :

T* ptr = nullptr; std::string type = T::typeName(ptr);

This way derived classes can redefine the typeName method

void Base::updateLinks ( bool  logErrors = true)
virtual

Update pointers in case the pointed-to objects have appeared.

void Base::writeDatas ( std::map< std::string, std::string * > &  str)

Write the current field values to the given map of name -> value pairs.

void Base::writeDatas ( std::ostream &  out,
const std::string &  separator = " " 
)

Write the current field values to the given output stream separated with the given separator (" " used by default for XML)

Related details

void intrusive_ptr_add_ref ( Base p)
friend
void intrusive_ptr_release ( Base p)
friend