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

#include <BaseClass.h>

Class hierarchy reflection base class. More...

Inheritance diagram for sofa::core::objectmodel::BaseClass:

Detailed Description

Class hierarchy reflection base class.

This class provides information on the class and parent classes of components. It is created by using the SOFA_CLASS macro on each new class declaration. All classes deriving from Base should use the SOFA_CLASS macro within their declaration.

Public Attributes

std::string namespaceName
 
std::string className
 
std::string templateName
 
std::string shortName
 
helper::vector< const BaseClass * > parents
 

Public Member Functions

bool hasParent (const BaseClass *c) const
 returns true iff c is a parent class of this More...
 
bool hasParent (const std::string &parentClassName) const
 returns true iff a parent class of this is named parentClassName More...
 
bool operator== (const BaseClass &c) const
 
bool operator!= (const BaseClass &c) const
 
virtual void * dynamicCast (Base *obj) const =0
 
virtual bool isInstance (Base *obj) const =0
 

Static Public Member Functions

static std::string decodeFullName (const std::type_info &t)
 Helper method to decode the type name. More...
 
static std::string decodeTypeName (const std::type_info &t)
 Helper method to decode the type name to a more readable form if possible. More...
 
static std::string decodeClassName (const std::type_info &t)
 Helper method to extract the class name (removing namespaces and templates) More...
 
static std::string decodeNamespaceName (const std::type_info &t)
 Helper method to extract the namespace (removing class name and templates) More...
 
static std::string decodeTemplateName (const std::type_info &t)
 Helper method to extract the template name (removing namespaces and class name) More...
 
template<class T >
static std::string defaultTypeName (const T *=nullptr)
 Helper method to get the type name. More...
 
template<class T >
static std::string defaultClassName (const T *=nullptr)
 Helper method to get the class name. More...
 
template<class T >
static std::string defaultNamespaceName (const T *=nullptr)
 Helper method to get the namespace name. More...
 
template<class T >
static std::string defaultTemplateName (const T *=nullptr)
 Helper method to get the template name. More...
 

Protected Member Functions

 BaseClass ()
 
virtual ~BaseClass ()
 

Attribute details

std::string sofa::core::objectmodel::BaseClass::className
std::string sofa::core::objectmodel::BaseClass::namespaceName
helper::vector<const BaseClass*> sofa::core::objectmodel::BaseClass::parents
std::string sofa::core::objectmodel::BaseClass::shortName
std::string sofa::core::objectmodel::BaseClass::templateName

Constructor details

sofa::core::objectmodel::BaseClass::BaseClass ( )
protected
sofa::core::objectmodel::BaseClass::~BaseClass ( )
protectedvirtual

Function details

std::string sofa::core::objectmodel::BaseClass::decodeClassName ( const std::type_info &  t)
static

Helper method to extract the class name (removing namespaces and templates)

Extract the class name (removing namespaces and templates)

std::string sofa::core::objectmodel::BaseClass::decodeFullName ( const std::type_info &  t)
static

Helper method to decode the type name.

Helper method to BaseClass::decode the type name.

std::string sofa::core::objectmodel::BaseClass::decodeNamespaceName ( const std::type_info &  t)
static

Helper method to extract the namespace (removing class name and templates)

Extract the namespace (removing class name and templates)

std::string sofa::core::objectmodel::BaseClass::decodeTemplateName ( const std::type_info &  t)
static

Helper method to extract the template name (removing namespaces and class name)

Decode the template name (removing namespaces and class name)

std::string sofa::core::objectmodel::BaseClass::decodeTypeName ( const std::type_info &  t)
static

Helper method to decode the type name to a more readable form if possible.

Decode the type's name to a more readable form if possible.

template<class T >
static std::string sofa::core::objectmodel::BaseClass::defaultClassName ( const T = nullptr)
inlinestatic

Helper method to get the class name.

template<class T >
static std::string sofa::core::objectmodel::BaseClass::defaultNamespaceName ( const T = nullptr)
inlinestatic

Helper method to get the namespace name.

template<class T >
static std::string sofa::core::objectmodel::BaseClass::defaultTemplateName ( const T = nullptr)
inlinestatic

Helper method to get the template name.

template<class T >
static std::string sofa::core::objectmodel::BaseClass::defaultTypeName ( const T = nullptr)
inlinestatic

Helper method to get the type name.

virtual void* sofa::core::objectmodel::BaseClass::dynamicCast ( Base obj) const
pure virtual
bool sofa::core::objectmodel::BaseClass::hasParent ( const BaseClass c) const
inline

returns true iff c is a parent class of this

bool sofa::core::objectmodel::BaseClass::hasParent ( const std::string &  parentClassName) const
inline

returns true iff a parent class of this is named parentClassName

virtual bool sofa::core::objectmodel::BaseClass::isInstance ( Base obj) const
pure virtual
bool sofa::core::objectmodel::BaseClass::operator!= ( const BaseClass c) const
inline
bool sofa::core::objectmodel::BaseClass::operator== ( const BaseClass c) const
inline