22 #ifndef ULTIMA8_KERNEL_USECODE_PROCESS_H 23 #define ULTIMA8_KERNEL_USECODE_PROCESS_H 25 #include "ultima/shared/std/containers.h" 26 #include "ultima/ultima8/misc/classtype.h" 27 #include "ultima/ultima8/misc/debugger.h" 38 virtual void run() = 0;
43 ENABLE_RUNTIME_CLASSTYPE_BASE()
45 uint32 getProcessFlags()
const {
48 bool is_active()
const {
51 bool is_terminated()
const {
52 return (_flags & (PROC_TERMINATED |
55 bool is_suspended()
const {
85 void wakeUp(uint32 result);
90 void setItemNum(ObjId it) {
93 void setType(uint16 ty) {
96 void setTicksPerRun(uint32 val) {
100 ProcId getPid()
const {
103 ObjId getItemNum()
const {
106 uint16 getType()
const {
109 uint32 getTicksPerRun()
const {
153 PROC_TERMINATED = 0x0004,
155 PROC_FAILED = 0x0010,
uint32 _ticksPerRun
Definition: process.h:135
run even if game is paused
Definition: process.h:156
processflags
Definition: process.h:150
ProcId _pid
process id
Definition: process.h:129
virtual void terminate()
terminate the process. This wakes up all processes waiting for it.
uint32 _result
process result
Definition: process.h:142
suspended? (because it's waiting)
Definition: process.h:152
Std::vector< ProcId > _waiting
Definition: process.h:146
automatically call terminate next frame
Definition: process.h:154
Definition: detection.h:27
bool validateWaiters() const
Dispose after termination.
Definition: process.h:157
void suspend()
suspend process
void setRunPaused()
run even when paused
Definition: process.h:71
void wakeUp(uint32 result)
Wake up when the process we were waiting for has finished.
bool loadData(Common::ReadStream *rs, uint32 version)
load Process data
void waitFor(ProcId pid)
suspend until process 'pid' returns. If pid is 0, suspend indefinitely
void fail()
terminate the process and recursively fail all processes waiting for it
void terminateDeferred()
terminate next frame
Definition: process.h:66
Definition: debugger.h:37
ObjId _itemNum
item we are assigned to
Definition: process.h:138
When set, prevent game from saving.
Definition: process.h:158
virtual Common::String dumpInfo() const
dump some info about this process to a string
is the process in the run-list?
Definition: process.h:151
virtual void saveData(Common::WriteStream *ws)
save Process data
virtual void onWakeUp()
A hook to add aditional behavior on wakeup, before anything else happens.
Definition: process.h:88