Process Class Reference

#include <Process.h>

Inheritance diagram for Process:

ActorAnimProcess AmbushProcess AudioProcess AvatarDeathProcess AvatarMoverProcess CameraProcess ClearFeignDeathProcess CombatProcess CompileProcess CreateItemProcess DelayProcess DestroyItemProcess DisasmProcess EggHatcherProcess FireballProcess GrantPeaceProcess GravityProcess GumpNotifyProcess HealProcess InverterProcess JoystickCursorProcess LoiterProcess MainMenuProcess MissileProcess MusicProcess PaletteFaderProcess PathfinderProcess QuickAvatarMoverProcess ResurrectionProcess SchedulerProcess SplitItemProcess SpriteProcess StartU8Process TeleportToEggProcess UCProcess List of all members.

Public Types

 PROC_ACTIVE = 0x0001
 PROC_SUSPENDED = 0x0002
 PROC_TERMINATED = 0x0004
 PROC_TERM_DEFERRED = 0x0008
 PROC_FAILED = 0x0010
 PROC_RUNPAUSED = 0x0020
enum  processflags {
  PROC_ACTIVE = 0x0001, PROC_SUSPENDED = 0x0002, PROC_TERMINATED = 0x0004, PROC_TERM_DEFERRED = 0x0008,
  PROC_FAILED = 0x0010, PROC_RUNPAUSED = 0x0020
}

Public Member Functions

virtual bool run (const uint32 framenum)=0
 Process (ObjId item_num=0, uint16 type=0)
virtual ~Process ()
 ENABLE_RUNTIME_CLASSTYPE ()
 ENABLE_CUSTOM_MEMORY_ALLOCATION ()
uint32 getProcessFlags () const
bool is_active () const
bool is_terminated () const
bool is_suspended () const
void fail ()
virtual void terminate ()
void terminateDeferred ()
void waitFor (ProcId pid)
void waitFor (Process *proc)
void suspend ()
void wakeUp (uint32 result)
void setItemNum (ObjId it)
void setType (uint16 ty)
ProcId getPid () const
ObjId getItemNum () const
uint16 getType () const
virtual void dumpInfo ()
void save (ODataSource *ods)
bool loadData (IDataSource *ids, uint32 version)

Protected Member Functions

virtual void saveData (ODataSource *ods)
void writeProcessHeader (ODataSource *ods)

Protected Attributes

ProcId pid
uint32 flags
ObjId item_num
uint16 type
uint32 result
std::vector< ProcIdwaiting

Friends

class Kernel

Detailed Description

Definition at line 26 of file Process.h.


Member Enumeration Documentation

enum Process::processflags

Enumerator:
PROC_ACTIVE  is the process in the run-list?
PROC_SUSPENDED  suspended? (because it's waiting)
PROC_TERMINATED 
PROC_TERM_DEFERRED  automatically call terminate next frame
PROC_FAILED 
PROC_RUNPAUSED  run even if game is paused

Definition at line 109 of file Process.h.


Constructor & Destructor Documentation

Process::Process ( ObjId  item_num = 0,
uint16  type = 0 
)

Definition at line 31 of file Process.cpp.

References Kernel::assignPID(), and Kernel::get_instance().

virtual Process::~Process (  )  [inline, virtual]

Definition at line 35 of file Process.h.


Member Function Documentation

void Process::dumpInfo (  )  [virtual]

dump some info about this process to pout

Reimplemented in GumpNotifyProcess, DelayProcess, UCProcess, ActorAnimProcess, CombatProcess, and GravityProcess.

Definition at line 100 of file Process.cpp.

References flags, getPid(), item_num, pout, PROC_ACTIVE, PROC_FAILED, PROC_RUNPAUSED, PROC_SUSPENDED, PROC_TERM_DEFERRED, PROC_TERMINATED, type, and waiting.

Referenced by Kernel::ConCmd_processInfo(), UCProcess::dumpInfo(), GumpNotifyProcess::dumpInfo(), GravityProcess::dumpInfo(), DelayProcess::dumpInfo(), CombatProcess::dumpInfo(), and ActorAnimProcess::dumpInfo().

Process::ENABLE_CUSTOM_MEMORY_ALLOCATION (  ) 

Process::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented in AudioProcess, MusicProcess, StartU8Process, InverterProcess, PaletteFaderProcess, GumpNotifyProcess, MainMenuProcess, DelayProcess, JoystickCursorProcess, CompileProcess, DisasmProcess, UCProcess, ActorAnimProcess, ActorBarkNotifyProcess, AmbushProcess, AvatarDeathProcess, AvatarGravityProcess, AvatarMoverProcess, ClearFeignDeathProcess, CombatProcess, GrantPeaceProcess, HealProcess, LoiterProcess, PathfinderProcess, QuickAvatarMoverProcess, ResurrectionProcess, SchedulerProcess, TargetedAnimProcess, TeleportToEggProcess, CameraProcess, CreateItemProcess, DestroyItemProcess, EggHatcherProcess, FireballProcess, GravityProcess, MissileProcess, SplitItemProcess, and SpriteProcess.

void Process::fail (  ) 

terminate the process and recursively fail all processes waiting for it

Definition at line 37 of file Process.cpp.

References flags, PROC_FAILED, PROC_TERMINATED, and terminate().

ObjId Process::getItemNum (  )  const [inline]

Definition at line 73 of file Process.h.

References item_num.

ProcId Process::getPid (  )  const [inline]

Definition at line 72 of file Process.h.

References pid.

Referenced by dumpInfo(), GravityProcess::init(), ActorAnimProcess::init(), InverterProcess::invertScreen(), QuickAvatarMoverProcess::QuickAvatarMoverProcess(), PathfinderProcess::run(), GrantPeaceProcess::run(), GUIApp::save(), Gump::SetNotifyProcess(), SliderGump::setUsecodeNotify(), MovieGump::U8MovieViewer(), and waitFor().

uint32 Process::getProcessFlags (  )  const [inline]

Definition at line 43 of file Process.h.

References flags.

uint16 Process::getType (  )  const [inline]

Definition at line 74 of file Process.h.

References type.

bool Process::is_active (  )  const [inline]

Definition at line 44 of file Process.h.

References flags, and PROC_ACTIVE.

bool Process::is_suspended (  )  const [inline]

Definition at line 47 of file Process.h.

References flags, and PROC_SUSPENDED.

bool Process::is_terminated (  )  const [inline]

Definition at line 45 of file Process.h.

References flags, PROC_TERM_DEFERRED, and PROC_TERMINATED.

Referenced by UCMachine::execProcess(), SplitItemProcess::run(), and QuickAvatarMoverProcess::terminateMover().

bool Process::loadData ( IDataSource ids,
uint32  version 
)

load Process data

Reimplemented in AudioProcess, MusicProcess, StartU8Process, InverterProcess, PaletteFaderProcess, GumpNotifyProcess, MainMenuProcess, DelayProcess, JoystickCursorProcess, UCProcess, ActorAnimProcess, ActorBarkNotifyProcess, AmbushProcess, AvatarDeathProcess, AvatarGravityProcess, AvatarMoverProcess, ClearFeignDeathProcess, CombatProcess, GrantPeaceProcess, HealProcess, LoiterProcess, PathfinderProcess, QuickAvatarMoverProcess, ResurrectionProcess, SchedulerProcess, TargetedAnimProcess, TeleportToEggProcess, CameraProcess, CreateItemProcess, DestroyItemProcess, EggHatcherProcess, FireballProcess, GravityProcess, MissileProcess, SplitItemProcess, and SpriteProcess.

Definition at line 150 of file Process.cpp.

References flags, item_num, pid, IDataSource::read2(), IDataSource::read4(), result, type, and waiting.

Referenced by UCProcess::loadData(), TeleportToEggProcess::loadData(), StartU8Process::loadData(), SpriteProcess::loadData(), SplitItemProcess::loadData(), SchedulerProcess::loadData(), ResurrectionProcess::loadData(), QuickAvatarMoverProcess::loadData(), PathfinderProcess::loadData(), PaletteFaderProcess::loadData(), MusicProcess::loadData(), MissileProcess::loadData(), MainMenuProcess::loadData(), LoiterProcess::loadData(), JoystickCursorProcess::loadData(), InverterProcess::loadData(), HealProcess::loadData(), GumpNotifyProcess::loadData(), GravityProcess::loadData(), GrantPeaceProcess::loadData(), FireballProcess::loadData(), EggHatcherProcess::loadData(), DestroyItemProcess::loadData(), DelayProcess::loadData(), CreateItemProcess::loadData(), CombatProcess::loadData(), ClearFeignDeathProcess::loadData(), CameraProcess::loadData(), AvatarMoverProcess::loadData(), AvatarDeathProcess::loadData(), AudioProcess::loadData(), AmbushProcess::loadData(), and ActorAnimProcess::loadData().

virtual bool Process::run ( const uint32  framenum  )  [pure virtual]

Implemented in AudioProcess, MusicProcess, StartU8Process, InverterProcess, PaletteFaderProcess, GumpNotifyProcess, MainMenuProcess, DelayProcess, JoystickCursorProcess, CompileProcess, DisasmProcess, UCProcess, ActorAnimProcess, ActorBarkNotifyProcess, AmbushProcess, AvatarDeathProcess, AvatarGravityProcess, AvatarMoverProcess, ClearFeignDeathProcess, CombatProcess, GrantPeaceProcess, HealProcess, LoiterProcess, PathfinderProcess, QuickAvatarMoverProcess, ResurrectionProcess, SchedulerProcess, TeleportToEggProcess, CameraProcess, CreateItemProcess, DestroyItemProcess, EggHatcherProcess, FireballProcess, GravityProcess, MissileProcess, SplitItemProcess, and SpriteProcess.

Referenced by Kernel::addProcessExec(), and Kernel::runProcesses().

void Process::save ( ODataSource ods  ) 

save this process

Definition at line 123 of file Process.cpp.

References saveData(), and writeProcessHeader().

void Process::saveData ( ODataSource ods  )  [protected, virtual]

save the Process data

Reimplemented in AudioProcess, MusicProcess, StartU8Process, InverterProcess, PaletteFaderProcess, GumpNotifyProcess, MainMenuProcess, DelayProcess, JoystickCursorProcess, UCProcess, ActorAnimProcess, ActorBarkNotifyProcess, AmbushProcess, AvatarDeathProcess, AvatarGravityProcess, AvatarMoverProcess, ClearFeignDeathProcess, CombatProcess, GrantPeaceProcess, HealProcess, LoiterProcess, PathfinderProcess, QuickAvatarMoverProcess, ResurrectionProcess, SchedulerProcess, TargetedAnimProcess, TeleportToEggProcess, CameraProcess, CreateItemProcess, DestroyItemProcess, EggHatcherProcess, FireballProcess, GravityProcess, MissileProcess, SplitItemProcess, and SpriteProcess.

Definition at line 138 of file Process.cpp.

References flags, item_num, pid, result, type, waiting, ODataSource::write2(), and ODataSource::write4().

Referenced by save(), UCProcess::saveData(), TeleportToEggProcess::saveData(), StartU8Process::saveData(), SpriteProcess::saveData(), SplitItemProcess::saveData(), SchedulerProcess::saveData(), ResurrectionProcess::saveData(), QuickAvatarMoverProcess::saveData(), PathfinderProcess::saveData(), PaletteFaderProcess::saveData(), MusicProcess::saveData(), MissileProcess::saveData(), MainMenuProcess::saveData(), LoiterProcess::saveData(), JoystickCursorProcess::saveData(), InverterProcess::saveData(), HealProcess::saveData(), GumpNotifyProcess::saveData(), GravityProcess::saveData(), GrantPeaceProcess::saveData(), FireballProcess::saveData(), EggHatcherProcess::saveData(), DestroyItemProcess::saveData(), DelayProcess::saveData(), CreateItemProcess::saveData(), CombatProcess::saveData(), ClearFeignDeathProcess::saveData(), CameraProcess::saveData(), AvatarMoverProcess::saveData(), AvatarDeathProcess::saveData(), AudioProcess::saveData(), AmbushProcess::saveData(), and ActorAnimProcess::saveData().

void Process::setItemNum ( ObjId  it  )  [inline]

Definition at line 69 of file Process.h.

References item_num.

Referenced by UCMachine::execProcess(), and SpriteProcess::init().

void Process::setType ( uint16  ty  )  [inline]

Definition at line 70 of file Process.h.

References type.

Referenced by UCMachine::execProcess().

void Process::suspend (  ) 

suspend process

Definition at line 95 of file Process.cpp.

References flags, and PROC_SUSPENDED.

void Process::terminate (  )  [virtual]

terminate the process. This wakes up all processes waiting for it.

Reimplemented in GumpNotifyProcess, UCProcess, ActorAnimProcess, CombatProcess, PathfinderProcess, QuickAvatarMoverProcess, CameraProcess, FireballProcess, and GravityProcess.

Definition at line 45 of file Process.cpp.

References flags, Kernel::get_instance(), Kernel::getProcess(), PROC_TERMINATED, result, waiting, and wakeUp().

Referenced by CurrentMap::clear(), CurrentMap::createEggHatcher(), fail(), HealProcess::feedAvatar(), JoystickCursorProcess::JoystickCursorProcess(), TeleportToEggProcess::run(), StartU8Process::run(), SpriteProcess::run(), SplitItemProcess::run(), ResurrectionProcess::run(), PaletteFaderProcess::run(), MissileProcess::run(), MainMenuProcess::run(), LoiterProcess::run(), InverterProcess::run(), HealProcess::run(), GrantPeaceProcess::run(), DestroyItemProcess::run(), DelayProcess::run(), CreateItemProcess::run(), CompileProcess::run(), ClearFeignDeathProcess::run(), AvatarDeathProcess::run(), AmbushProcess::run(), UCProcess::terminate(), QuickAvatarMoverProcess::terminate(), PathfinderProcess::terminate(), GumpNotifyProcess::terminate(), GravityProcess::terminate(), FireballProcess::terminate(), CombatProcess::terminate(), CameraProcess::terminate(), ActorAnimProcess::terminate(), and CurrentMap::writeback().

void Process::terminateDeferred (  )  [inline]

terminate next frame

Definition at line 56 of file Process.h.

References flags, and PROC_TERM_DEFERRED.

Referenced by UCMachine::execProcess(), Item::leaveFastArea(), QuickAvatarMoverProcess::loadData(), JoystickCursorProcess::loadData(), PathfinderProcess::PathfinderProcess(), GravityProcess::run(), and ActorAnimProcess::run().

void Process::waitFor ( Process proc  ) 

suspend until process returns. If proc is 0, suspend indefinitely

Definition at line 87 of file Process.cpp.

References getPid(), and waitFor().

void Process::waitFor ( ProcId  pid  ) 

suspend until process 'pid' returns. If pid is 0, suspend indefinitely

Definition at line 73 of file Process.cpp.

References flags, Kernel::get_instance(), Kernel::getProcess(), pid, PROC_SUSPENDED, and waiting.

Referenced by AvatarMoverProcess::checkTurn(), Item::collideMove(), MainActor::die(), Actor::die(), ActorAnimProcess::doHitSpecial(), ContainerGump::DropItem(), UCMachine::execProcess(), AvatarMoverProcess::handleCombatMode(), AvatarMoverProcess::handleHangingMode(), AvatarMoverProcess::handleNormalMode(), AvatarMoverProcess::jump(), Actor::receiveHit(), StartU8Process::run(), SchedulerProcess::run(), PathfinderProcess::run(), LoiterProcess::run(), GrantPeaceProcess::run(), CombatProcess::run(), AvatarDeathProcess::run(), ActorBarkNotifyProcess::run(), Actor::setInCombat(), AvatarMoverProcess::step(), GravityProcess::terminate(), CombatProcess::turnToDirection(), AvatarMoverProcess::turnToDirection(), waitFor(), and CombatProcess::waitForTarget().

void Process::wakeUp ( uint32  result  ) 

Definition at line 64 of file Process.cpp.

References flags, Kernel::get_instance(), PROC_SUSPENDED, result, and Kernel::setNextProcess().

Referenced by terminate().

void Process::writeProcessHeader ( ODataSource ods  )  [protected]

Definition at line 129 of file Process.cpp.

References ODataSource::write(), and ODataSource::write2().

Referenced by save().


Friends And Related Function Documentation

friend class Kernel [friend]

Reimplemented in UCProcess.

Definition at line 29 of file Process.h.


Member Data Documentation

uint32 Process::flags [protected]

Reimplemented in CreateItemProcess.

Definition at line 94 of file Process.h.

Referenced by Kernel::addProcessExec(), dumpInfo(), UCMachine::execProcess(), fail(), getProcessFlags(), is_active(), is_suspended(), is_terminated(), JoystickCursorProcess::JoystickCursorProcess(), loadData(), MusicProcess::MusicProcess(), GumpNotifyProcess::notifyClosing(), Kernel::removeProcess(), UCProcess::run(), ResurrectionProcess::run(), QuickAvatarMoverProcess::run(), DisasmProcess::run(), CompileProcess::run(), saveData(), Kernel::setNextProcess(), suspend(), terminate(), terminateDeferred(), waitFor(), and wakeUp().

ObjId Process::item_num [protected]

item we are assigned to

Definition at line 97 of file Process.h.

Referenced by ActorAnimProcess::ActorAnimProcess(), AmbushProcess::AmbushProcess(), AvatarDeathProcess::AvatarDeathProcess(), ClearFeignDeathProcess::ClearFeignDeathProcess(), CombatProcess::CombatProcess(), DestroyItemProcess::DestroyItemProcess(), ActorAnimProcess::doHitSpecial(), ActorAnimProcess::doSpecial(), dumpInfo(), UCMachine::execProcess(), FireballProcess::explode(), FireballProcess::FireballProcess(), getItemNum(), CombatProcess::getTargetDirection(), GrantPeaceProcess::GrantPeaceProcess(), GravityProcess::GravityProcess(), HealProcess::HealProcess(), CombatProcess::inAttackRange(), GravityProcess::init(), ActorAnimProcess::init(), CombatProcess::isEnemy(), CombatProcess::isValidTarget(), loadData(), LoiterProcess::LoiterProcess(), PathfinderProcess::PathfinderProcess(), ResurrectionProcess::ResurrectionProcess(), SpriteProcess::run(), SplitItemProcess::run(), ResurrectionProcess::run(), PathfinderProcess::run(), MissileProcess::run(), LoiterProcess::run(), GravityProcess::run(), GrantPeaceProcess::run(), FireballProcess::run(), DestroyItemProcess::run(), CombatProcess::run(), ClearFeignDeathProcess::run(), AmbushProcess::run(), ActorBarkNotifyProcess::run(), ActorAnimProcess::run(), saveData(), CombatProcess::seekTarget(), setItemNum(), SplitItemProcess::SplitItemProcess(), PathfinderProcess::terminate(), GravityProcess::terminate(), CombatProcess::terminate(), ActorAnimProcess::terminate(), CombatProcess::turnToDirection(), CombatProcess::waitForTarget(), and SpriteProcess::~SpriteProcess().

ProcId Process::pid [protected]

process id

Definition at line 92 of file Process.h.

Referenced by Kernel::addProcess(), Kernel::addProcessExec(), Kernel::assignPID(), UCMachine::execProcess(), getPid(), UCProcess::load(), loadData(), Kernel::removeProcess(), saveData(), and waitFor().

uint32 Process::result [protected]

process result

Definition at line 101 of file Process.h.

Referenced by UCMachine::execProcess(), GumpNotifyProcess::GumpNotifyProcess(), loadData(), GumpNotifyProcess::notifyClosing(), PathfinderProcess::PathfinderProcess(), SplitItemProcess::run(), PathfinderProcess::run(), GrantPeaceProcess::run(), DestroyItemProcess::run(), CreateItemProcess::run(), CameraProcess::run(), ActorAnimProcess::run(), saveData(), terminate(), and wakeUp().

uint16 Process::type [protected]

Definition at line 98 of file Process.h.

Referenced by ActorAnimProcess::ActorAnimProcess(), AmbushProcess::AmbushProcess(), AudioProcess::AudioProcess(), AvatarDeathProcess::AvatarDeathProcess(), AvatarMoverProcess::AvatarMoverProcess(), ClearFeignDeathProcess::ClearFeignDeathProcess(), CombatProcess::CombatProcess(), DestroyItemProcess::DestroyItemProcess(), dumpInfo(), UCMachine::execProcess(), FireballProcess::FireballProcess(), getType(), GrantPeaceProcess::GrantPeaceProcess(), GravityProcess::GravityProcess(), GumpNotifyProcess::GumpNotifyProcess(), HealProcess::HealProcess(), JoystickCursorProcess::JoystickCursorProcess(), loadData(), LoiterProcess::LoiterProcess(), MusicProcess::MusicProcess(), PathfinderProcess::PathfinderProcess(), ResurrectionProcess::ResurrectionProcess(), saveData(), SchedulerProcess::SchedulerProcess(), setType(), TeleportToEggProcess::TeleportToEggProcess(), and UCProcess::terminate().

std::vector<ProcId> Process::waiting [protected]

Processes waiting for this one to finish. When this process terminates, awaken them and pass them the result val.

Definition at line 105 of file Process.h.

Referenced by dumpInfo(), loadData(), saveData(), terminate(), and waitFor().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:48 2007 for pentagram by  doxygen 1.4.7