OpenLexocad
27.0
|
#include <Type.h>
Public Types | |
typedef void *(* | instantiationMethod) (void) |
Public Member Functions | |
Type (const Type &type) | |
Construction. More... | |
Type (void) | |
virtual | ~Type () |
Destruction. More... | |
void * | createInstance (void) |
creates a instance of this type More... | |
const Type | getParent (void) const |
void | getChildren (std::set< Type > &children) const |
void | getAllChildren (std::set< Type > &children) const |
bool | isDerivedFrom (const Type type) const |
bool | isDerivedFrom (const std::vector< Base::Type > &types) const |
unsigned int | getKey (void) const |
bool | isBad (void) const |
const std::string & | getName (void) const |
void | operator= (const Type type) |
bool | operator== (const Type type) const |
bool | operator!= (const Type type) const |
bool | operator< (const Type type) const |
bool | operator<= (const Type type) const |
bool | operator>= (const Type type) const |
bool | operator> (const Type type) const |
Static Public Member Functions | |
static void * | createInstanceByName (const char *TypeName, bool bLoadModule=false) |
creates a instance of the named type More... | |
static Type | fromName (const char *name) |
static int | getAllDerivedFrom (const Type type, std::vector< Type > &List) |
Returns all types derived from type. More... | |
static std::vector< Type > | getAllDerivedFrom (const Type type) |
static std::string | getHierarchyAsString (Base::Type t) |
Returns the hierarchy of type t in backward order as a string. More... | |
static int | getNumTypes (void) |
static const Type | createType (const Type parent, const char *name, instantiationMethod method=0) |
static const Type | badType (void) |
static void | init (void) |
Static Protected Member Functions | |
static std::string | getModuleName (const char *ClassName) |
Type system class Many of the classes in the Lexocad must have their type information registered before any instances are created (including, but not limited to: Object, Property... ). The use of Type to store this information provides lots of various functionality for working with class hierarchies, comparing class types, instantiating objects from classnames, etc etc.
It is for instance possible to do things like this:
A notable feature of the Type class is that it is only 16 bits long and therefore should be passed around by value for efficiency reasons.
One important note about the use of Type to register class information: super classes must be registered before any of their derived classes are.
typedef void*(* Base::Type::instantiationMethod) (void) |
Base::Type::Type | ( | const Type & | type | ) |
Construction.
Base::Type::Type | ( | void | ) |
|
virtual |
Destruction.
|
inlinestatic |
void* Base::Type::createInstance | ( | void | ) |
creates a instance of this type
|
static |
creates a instance of the named type
|
static |
|
static |
|
inline |
Returns all types derived from type.
|
inline |
|
static |
Returns the hierarchy of type t in backward order as a string.
|
inline |
|
staticprotected |
const std::string& Base::Type::getName | ( | void | ) | const |
|
static |
|
inline |
|
static |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |