Nebula
Loading...
Searching...
No Matches
Core::Rtti Class Reference

#include <rtti.h>

Detailed Description

Nebula's runtime type information for one class.

Every class derived from Core::RefCounted should use the macros __DeclareClass and __ImplementClass to properly initialize the runtime type information for the class. This will also automatically register the class with the Core::Factory object to implement object construction from class name string or fourcc code.

Public Types

typedef void *(*) Creator()
 define a creation callback function prototype
 
typedef void *(*) ArrayCreator(SizeT)
 

Public Member Functions

 Rtti (const char *className, Util::FourCC fcc, Creator creatorFunc, ArrayCreator arrayCreatorFunc, const Core::Rtti *parentClass, SizeT instSize)
 constructor
 
 Rtti (const char *className, Creator creatorFunc, ArrayCreator arrayCreatorFunc, const Core::Rtti *parentClass, SizeT instSize)
 legacy constructor without FourCC for Mangalore compatibility
 
bool operator== (const Rtti &rhs) const
 equality operator
 
bool operator!= (const Rtti &rhs) const
 inequality operator
 
const Util::StringGetName () const
 get class name
 
Util::FourCC GetFourCC () const
 get four character code of class
 
const Core::RttiGetParent () const
 get pointer to parent class
 
SizeT GetInstanceSize () const
 get instance size in bytes
 
void * Create () const
 create an object of this class
 
void * CreateArray (SizeT num) const
 create an array of objects of this class
 
bool IsDerivedFrom (const Rtti &other) const
 return true if this rtti is equal or derived from to other rtti
 
bool IsDerivedFrom (const Util::String &otherClassName) const
 return true if this rtti is equal or derived from to other rtti, by string
 
bool IsDerivedFrom (const Util::FourCC &otherClassFourCC) const
 return true if this rtti is equal or derived from to other rtti, by fourcc
 
void * AllocInstanceMemory ()
 allocate instance memory block (called by class new operator)
 
void * AllocInstanceMemoryArray (size_t num)
 allocate instance memory array block (called by class new operator)
 
void FreeInstanceMemory (void *ptr)
 free instance memory block (called by class delete operator)
 

Private Member Functions

void Construct (const char *className, Util::FourCC fcc, Creator creatorFunc, ArrayCreator arrayCreatorFunc, const Core::Rtti *parentClass, SizeT instSize)
 constructor method, called from the various constructors
 

Private Attributes

Util::String name
 
const Core::Rttiparent
 
Util::FourCC fourCC
 
SizeT instanceSize
 
Creator creator
 
ArrayCreator arrayCreator
 

Member Typedef Documentation

◆ ArrayCreator

void *(*) Core::Rtti::ArrayCreator(SizeT)

◆ Creator

void *(*) Core::Rtti::Creator()

define a creation callback function prototype

Constructor & Destructor Documentation

◆ Rtti() [1/2]

Core::Rtti::Rtti ( const char * className,
Util::FourCC fcc,
Creator creatorFunc,
ArrayCreator arrayCreatorFunc,
const Core::Rtti * parentClass,
SizeT instSize )

constructor

◆ Rtti() [2/2]

Core::Rtti::Rtti ( const char * className,
Creator creatorFunc,
ArrayCreator arrayCreatorFunc,
const Core::Rtti * parentClass,
SizeT instSize )

legacy constructor without FourCC for Mangalore compatibility

Member Function Documentation

◆ AllocInstanceMemory()

void * Core::Rtti::AllocInstanceMemory ( )

allocate instance memory block (called by class new operator)

◆ AllocInstanceMemoryArray()

void * Core::Rtti::AllocInstanceMemoryArray ( size_t num)

allocate instance memory array block (called by class new operator)

◆ Construct()

void Core::Rtti::Construct ( const char * className,
Util::FourCC fcc,
Creator creatorFunc,
ArrayCreator arrayCreatorFunc,
const Core::Rtti * parentClass,
SizeT instSize )
private

constructor method, called from the various constructors

◆ Create()

void * Core::Rtti::Create ( ) const

create an object of this class

◆ CreateArray()

void * Core::Rtti::CreateArray ( SizeT num) const

create an array of objects of this class

◆ FreeInstanceMemory()

void Core::Rtti::FreeInstanceMemory ( void * ptr)

free instance memory block (called by class delete operator)

◆ GetFourCC()

Util::FourCC Core::Rtti::GetFourCC ( ) const
inline

get four character code of class

◆ GetInstanceSize()

SizeT Core::Rtti::GetInstanceSize ( ) const
inline

get instance size in bytes

◆ GetName()

const Util::String & Core::Rtti::GetName ( ) const
inline

get class name

◆ GetParent()

const Core::Rtti * Core::Rtti::GetParent ( ) const
inline

get pointer to parent class

◆ IsDerivedFrom() [1/3]

bool Core::Rtti::IsDerivedFrom ( const Rtti & other) const

return true if this rtti is equal or derived from to other rtti

◆ IsDerivedFrom() [2/3]

bool Core::Rtti::IsDerivedFrom ( const Util::FourCC & otherClassFourCC) const

return true if this rtti is equal or derived from to other rtti, by fourcc

◆ IsDerivedFrom() [3/3]

bool Core::Rtti::IsDerivedFrom ( const Util::String & otherClassName) const

return true if this rtti is equal or derived from to other rtti, by string

◆ operator!=()

bool Core::Rtti::operator!= ( const Rtti & rhs) const
inline

inequality operator

◆ operator==()

bool Core::Rtti::operator== ( const Rtti & rhs) const
inline

equality operator

Member Data Documentation

◆ arrayCreator

ArrayCreator Core::Rtti::arrayCreator
private

◆ creator

Creator Core::Rtti::creator
private

◆ fourCC

Util::FourCC Core::Rtti::fourCC
private

◆ instanceSize

SizeT Core::Rtti::instanceSize
private

◆ name

Util::String Core::Rtti::name
private

◆ parent

const Core::Rtti* Core::Rtti::parent
private

The documentation for this class was generated from the following files: