7 #ifndef CAFU_TYPESYS_TYPEINFO_HPP_INCLUDED
8 #define CAFU_TYPESYS_TYPEINFO_HPP_INCLUDED
10 #include "Templates/Array.hpp"
63 const char* ReturnType;
64 const char* Parameters;
89 typedef void* (*CreateInstanceT)(
const CreateParamsT& Params);
93 TypeInfoT(
TypeInfoManT& TIM,
const char* ClassName_,
const char* BaseClassName_, CreateInstanceT CreateInstance_,
const luaL_Reg MethodsList_[],
94 const char* DocClass_=NULL,
const MethsDocT DocMethods_[]=NULL,
const MethsDocT DocCallbacks_[]=NULL,
const VarsDocT DocVars_[]=NULL);
99 void Print(
bool Recurse=
true,
unsigned long RecDepth=0)
const;
106 const TypeInfoT*
GetNext()
const;
133 void operator = (
const TypeInfoT&);
195 virtual const cf::TypeSys::TypeInfoT* GetType() const { return &TypeInfo; } \
199 static void* CreateInstance(const cf::TypeSys::CreateParamsT& Params); \
202 static const cf::TypeSys::TypeInfoT TypeInfo; */
void Print(bool Recurse=true, unsigned long RecDepth=0) const
Prints the contents of this node to the console.
Definition: TypeSys.cpp:46
const TypeInfoT * Sibling
The type info for the next sibling class (a linked list).
Definition: TypeSys.hpp:115
const TypeInfoT * FindTypeInfoByName(const char *ClassName) const
Returns the type info matching the class name ClassName.
Definition: TypeSys.cpp:232
TypeInfoManT()
The constructor.
Definition: TypeSys.cpp:101
const TypeInfoT * GetNext() const
Returns the next type info in the hierarchy.
Definition: TypeSys.cpp:80
const ArrayT< const TypeInfoT * > & GetTypeInfosByName() const
Returns all type infos registered with this TypeInfoManT, ordered by name.
Definition: TypeSys.hpp:171
unsigned long LastChildNr
The highest TypeNr in the subhierarchy of this type. Depth-first enumeration guarantees that for all ...
Definition: TypeSys.hpp:118
const VarsDocT * DocVars
Documentation for the variables in this class. (Used in classes that have cf::TypeSys::VarT<> instanc...
Definition: TypeSys.hpp:127
const ArrayT< const TypeInfoT * > & GetTypeInfosByNr() const
Returns all type infos registered with this TypeInfoManT, ordered by type number. ...
Definition: TypeSys.hpp:175
const TypeInfoT * FindTypeInfoByNr(unsigned long TypeNr) const
Returns the type info matching the type number TypeNr.
Definition: TypeSys.cpp:260
This class manages the type infos.
Definition: TypeSys.hpp:145
const char * DocClass
Documentation for this class.
Definition: TypeSys.hpp:124
const TypeInfoT * Child
The type info for the first child class.
Definition: TypeSys.hpp:116
bool HierarchyHas(const TypeInfoT *Other) const
Determines whether the other given type info is in the inheritance tree of this type (this method rou...
Definition: TypeSys.cpp:68
CreateInstanceT CreateInstance
The call-back function that creates an instance of this class.
Definition: TypeSys.hpp:111
void Register(TypeInfoT *TI)
Registers the given TypeInfoT with this type info manager.
Definition: TypeSys.cpp:107
const MethsDocT * DocMethods
Documentation for the Lua methods in MethodsList.
Definition: TypeSys.hpp:125
unsigned long TypeNr
The unique and "robust" number of this type, obtained by enumerating the hierarchy nodes in depth-fir...
Definition: TypeSys.hpp:117
const luaL_Reg * MethodsList
The list (array) of Lua methods that this class implements.
Definition: TypeSys.hpp:112
const char * BaseClassName
The name of the base/super/parent class of this class.
Definition: TypeSys.hpp:110
const char * ClassName
The name of this class.
Definition: TypeSys.hpp:109
Definition: Renderer.hpp:16
Definition: TypeSys.hpp:52
Definition: TypeSys.hpp:57
This class keeps type information (about an entity class that occurs in the game).
Definition: TypeSys.hpp:79
const TypeInfoT * Base
The type info for the base class.
Definition: TypeSys.hpp:114
const ArrayT< const TypeInfoT * > & GetTypeInfoRoots() const
Returns the roots of the inheritance trees. (Normally there should only be one root.)
Definition: TypeSys.hpp:178
const MethsDocT * DocCallbacks
Documentation for any Lua methods that we call but expect users to provide implementations for...
Definition: TypeSys.hpp:126
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.
Definition: TypeSys.cpp:21
Definition: TypeSys.hpp:68
void Init()
Completes the initialization of the TypeInfoManT and the registered type infos.
Definition: TypeSys.cpp:125