libUTL++
utl::RunTimeClass Class Reference

Store information about a class. More...

#include <RunTimeClass.h>

Inheritance diagram for utl::RunTimeClass:

Public Member Functions

 RunTimeClass (const RunTimeClass *baseClass)
 Constructor. More...
 
 RunTimeClass (const RunTimeClass &runTimeClass)
 Copy constructor. More...
 
virtual Objectcreate () const
 Create a new instance of this class. More...
 
bool _isA (const RunTimeClass *rtc) const
 Determine whether thisClass.isA(givenClass). More...
 
const RunTimeClassbaseClass () const
 Get the base class. More...
 
const char * name () const
 Get the name. More...
 
virtual const char * vname () const
 Get the name. More...
 
virtual size_t size () const
 Get the size of this class (as in sizeof()). More...
 

Static Public Member Functions

static void printClassNames ()
 Print class names. More...
 
static void add (RunTimeClass *rtc)
 Add a class to the repository of known classes. More...
 
static const RunTimeClassfind (const char *className)
 Find the RunTimeClass by the given name. More...
 

Detailed Description

Store information about a class.

RunTimeClass is the basis of a very limited reflection capability in UTL++. For each utl::Object-derived class, there is an instance of a RunTimeClass-derived type.

Author
Adam McKee

Definition at line 23 of file RunTimeClass.h.

Constructor & Destructor Documentation

◆ RunTimeClass() [1/2]

utl::RunTimeClass::RunTimeClass ( const RunTimeClass baseClass)
inline

Constructor.

Parameters
baseClassbase class of this class

Definition at line 30 of file RunTimeClass.h.

◆ RunTimeClass() [2/2]

utl::RunTimeClass::RunTimeClass ( const RunTimeClass runTimeClass)
inline

Copy constructor.

Parameters
runTimeClassRunTimeClass to copy

Definition at line 40 of file RunTimeClass.h.

Member Function Documentation

◆ printClassNames()

static void utl::RunTimeClass::printClassNames ( )
static

Print class names.

◆ add()

static void utl::RunTimeClass::add ( RunTimeClass rtc)
static

Add a class to the repository of known classes.

Only a concrete class may be added or found. You should not need to call this method manually.

See also
RunTimeClass::find
Parameters
rtcRunTimeClass to add

◆ create()

virtual Object* utl::RunTimeClass::create ( ) const
inlinevirtual

Create a new instance of this class.

Returns
newly created instance of this class

Reimplemented in utl::TConcreteRunTimeClass< T >.

Definition at line 71 of file RunTimeClass.h.

References ABORT.

◆ find()

static const RunTimeClass* utl::RunTimeClass::find ( const char *  className)
static

Find the RunTimeClass by the given name.

Returns
found RunTimeClass (nullptr if none)
Parameters
classNamename of class to find

◆ _isA()

bool utl::RunTimeClass::_isA ( const RunTimeClass rtc) const

Determine whether thisClass.isA(givenClass).

Returns
true if this isA rtc, false otherwise
Parameters
rtcRunTimeClass to compare against

◆ baseClass()

const RunTimeClass* utl::RunTimeClass::baseClass ( ) const
inline

Get the base class.

Definition at line 93 of file RunTimeClass.h.

◆ name()

const char* utl::RunTimeClass::name ( ) const
inline

Get the name.

Definition at line 100 of file RunTimeClass.h.

◆ vname()

virtual const char* utl::RunTimeClass::vname ( ) const
inlinevirtual

Get the name.

Reimplemented in utl::TRunTimeClass< T >.

Definition at line 107 of file RunTimeClass.h.

References ABORT.

◆ size()

virtual size_t utl::RunTimeClass::size ( ) const
inlinevirtual

Get the size of this class (as in sizeof()).

Reimplemented in utl::TRunTimeClass< T >.

Definition at line 115 of file RunTimeClass.h.

References ABORT.


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