BALL
1.4.79
|
Functions | |
template<typename T > | |
const T & | getDefault () |
template<typename T > | |
void * | getNew () |
template<typename T > | |
const char * | getName () |
template<typename T > | |
void * | getClassID () |
template<typename T > | |
const char * | getStreamName () |
template<typename T , typename U > | |
bool | isKindOf (const U &u) |
template<typename T , typename U > | |
T * | castTo (const U &u) |
template<typename T , typename U > | |
bool | isInstanceOf (const U &u) |
Simplified RunTime Type Identification. ANSI C++ provides support for runtime type identification (RTTI). However, the support is very basic. The template functions of the RTTI namespace provide a more readable support for RTTI. It defines predicates such as isKindOf that simplify tests on the hereditary relationship of different objects.
T* BALL::RTTI::castTo | ( | const U & | u | ) |
Cast an object to a specialized class. Example:
void* BALL::RTTI::getClassID | ( | ) |
const T& BALL::RTTI::getDefault | ( | ) |
Return a reference to a static default instance of the corresponding class. This method is basically intended to provide a default object for certain operations that require an instance of a certain class without really using this instance. It is mainly used inside the RTTI class.
const char* BALL::RTTI::getName | ( | ) |
void* BALL::RTTI::getNew | ( | ) |
Return a void pointer to a new instance of the class. Use this method to provide an easy factory for objects of a certain class. The main use of this function lies in object persistence. The PersistenceManager needs a function for the dynamic creation of objects.
const char* BALL::RTTI::getStreamName | ( | ) |
Return the demangled class name. The class name is demangled (as far as possible) and in the resulting string blanks are substituted by underscores, so the name can be read from a stream as one string. The typical usage is something like
bool BALL::RTTI::isInstanceOf | ( | const U & | u | ) |
bool BALL::RTTI::isKindOf | ( | const U & | u | ) |