Main Page   Modules   Class Hierarchy   Compound List   Compound Members  

Common Classes

Common classes that are widely used throughout the engine. More...

Compounds

class  GAUGE3D::GArray
class  GAUGE3D::GStridedArray
class  GAUGE3D::GException
class  GAUGE3D::GString
class  GAUGE3D::GSmartPointer
class  GAUGE3D::GObject

Support macros for QueryInterface.

#define GAUGE3D_SET_UID(HIGH,MID,LOW)
 Set the UID for a class. More...

#define GAUGE3D_DECLARE_INTERFACES(CLASSNAME)
 Begin interface declaration block for a class. More...

#define GAUGE3D_DECLARE_BASECLASS(BASECLASSNAME)
 Declare inherited interfaces for a class. More...

#define GAUGE3D_DECLARE_EMBEDDED_INTERFACE(INTERFACE_OBJECT)
 Declare embedded interfaces for a class. More...

#define GAUGE3D_END_INTERFACES
 End interface declaration block. More...


PI definitions

To avoid ambiguities in pi constants, we define both PI and M_PI.

#define M_PI   3.14159265358979323846
 pi.

#define M_PI_2   1.57079632679489661923
 pi/2.

#define M_PI_4   0.78539816339744830962
 pi/4.

#define PI   3.14159265358979323846
 pi.

#define PI_2   1.57079632679489661923
 pi/2.

#define PI_4   0.78539816339744830962
 pi/4.


Standard types

Some of these will be different on some systems.

typedef unsigned int uint
 unsigned int.

typedef unsigned short ushort
 unsigned short.

typedef unsigned long ulong
 unsigned long.

typedef unsigned char uchar
 unsigned char.

typedef char int8
 8-bit signed integer.

typedef short int16
 16-bit signed integer.

typedef int int32
 32-bit signed integer.

typedef long long int64
 64-bit signed integer.

typedef unsigned char uint8
 8-bit unsigned integer.

typedef unsigned short uint16
 16-bit unsigned integer.

typedef unsigned int uint32
 32-bit unsigned integer.

typedef unsigned long long uint64
 64-bit unsigned integer.

typedef float float32
 32-bit floating point number.

typedef double float64
 64-bit floating point number.

typedef double tTime
 Time value, measured in seconds. More...


Defines

#define GAUGE3D_FATAL_ERROR(CAUSE)
 Abort execution due to a fatal error. More...


Typedefs

typedef GSmartPointer<GObject> pGObject
 Smart pointer to a GObject.


Functions

template<class tType> GSmartPointer<tType> QueryInterface (pGObject object)
 See if an object supports a particular interface. More...


Detailed Description

Common classes that are widely used throughout the engine.

This module is used by every class in GAUGE. It includes stddefs.h, which must be included by every GAUGE source file. It also includes the memory allocator, GSmartPointer, GObject, GArray, GString, etc.


Define Documentation

#define GAUGE3D_FATAL_ERROR( CAUSE )
 

Initializer:

\
   throw GAUGE3D::GException(CAUSE, __FILE__, __LINE__);
Abort execution due to a fatal error.

Parameters:
CAUSE   A human-readable string describing the cause of the error.

This macro will create and throw a GException. It should be used only when a fatal error occurs. The program will quit, possibly printing an error message, when this is used.

#define GAUGE3D_SET_UID( HIGH, MID, LOW )
 

Initializer:

\
public:                                                                  \
   enum {_UID_HIGH = HIGH, _UID_MID = MID, _UID_LOW = LOW};              \
   virtual pGObject _QueryInterface(uint32 high, uint32 mid, uint32 low);\
private:
Set the UID for a class.

GAUGE3D_SET_UID should be used in the definition for any class that is derived from GObject. The numbers are the high, middle, and low 32-bit integers in the 96-bit GAUGE unique identifier for the class. (use gauge3d-uidgen to create them)

#define GAUGE3D_DECLARE_INTERFACES( CLASSNAME )
 

Initializer:

\
pGObject CLASSNAME::_QueryInterface(uint32 high, uint32 mid, uint32 low)\
{                                                                       \
   pGObject ret;                                                        \
   if((high == _UID_HIGH) && (mid == _UID_MID) && (low  == _UID_LOW))   \
      return this;
Begin interface declaration block for a class.

GAUGE3D_DECLARE_INTERFACES should appear in the cpp file for any class that uses GAUGE3D_SET_UID. It should be followed by a GAUGE3D_DECLARE_BASECLASS for each base class (but not base class's base classes, etc.) and a GAUGE3D_DECLARE_EMBEDDED_INTERFACE for every embedded interface. These should preferably be ordered with the most likely requested interface on top. After all of these, GAUGE3D_END_INTERFACES should be used.

#define GAUGE3D_DECLARE_BASECLASS( BASECLASSNAME )
 

Initializer:

\
   if((ret = BASECLASSNAME::_QueryInterface(high, mid, low)) != NULL)\
      return ret;
Declare inherited interfaces for a class.

GAUGE3D_DECLARE_BASECLASS declares direct base classes. Not the base classes of base classes, just direct inherited classes. So, if you are not using multiple inheritance, you should never need more than one of these.

#define GAUGE3D_DECLARE_EMBEDDED_INTERFACE( INTERFACE_OBJECT )
 

Initializer:

\
   if((ret = (INTERFACE_OBJECT)._QueryInterface(high, mid, low)) != NULL)\
      return ret;
Declare embedded interfaces for a class.

GAUGE3D_DECLARE_EMBEDDED_INTERFACE declares interfaces from which this class is not inherited, but which define additional functionality that this class has. The parameter should be an actual instantiated copy of the interface, not the classname of it. This is because that interface's QueryInterface function needs to be called.

#define GAUGE3D_END_INTERFACES
 

Initializer:

\
   return ret;                                                \
}
End interface declaration block.

Place GAUGE3D_END_INTERFACES after all you interface declarations.


Typedef Documentation

typedef double GAUGE3D::tTime
 

Time value, measured in seconds.

The time from which this value mesures is completely arbitrary, but will be the same for all tTime values during a particular run of the engine. If you want to get the date, use the ANSI-C functions created for this purpose.


Function Documentation

template<class tType>
GSmartPointer< tType > GAUGE3D::QueryInterface<tType> ( pGObject object ) [inline]
 

See if an object supports a particular interface.

Parameters:
tType   The type of the interface you want.
object   A smart pointer to the object from which you are requesting the interface.
Returns:
A smart pointer to the interface you requested, or NULL if the object does not support that interface.

This function determines if the given object supports an interface of type tType. The returned interface may be either an inherited interface or an embedded interface.

For example, if you had an object of type GObject and you wanted to see if it was a GFile, you would do this: QueryInterface<GFile>(myObject);

This function would be a member of GObject, but MSVC doesn't like templated member functions.


Generated at Tue Jan 30 17:07:34 2001 for gauge3d by doxygen1.2.4 written by Dimitri van Heesch, © 1997-2000