Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ProcessID Namespace Reference


Detailed Description

holds information to identify currently running process

Although the ProcessID_t enum specifies the maximum number of processes in its NumProcesses value, this doesn't have to correspond to the actual number of active processes. If you want an element of dynamicism to launch and/or close processes at runtime, simply increase the NumProcesses to a higher value so that space can be allocated for those processes in shared memory regions for things like attachment pointers or other per-process data.

Not all processes need to have a *named* id, they just need a unique id.


Enumerations

enum  ProcessID_t {
  MainProcess, MotionProcess, SoundProcess, SimulatorProcess,
  NumProcesses
}
 Holds ID number for each process. More...

Functions

ProcessID_t getUnhookedID ()
 returns process's ID number from static global, the default behavior if setIDHooks was passed NULL
void setUnhookedID (ProcessID_t id)
 sets the ID into static global (be careful you know what you're doing if you call this), this is the default behavior if setIDHooks was passed NULL
ProcessID_t getID ()
 returns process's ID number, subject to overriding via setIDHooks()
void setID (ProcessID_t id)
 sets the ID during init (be careful you know what you're doing if you call this), subject to overriding via setIDHooks()
void setIDHooks (ProcessID_t(*customGetID)(), void(*customSetID)(ProcessID_t id))
 allows you to override the behavior of getID and setID -- pass NULL to use default behavior
const char * getIDStr ()
 returns a string version of the name of the process

Variables

ProcessID_t ID = NumProcesses
 holds ID number
ProcessID_t(* getIDHook )() = &getUnhookedID
 hook allows overriding the ID system, set with ProcessID::setIDHooks
void(* setIDHook )(ProcessID_t id) = &setUnhookedID
 hook allows overriding the ID system, set with ProcessID::setIDHooks


Enumeration Type Documentation

Holds ID number for each process.

Enumerator:
MainProcess  MainObj process.
MotionProcess  MotoObj process.
SoundProcess  SoundPlay process.
SimulatorProcess  for interaction with OS and managing global environment
NumProcesses  maximum number of 'friendly' processes -- see class docs

Definition at line 23 of file ProcessID.h.


Function Documentation

const char* ProcessID::getIDStr (  )  [inline]

ProcessID_t ProcessID::getUnhookedID (  ) 

returns process's ID number from static global, the default behavior if setIDHooks was passed NULL

Definition at line 16 of file ProcessID.cc.

Referenced by setIDHooks().

void ProcessID::setID ( ProcessID_t  id  ) 

sets the ID during init (be careful you know what you're doing if you call this), subject to overriding via setIDHooks()

Definition at line 25 of file ProcessID.cc.

void ProcessID::setIDHooks ( ProcessID_t(*)()  customGetID,
void(*)(ProcessID_t id)  customSetID 
)

allows you to override the behavior of getID and setID -- pass NULL to use default behavior

Definition at line 27 of file ProcessID.cc.

void ProcessID::setUnhookedID ( ProcessID_t  id  ) 

sets the ID into static global (be careful you know what you're doing if you call this), this is the default behavior if setIDHooks was passed NULL

Definition at line 17 of file ProcessID.cc.

Referenced by setIDHooks().


Variable Documentation

ProcessID_t(* ProcessID::getIDHook)() = &getUnhookedID

hook allows overriding the ID system, set with ProcessID::setIDHooks

Referenced by getID(), and setIDHooks().

ProcessID_t ProcessID::ID = NumProcesses

holds ID number

Definition at line 13 of file ProcessID.cc.

Referenced by getUnhookedID(), and setUnhookedID().

void(* ProcessID::setIDHook)(ProcessID_t id) = &setUnhookedID

hook allows overriding the ID system, set with ProcessID::setIDHooks

Referenced by setIDHooks().


Tekkotsu v4.0
Generated Thu Nov 22 00:58:58 2007 by Doxygen 1.5.4