Pol  Rev 533
OSExecutorModule Class Reference

#include <osmod.h>

+ Inheritance diagram for OSExecutorModule:
+ Collaboration diagram for OSExecutorModule:

List of all members.

Public Member Functions

 OSExecutorModule (Executor &exec)
 ~OSExecutorModule ()
bool blocked () const
BObjectImpclear_event_queue ()
bool in_debugger_holdlist () const
unsigned int pid () const
void revive ()
void revive_debugged ()
bool signal_event (BObjectImp *eventimp)
void SleepFor (int secs)
void SleepForMs (int msecs)
void suspend ()

Public Attributes

bool critical
unsigned char priority
bool warn_on_runaway

Protected Types

enum  { NO_LIST, TIMEOUT_LIST, NOTIMEOUT_LIST, DEBUGGER_LIST }
enum  { MAX_EVENTQUEUE_SIZE = 20 }
enum  WAIT_TYPE { WAIT_SLEEP, WAIT_EVENT }

Protected Member Functions

BObjectImpcreate_debug_context ()
void event_occurred (BObject event)
BObjectImpevents_waiting ()
virtual BObjectImpexecFunc (unsigned idx)
virtual int functionIndex (const char *func)
virtual std::string functionName (unsigned idx)
bool getCharacterParam (unsigned param, Character *&chrptr)
BObjectImpgetpid ()
BObjectImpgetprocess ()
BObjectImpis_critical ()
BObjectImpmf_clear_event_queue ()
BObjectImpmf_Log ()
BObjectImpmf_OpenConnection ()
BObjectImpmf_OpenURL ()
BObjectImpmf_parameter ()
BObjectImpmf_set_debug ()
BObjectImpmf_set_event_queue_size ()
BObjectImpmf_set_priority ()
BObjectImpmf_set_script_option ()
BObjectImpmf_system_rpm ()
BObjectImpmf_unload_scripts ()
BObjectImprun_script ()
BObjectImprun_script_to_completion ()
BObjectImpset_critical ()
BObjectImpsleep ()
BObjectImpsleepms ()
BObjectImpstart_script ()
BObjectImpstart_skill_script ()
BObjectImpwait_for_event ()

Protected Attributes

bool blocked_
std::queue< BObjectImp * > events_
HoldList::iterator hold_itr_
enum OSExecutorModule:: { ... }  in_hold_list_
unsigned short max_eventqueue_size
unsigned int pid_
polclock_t sleep_until_clock_
enum OSExecutorModule::WAIT_TYPE wait_type

Static Protected Attributes

static OSFunctionDef function_table []

Friends

polclock_t calc_script_clocksleft (polclock_t now)
void check_blocked (polclock_t *pclocksleft)
void deschedule_executor (UOExecutor *ex)
void new_check_blocked (void)
class NPCExecutorModule
void run_ready (void)
void step_scripts (void)

Detailed Description

Definition at line 51 of file osmod.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
NO_LIST 
TIMEOUT_LIST 
NOTIMEOUT_LIST 
DEBUGGER_LIST 

Definition at line 105 of file osmod.h.

anonymous enum [protected]
Enumerator:
MAX_EVENTQUEUE_SIZE 

Definition at line 115 of file osmod.h.

enum OSExecutorModule::WAIT_TYPE [protected]
Enumerator:
WAIT_SLEEP 
WAIT_EVENT 

Definition at line 110 of file osmod.h.


Constructor & Destructor Documentation

Definition at line 88 of file osmod.cpp.

Definition at line 103 of file osmod.cpp.

References events_, freepid(), and pid_.

+ Here is the call graph for this function:


Member Function Documentation

bool OSExecutorModule::blocked ( ) const

Definition at line 119 of file osmod.cpp.

References blocked_.

Referenced by UOExecutor::state().

+ Here is the caller graph for this function:

Definition at line 618 of file osmod.cpp.

References events_.

Referenced by ScriptExObjImp::call_method_id(), and mf_clear_event_queue().

+ Here is the caller graph for this function:

Definition at line 172 of file osmod.cpp.

void OSExecutorModule::event_occurred ( BObject  event) [protected]

Definition at line 257 of file osmod.cpp.

References events_.

BObjectImp * OSExecutorModule::execFunc ( unsigned  idx) [protected, virtual]

Implements ExecutorModule.

Definition at line 162 of file osmod.cpp.

References callMemberFunction, and function_table.

int OSExecutorModule::functionIndex ( const char *  func) [protected, virtual]

Implements ExecutorModule.

Definition at line 152 of file osmod.cpp.

References arsize, and function_table.

std::string OSExecutorModule::functionName ( unsigned  idx) [protected, virtual]

Implements ExecutorModule.

Definition at line 167 of file osmod.cpp.

References OSFunctionDef::funcname, and function_table.

bool OSExecutorModule::getCharacterParam ( unsigned  param,
Character *&  chrptr 
) [inline, protected]

Definition at line 139 of file osmod.h.

References ExecutorModule::exec.

Referenced by mf_OpenURL(), and start_skill_script().

+ Here is the caller graph for this function:

Definition at line 195 of file osmod.cpp.

References pid_.

Definition at line 177 of file osmod.cpp.

References find_uoexec(), ExecutorModule::getParam(), and pid().

+ Here is the call graph for this function:

Definition at line 389 of file osmod.cpp.

References critical.

Definition at line 611 of file osmod.cpp.

References clear_event_queue().

+ Here is the call graph for this function:

Definition at line 481 of file osmod.cpp.

References ExecutorModule::exec, ExecutorModule::getParam(), Executor::setDebugLevel(), and Executor::SOURCELINES.

+ Here is the call graph for this function:

Definition at line 628 of file osmod.cpp.

References ExecutorModule::getParam(), and max_eventqueue_size.

+ Here is the call graph for this function:

Definition at line 520 of file osmod.cpp.

References ExecutorModule::getParam(), and priority.

+ Here is the call graph for this function:

Definition at line 515 of file osmod.cpp.

References last_rpm.

Definition at line 538 of file osmod.cpp.

References String::data(), ExecutorModule::getStringParam(), String::length(), unload_all_scripts(), and unload_script().

+ Here is the call graph for this function:

Definition at line 375 of file osmod.cpp.

References critical, ExecutorModule::exec, and Executor::getParam().

+ Here is the call graph for this function:

Definition at line 213 of file osmod.cpp.

References ExecutorModule::exec, Executor::paramAsLong(), and SleepFor().

+ Here is the call graph for this function:

void OSExecutorModule::SleepFor ( int  secs)

Definition at line 145 of file scrsched.cpp.

References blocked_, polclock(), POLCLOCKS_PER_SEC, sleep_until_clock_, WAIT_SLEEP, and wait_type.

Referenced by NPCExecutorModule::move(), and sleep().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void OSExecutorModule::SleepForMs ( int  msecs)

Definition at line 155 of file scrsched.cpp.

References blocked_, polclock(), POLCLOCKS_PER_SEC, sleep_until_clock_, WAIT_SLEEP, and wait_type.

Referenced by HttpExecutorModule::mf_WriteHtml(), HttpExecutorModule::mf_WriteHtmlRaw(), NPCExecutorModule::move_self(), and sleepms().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Definition at line 224 of file osmod.cpp.

References ExecutorModule::exec, Executor::paramAsLong(), and SleepForMs().

+ Here is the call graph for this function:

Definition at line 235 of file osmod.cpp.

References blocked_, events_, ExecutorModule::exec, Executor::paramAsLong(), polclock(), POLCLOCKS_PER_SEC, sleep_until_clock_, WAIT_EVENT, and wait_type.

+ Here is the call graph for this function:


Friends And Related Function Documentation

Definition at line 459 of file scrsched.cpp.

void check_blocked ( polclock_t pclocksleft) [friend]

Definition at line 420 of file scrsched.cpp.

void deschedule_executor ( UOExecutor ex) [friend]

Definition at line 1062 of file scrsched.cpp.

void new_check_blocked ( void  ) [friend]
friend class NPCExecutorModule [friend]

Definition at line 120 of file osmod.h.

void run_ready ( void  ) [friend]

Definition at line 291 of file scrsched.cpp.

void step_scripts ( void  ) [friend]

Member Data Documentation

std::queue<BObjectImp*> OSExecutorModule::events_ [protected]
Initial value:
{
        { "create_debug_context",       &OSExecutorModule::create_debug_context },
        { "getprocess",                 &OSExecutorModule::getprocess },
        { "get_process",                &OSExecutorModule::getprocess },
        { "getpid",                     &OSExecutorModule::getpid },
        { "sleep",                      &OSExecutorModule::sleep },
        { "sleepms",                    &OSExecutorModule::sleepms },
        { "wait_for_event",             &OSExecutorModule::wait_for_event },
        { "events_waiting",             &OSExecutorModule::events_waiting },
        { "start_script",               &OSExecutorModule::start_script },
        { "start_skill_script",                 &OSExecutorModule::start_skill_script },
        { "set_critical",               &OSExecutorModule::set_critical },
        { "is_critical",                                &OSExecutorModule::is_critical },
        { "run_script_to_completion",   &OSExecutorModule::run_script_to_completion },
        { "run_script",                                 &OSExecutorModule::run_script },
        { "set_debug",                  &OSExecutorModule::mf_set_debug },
        { "syslog",                     &OSExecutorModule::mf_Log },
        { "system_rpm",                 &OSExecutorModule::mf_system_rpm },
        { "set_priority",               &OSExecutorModule::mf_set_priority },
        { "unload_scripts",             &OSExecutorModule::mf_unload_scripts },
        { "set_script_option",          &OSExecutorModule::mf_set_script_option },
        { "clear_event_queue",                  &OSExecutorModule::mf_clear_event_queue },
        { "set_event_queue_size",               &OSExecutorModule::mf_set_event_queue_size },
        { "OpenURL",                                    &OSExecutorModule::mf_OpenURL },
        { "OpenConnection",                             &OSExecutorModule::mf_OpenConnection }
}

Definition at line 136 of file osmod.h.

Referenced by execFunc(), functionIndex(), and functionName().

HoldList::iterator OSExecutorModule::hold_itr_ [protected]

Definition at line 106 of file osmod.h.

Referenced by deschedule_executor(), revive(), and run_ready().

unsigned short OSExecutorModule::max_eventqueue_size [protected]

Definition at line 116 of file osmod.h.

Referenced by mf_set_event_queue_size(), and signal_event().

unsigned int OSExecutorModule::pid_ [protected]

Definition at line 108 of file osmod.h.

Referenced by getpid(), pid(), and ~OSExecutorModule().

Definition at line 63 of file osmod.h.

Referenced by mf_set_script_option(), and run_ready().


The documentation for this class was generated from the following files: