Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

ProcessID Namespace Reference

holds information to identify currently running process More...

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 (ProcessID_t pid)
 returns a string version of the name of the process
const char * getIDStr ()
 returns a string version of the name of the current 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

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.


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

ProcessID_t ProcessID::getID (  ) 

returns process's ID number, subject to overriding via setIDHooks()

Referenced by RCRegion::aboutToFork(), MessageQueueBase::addMessageFilter(), RCRegion::AddReference(), IPCEventTranslator::bufferRequest(), SharedObject< UPennWalkMC >::createRCRegion(), RegionRegistry< MAX_REGIONS, NAME_LEN >::erase(), RCRegion::faultShutdown(), MotionManager::getAccID(), getIDStr(), Thread::handle_exit(), SoundManager::InitAccess(), MotionManager::InitAccess(), SoundManager::initRegion(), KnowledgeBase::learn(), SoundManager::loadBuffer(), RCRegion::NumberOfLocalReference(), KnowledgeBase::objectExists(), WorldStateLookup::operator WorldState *(), WorldStateLookup::operator*(), WorldStateLookup::operator->(), RegionRegistry< MAX_REGIONS, NAME_LEN >::operator[](), SoundManager::play(), MotionCommand::postEvent(), EventRouter::processEvent(), MotionManager::processMsg(), KnowledgeBase::readFromFile(), RegionRegistry< MAX_REGIONS, NAME_LEN >::registerRegion(), SoundManager::release(), MessageQueueBase::removeMessageFilter(), MotionManager::removeMotion(), RCRegion::RemoveReference(), RCRegion::RemoveSharedReference(), SoundManager::resumePlay(), RunSequenceControl< SequenceSize >::selectedFile(), LoadPostureControl::selectedFile(), MessageQueue< MAX_UNREAD, MAX_RECEIVERS, MAX_SENDERS >::sendMessage(), Thread::testCurrentCancel(), SiftTekkotsu::train_addNewModel(), SiftTekkotsu::train_addNewObject(), SiftTekkotsu::train_removeModel(), SiftTekkotsu::train_removeObject(), and MutexLock< MAX_ACCESS >::useResource().

const char* ProcessID::getIDStr (  ) 

returns a string version of the name of the current process

Definition at line 61 of file ProcessID.h.

const char* ProcessID::getIDStr ( ProcessID_t  pid  ) 

returns a string version of the name of the process

Definition at line 48 of file ProcessID.h.

Referenced by MotionManager::checkinMotion(), MotionManager::checkoutMotion(), getIDStr(), MotionManager::processMsg(), MotionManager::RemoveAccess(), and MotionManager::removeMotion().

ProcessID_t ProcessID::getUnhookedID (  ) 

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

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()

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

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


Variable Documentation

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

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

Definition at line 22 of file ProcessID.cc.

ProcessID_t ProcessID::ID = NumProcesses

holds ID number

Definition at line 16 of file ProcessID.cc.

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

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

Definition at line 23 of file ProcessID.cc.


Tekkotsu v5.1CVS
Generated Mon May 9 04:59:25 2016 by Doxygen 1.6.3