ug4
|
provides castings from derived classes to base classes More...
#include <class_name_provider.h>
Static Public Member Functions | |
template<typename TBase , typename TDerived > | |
static void | add_cast_func () |
add a cast function to the registry: Casts: Derived -> Base More... | |
static void * | cast_to_base_class (void *pDerivVoid, const ClassNameNode *&node, const std::string &baseName) |
cast a pointer to the desired base class More... | |
static const void * | cast_to_base_class (const void *pDerivVoid, const ClassNameNode *&node, const std::string &baseName) |
cast a pointer to the desired base class More... | |
template<typename T > | |
static T * | cast_to (void *pDerivVoid, const ClassNameNode *&node) |
casts a void pointer to a concrete class More... | |
template<typename T > | |
static const T * | cast_to (const void *pDerivVoid, const ClassNameNode *&node) |
cast a pointer to the desired base class More... | |
template<typename T > | |
static SmartPtr< T > | cast_to (SmartPtr< void > pDerivVoid, const ClassNameNode *&node) |
cast a pointer to the desired base class More... | |
template<typename T > | |
static ConstSmartPtr< T > | cast_to (ConstSmartPtr< void > pDerivVoid, const ClassNameNode *&node) |
cast a pointer to the desired base class More... | |
Protected Types | |
typedef void *(* | CastFunc) (void *) |
Static Protected Attributes | |
static std::map< std::pair< const ClassNameNode *, const ClassNameNode * >, CastFunc > | m_mmCast = std::map<std::pair<const ClassNameNode*, const ClassNameNode*>, void* (*)(void*)> () |
provides castings from derived classes to base classes
|
protected |
|
static |
|
static |
cast a pointer to the desired base class
This method casts a void pointer to a given derived class to the void pointer of a base class. If conversion fails, an exception of type UGError_ClassCastFailed is thrown.
[in] | pDerivVoid | void pointer to Derived object |
[in,out] | node | on entry: class name node corresponding to pDerivVoid on exit: class name node corresponding to baseName |
[in] | baseName | name of base class the pointer should be casted to |
|
static |
cast a pointer to the desired base class
This method casts a void pointer to a given derived class to the void pointer of a base class. If conversion fails, an exception of type UGError_ClassCastFailed is thrown.
[in] | pDerivVoid | void pointer to Derived object |
[in,out] | node | on entry: class name node corresponding to pDerivVoid on exit: class name node corresponding to baseName |
[in] | baseName | name of base class the pointer should be casted to |
|
static |
cast a pointer to the desired base class
This method casts a void pointer to a given derived class to the void pointer of a base class. If conversion fails, an exception of type UGError_ClassCastFailed is thrown.
[in] | pDerivVoid | void pointer to Derived object |
[in,out] | node | on entry: class name node corresponding to pDerivVoid on exit: class name node corresponding to baseName |
[in] | baseName | name of base class the pointer should be casted to |
|
static |
casts a void pointer to a concrete class
This method casts a void pointer to a given derived classed and returns it as a reinterpreted cast to the type specified by the template argument. If conversion fails, an exception of type UGError_ClassCastFailed is thrown.
[in] | pDerivVoid | void pointer to Derived object |
[in,out] | node | on entry: class name node corresponding to pDerivVoid on exit: class name node corresponding to baseName |
|
static |
cast a pointer to the desired base class
This method casts a void pointer to a given derived class to the void pointer of a base class. If conversion fails, an exception of type UGError_ClassCastFailed is thrown.
[in] | pDerivVoid | void pointer to Derived object |
[in,out] | node | on entry: class name node corresponding to pDerivVoid on exit: class name node corresponding to baseName |
[in] | baseName | name of base class the pointer should be casted to |
References ug::baseName(), and cast_to_base_class().
|
static |
cast a pointer to the desired base class
This method casts a void pointer to a given derived class to the void pointer of a base class. If conversion fails, an exception of type UGError_ClassCastFailed is thrown.
[in] | pDerivVoid | void pointer to Derived object |
[in,out] | node | on entry: class name node corresponding to pDerivVoid on exit: class name node corresponding to baseName |
[in] | baseName | name of base class the pointer should be casted to |
References ug::bridge::ClassNameNode::base_class(), ug::baseName(), ug::bridge::ClassNameTreeWay(), m_mmCast, ug::bridge::ClassNameNode::name(), and UG_ERR_LOG.
Referenced by cast_to_base_class(), and Java_edu_gcsc_vrl_ug_UG__1invokeMethod().
|
staticprotected |
Referenced by cast_to_base_class().