Gizmo3D

gzType.h File Reference

Run Time Type Info (RTTI) implementation. More...

#include "gzBasicTypes.h"

Go to the source code of this file.

Classes

class  gzType
class  gzTypeInterface

Defines

#define GZ_DECLARE_TYPE_INTERFACE_EXPORT(exporter)
#define GZ_DECLARE_TYPE_INTERFACE
#define GZ_DECLARE_TYPE_BASE(base, name)   gzType base::s_type(0,name)
#define GZ_DECLARE_TYPE_CHILD(parent, child, name)   gzType child::s_type(&parent::s_type,name)

Typedefs

typedef gzTypegzTypePtr
 Type definition pointer.

Functions

template<class T>
T * gzDynamic_Cast (gzTypeInterface *pObject)
template<class T1, class T2>
T2 * gzDynamic_Instance_Cast (gzTypeInterface *pObject)

Variables

const gzULong GZ_TYPE_MAX_NAME_LEN = 100


Detailed Description

Run Time Type Info (RTTI) implementation.

Gizmo3D uses the gzTypeInterface to query a certain object of its type. It can also manage hierarchical inheritance not nessecary the same as the C++ inheritance.

You should use it like this.

class MyClass : public gzTypeInterface
{
public:
    MyClass(){};            // or whatever

    virtual ~MyClass(){};   // or whatever


    GZ_DECLARE_TYPE_INTERFACE;  // This is IMPORTANT
};

You Should also in the implementation file write this.

GZ_DECLARE_TYPE_BASE(gzMyClass,"MyClassName");

// or if you have derived it from another class

GZ_DECLARE_TYPE_CHILD(MyParentClass,MyClass,"MyClassName");

Definition in file gzType.h.


Define Documentation

#define GZ_DECLARE_TYPE_BASE base,
name   )     gzType base::s_type(0,name)
 

Definition at line 71 of file gzType.h.

#define GZ_DECLARE_TYPE_CHILD parent,
child,
name   )     gzType child::s_type(&parent::s_type,name)
 

Examples:
node.cpp.

Definition at line 73 of file gzType.h.

#define GZ_DECLARE_TYPE_INTERFACE
 

Value:

static gzType s_type;\
                                    static gzType *getClassType() { return &s_type; }\
                                    virtual gzType *getType() const { return getClassType(); }
Examples:
node.cpp.

Definition at line 67 of file gzType.h.

#define GZ_DECLARE_TYPE_INTERFACE_EXPORT exporter   ) 
 

Value:

exporter static gzType s_type;\
                                                    exporter static gzType *getClassType() { return &s_type; }\
                                                    exporter virtual gzType *getType() const { return getClassType(); }

Definition at line 63 of file gzType.h.


Typedef Documentation

typedef gzType* gzTypePtr
 

Type definition pointer.

Definition at line 121 of file gzType.h.


Function Documentation

template<class T>
T* gzDynamic_Cast gzTypeInterface pObject  ) 
 

Definition at line 175 of file gzType.h.

References gzTypeInterface::isOfType(), and NULL.

template<class T1, class T2>
T2* gzDynamic_Instance_Cast gzTypeInterface pObject  ) 
 

Definition at line 200 of file gzType.h.

References gzTypeInterface::isOfType(), and NULL.


Variable Documentation

const gzULong GZ_TYPE_MAX_NAME_LEN = 100
 

Definition at line 61 of file gzType.h.


Documentation for Gizmo3D generated at Wed Feb 20 11:54:14 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond