This class keeps type information (about an entity class that occurs in the game). More...
#include "TypeSys.hpp"
Public Types | |
typedef void *(* | CreateInstanceT )(const CreateParamsT &Params) |
Public Member Functions | |
TypeInfoT (TypeInfoManT &TIM, const char *ClassName_, const char *BaseClassName_, CreateInstanceT CreateInstance_, const luaL_Reg MethodsList_[], const char *DocClass_=NULL, const MethsDocT DocMethods_[]=NULL, const MethsDocT DocCallbacks_[]=NULL, const VarsDocT DocVars_[]=NULL) | |
The constructor. More... | |
void | Print (bool Recurse=true, unsigned long RecDepth=0) const |
Prints the contents of this node to the console. More... | |
bool | HierarchyHas (const TypeInfoT *Other) const |
Determines whether the other given type info is in the inheritance tree of this type (this method roughly corresponds to dynamic_cast<>() in C++). More... | |
const TypeInfoT * | GetNext () const |
Returns the next type info in the hierarchy. More... | |
Public Attributes | |
const char * | ClassName |
The name of this class. More... | |
const char * | BaseClassName |
The name of the base/super/parent class of this class. More... | |
CreateInstanceT | CreateInstance |
The call-back function that creates an instance of this class. More... | |
const luaL_Reg * | MethodsList |
The list (array) of Lua methods that this class implements. More... | |
const TypeInfoT * | Base |
The type info for the base class. More... | |
const TypeInfoT * | Sibling |
The type info for the next sibling class (a linked list). More... | |
const TypeInfoT * | Child |
The type info for the first child class. More... | |
unsigned long | TypeNr |
The unique and "robust" number of this type, obtained by enumerating the hierarchy nodes in depth-first order. More... | |
unsigned long | LastChildNr |
The highest TypeNr in the subhierarchy of this type. Depth-first enumeration guarantees that for all type numbers T in this subhierarchy, TypeNr<=T<=LastChildNr holds. More... | |
const char * | DocClass |
Documentation for this class. More... | |
const MethsDocT * | DocMethods |
Documentation for the Lua methods in MethodsList. More... | |
const MethsDocT * | DocCallbacks |
Documentation for any Lua methods that we call but expect users to provide implementations for. More... | |
const VarsDocT * | DocVars |
Documentation for the variables in this class. (Used in classes that have cf::TypeSys::VarT<> instances.) More... | |
This class keeps type information (about an entity class that occurs in the game).
(Supports single, but not multiple inheritance.)
TypeInfoT::TypeInfoT | ( | TypeInfoManT & | TIM, |
const char * | ClassName_, | ||
const char * | BaseClassName_, | ||
CreateInstanceT | CreateInstance_, | ||
const luaL_Reg | MethodsList_[], | ||
const char * | DocClass_ = NULL , |
||
const MethsDocT | DocMethods_[] = NULL , |
||
const MethsDocT | DocCallbacks_[] = NULL , |
||
const VarsDocT | DocVars_[] = NULL |
||
) |
The constructor.
This is supposed to be called only by the static TypeInfoT member of each entity class.
const TypeInfoT * TypeInfoT::GetNext | ( | ) | const |
Returns the next type info in the hierarchy.
bool TypeInfoT::HierarchyHas | ( | const TypeInfoT * | Other | ) | const |
Determines whether the other given type info is in the inheritance tree of this type (this method roughly corresponds to dynamic_cast<>() in C++).
void TypeInfoT::Print | ( | bool | Recurse = true , |
unsigned long | RecDepth = 0 |
||
) | const |
Prints the contents of this node to the console.
Recurse | Whether the children (derived classes) of this node should be printed. |
RecDepth | The current recursion depth. This is for the methods internal use - user code should never pass it. |
const TypeInfoT* cf::TypeSys::TypeInfoT::Base |
The type info for the base class.
const char* cf::TypeSys::TypeInfoT::BaseClassName |
The name of the base/super/parent class of this class.
const TypeInfoT* cf::TypeSys::TypeInfoT::Child |
The type info for the first child class.
const char* cf::TypeSys::TypeInfoT::ClassName |
The name of this class.
CreateInstanceT cf::TypeSys::TypeInfoT::CreateInstance |
The call-back function that creates an instance of this class.
const MethsDocT* cf::TypeSys::TypeInfoT::DocCallbacks |
Documentation for any Lua methods that we call but expect users to provide implementations for.
const char* cf::TypeSys::TypeInfoT::DocClass |
Documentation for this class.
const MethsDocT* cf::TypeSys::TypeInfoT::DocMethods |
Documentation for the Lua methods in MethodsList.
const VarsDocT* cf::TypeSys::TypeInfoT::DocVars |
Documentation for the variables in this class. (Used in classes that have cf::TypeSys::VarT<>
instances.)
unsigned long cf::TypeSys::TypeInfoT::LastChildNr |
The highest TypeNr in the subhierarchy of this type. Depth-first enumeration guarantees that for all type numbers T in this subhierarchy, TypeNr<=T<=LastChildNr holds.
const luaL_Reg* cf::TypeSys::TypeInfoT::MethodsList |
The list (array) of Lua methods that this class implements.
const TypeInfoT* cf::TypeSys::TypeInfoT::Sibling |
The type info for the next sibling class (a linked list).
unsigned long cf::TypeSys::TypeInfoT::TypeNr |
The unique and "robust" number of this type, obtained by enumerating the hierarchy nodes in depth-first order.