Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ProcessID.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_ProcessID_h_
00003 #define INCLUDED_ProcessID_h_
00004 
00005 //! this is a class instead of a namespace so i can limit write access of the ID value to the OObjects
00006 /*!
00007  * Although the ProcessID_t enum specifies the maximum number of processes
00008  * in its NumProcesses value, this doesn't have to correspond to the actual
00009  * number of active processes.  If you want an element of dynamicism to launch
00010  * and/or close processes at runtime, simply increase the NumProcesses to a 
00011  * higher value so that space can be allocated for those processes in shared 
00012  * memory regions for things like attachment pointers or other per-process
00013  * data.
00014  *
00015  * Not all processes *need* to have a named id, they just need a unique id.
00016  */
00017 class ProcessID {
00018 public:
00019   //! Holds ID number for each process
00020   enum ProcessID_t {
00021     MainProcess,   //!< MainObj process
00022     MotionProcess, //!< MotoObj process
00023     SoundProcess,  //!< SoundPlay process
00024 #ifndef PLATFORM_APERIOS
00025     SimulatorProcess, //!< for interaction with OS and managing global environment
00026 #endif
00027     NumProcesses   //!< maximum number of 'friendly' processes -- see class docs
00028   };
00029   
00030   static ProcessID_t getID() { return ID; }  //!< returns process's ID number, or if within a virtual function on a shared object, the process which created it (annoying)
00031   static void setID(ProcessID_t id) { ID=id; } //!< sets the ID during init (be careful you know what you're doing if you call this)
00032   
00033 private:
00034   static ProcessID_t ID; //!< holds ID number
00035 };
00036 
00037 /*! @file
00038  * @brief Defines ProcessID - simple little global for checking which process is currently running, kind of. (see ProcessID::getID() )
00039  * @author ejt (Creator)
00040  *
00041  * $Author: ejt $
00042  * $Name: tekkotsu-2_4_1 $
00043  * $Revision: 1.2 $
00044  * $State: Exp $
00045  * $Date: 2005/06/01 05:47:46 $
00046  */
00047 
00048 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:48 2005 by Doxygen 1.4.4