torque Torque Game Engine Documentation
TGE Version 1.5.2

engine/console/simBase.h File Reference

#include "core/tVector.h"
#include "core/tAlgorithm.h"
#include "core/bitSet.h"
#include "console/consoleObject.h"
#include "console/simDictionary.h"
#include "platform/platformMutex.h"
#include "platform/platformSemaphore.h"

Namespaces

namespace  Sim

Data Structures

class  SimObjectList
 A vector of SimObjects. More...
class  SimEvent
 Represents a queued event in the sim. More...
class  SimConsoleEvent
 Implementation of schedule() function. More...
struct  SimConsoleThreadExecCallback
 Used by Con::threadSafeExecute(). More...
class  SimConsoleThreadExecEvent
class  SimFieldDictionary
 Dictionary to keep track of dynamic fields on SimObject. More...
struct  SimFieldDictionary::Entry
class  SimFieldDictionaryIterator
class  SimObject
 Base class for objects involved in the simulation. More...
struct  SimObject::Notify
class  SimObjectPtr< T >
 Smart SimObject pointer. More...
class  SimDataBlock
 Root DataBlock class. More...
class  SimSet
 A set of SimObjects. More...
class  SimSetIterator
 Iterator for use with SimSets. More...
struct  SimSetIterator::Entry
class  SimSetIterator::Stack
class  SimGroup
 A group of SimObjects. More...
class  SimGroupIterator
class  SimDataBlockGroup

Defines

#define DeclareNamedSet(set)   extern SimSet *g##set;inline SimSet *get##set() { return g##set; }
#define DeclareNamedGroup(set)   extern SimGroup *g##set;inline SimGroup *get##set() { return g##set; }
#define ImplementNamedSet(set)   SimSet *g##set;
#define ImplementNamedGroup(set)   SimGroup *g##set;
#define DECLARE_CONSOLETYPE(T)   DefineConsoleType( Type##T##Ptr )
#define IMPLEMENT_CONSOLETYPE(T)   DatablockConsoleType( T##Ptr, Type##T##Ptr, sizeof(T*), T )
#define IMPLEMENT_SETDATATYPE(T)
#define IMPLEMENT_GETDATATYPE(T)

Typedefs

typedef U32 SimTime
typedef U32 SimObjectId

Enumerations

enum  SimObjectsConstants {
  DataBlockObjectIdFirst = 3,
  DataBlockObjectIdBitSize = 10,
  DataBlockObjectIdLast = DataBlockObjectIdFirst + (1 << DataBlockObjectIdBitSize) - 1,
  DynamicObjectIdFirst = DataBlockObjectIdLast + 1,
  InvalidEventId = 0,
  RootGroupId = 0xFFFFFFFF
}
 Definition of some basic Sim system constants. More...

Functions

 Sim::DeclareNamedSet (ActiveActionMapSet) DeclareNamedSet(GhostAlwaysSet) DeclareNamedSet(LightSet) DeclareNamedSet(WayPointSet) DeclareNamedSet(fxReplicatorSet) DeclareNamedSet(fxFoliageSet) DeclareNamedGroup(ActionMapGroup) DeclareNamedGroup(ClientGroup) DeclareNamedGroup(GuiGroup) DeclareNamedGroup(ScriptClassGroup) DeclareNamedGroup(GuiDataGroup) DeclareNamedGroup(TCPGroup) DeclareNamedGroup(ClientConnectionGroup) DeclareNamedGroup(ChunkFileGroup)
 Sim::DeclareNamedSet (sgMissionLightingFilterSet)
void Sim::init ()
void Sim::shutdown ()
SimDataBlockGroupSim::getDataBlockGroup ()
SimGroupSim::getRootGroup ()
SimObjectSim::findObject (SimObjectId)
SimObjectSim::findObject (const char *name)
template<class T>
bool Sim::findObject (SimObjectId id, T *&t)
template<class T>
bool Sim::findObject (const char *objectName, T *&t)
void Sim::advanceToTime (SimTime time)
void Sim::advanceTime (SimTime delta)
SimTime Sim::getCurrentTime ()
SimTime Sim::getTargetTime ()
U32 Sim::postEvent (SimObject *, SimEvent *, U32 targetTime)
 a target time of 0 on an event means current event
U32 Sim::postEvent (SimObjectId id, SimEvent *evt, U32 targetTime)
U32 Sim::postEvent (const char *objectName, SimEvent *evt, U32 targetTime)
U32 Sim::postCurrentEvent (SimObject *obj, SimEvent *evt)
U32 Sim::postCurrentEvent (SimObjectId obj, SimEvent *evt)
U32 Sim::postCurrentEvent (const char *obj, SimEvent *evt)
void Sim::cancelEvent (U32 eventId)
bool Sim::isEventPending (U32 eventId)
U32 Sim::getEventTimeLeft (U32 eventId)
U32 Sim::getTimeSinceStart (U32 eventId)
U32 Sim::getScheduleDuration (U32 eventId)


Define Documentation

#define DECLARE_CONSOLETYPE (  )     DefineConsoleType( Type##T##Ptr )

#define IMPLEMENT_CONSOLETYPE (  )     DatablockConsoleType( T##Ptr, Type##T##Ptr, sizeof(T*), T )

#define IMPLEMENT_SETDATATYPE (  ) 

Value:

ConsoleSetType( Type##T##Ptr ) \
   {                                                                                                 \
      volatile SimDataBlock* pConstraint = static_cast<SimDataBlock*>((T*)NULL);                     \
                                                                                                     \
      if (argc == 1) {                                                                               \
         *reinterpret_cast<T**>(dptr) = NULL;                                                        \
         if (argv[0] && argv[0][0] && !Sim::findObject(argv[0],*reinterpret_cast<T**>(dptr)))        \
            Con::printf("Object '%s' is not a member of the '%s' data block class", argv[0], #T);    \
      }                                                                                              \
      else                                                                                           \
         Con::printf("Cannot set multiple args to a single pointer.");                               \
   }

#define IMPLEMENT_GETDATATYPE (  ) 

Value:

ConsoleGetType( Type##T##Ptr ) \
   {                                                                                                                 \
      volatile SimDataBlock* pConstraint = static_cast<SimDataBlock*>((T*)NULL);                                     \
      T** obj = reinterpret_cast<T**>(dptr);                                                                         \
      char* returnBuffer = Con::getReturnBuffer(256);                                                                 \
      dSprintf(returnBuffer, 256, "%s", *obj ? (*obj)->getName() ? (*obj)->getName() : (*obj)->getIdString() : "");  \
      return returnBuffer;                                                                                           \
   }


Typedef Documentation

typedef U32 SimTime

typedef U32 SimObjectId


Enumeration Type Documentation

Definition of some basic Sim system constants.

These constants define the range of ids assigned to datablocks (DataBlockObjectIdFirst - DataBlockObjectIdLast), and the number of bits used to store datablock IDs.

Normal Sim objects are given the range of IDs starting at DynamicObjectIdFirst and going to infinity. Sim objects use a SimObjectId to represent their ID; this is currently a U32.

The RootGroupId is assigned to gRootGroup, in which most SimObjects are addded as child members. See simManager.cc for details, particularly Sim::initRoot() and following.

Enumerator:
DataBlockObjectIdFirst 
DataBlockObjectIdBitSize 
DataBlockObjectIdLast 
DynamicObjectIdFirst 
InvalidEventId 
RootGroupId 




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen