Structure to handle simple Run Time Type Identification. More...
Public Member Functions | |
const char * | get_class_name (void) const noexcept |
Return the class name. | |
uint_t | is_in_list (const StaticRTTI *pInput) const noexcept |
Determine if a class is of a specific type. | |
Public Attributes | |
const char * | m_pClassName |
Pointer to the name of the class. | |
const StaticRTTI * | m_pParent |
Pointer to the parent in a derived class. | |
Structure to handle simple Run Time Type Identification.
This implements a method for handling run time type identification without any runtime overhead and a tiny amount of memory space in the form of a single extra pointer in the VTable and a single instance of piece of code returning a pointer.
The class itself does not contain any additional data to support this feature!!!
By using macros for calls, data tables and class hooks, a simple way to check if a base class is really a specific class is created.
|
inlinenoexcept |
Return the class name.
Return the name of the class, not the base class.
|
noexcept |
Determine if a class is of a specific type.
Walk the StaticRTTI linked list from the most derived type and up to the base class, all the while checking for a match.
pInput | Pointer to a StaticRTTI record to compare to this one |
const char* Burger::StaticRTTI::m_pClassName |
Pointer to the name of the class.
const StaticRTTI* Burger::StaticRTTI::m_pParent |
Pointer to the parent in a derived class.