Pol  Revision:cb584c9
Pol::Module::OSExecutorModule Class Reference

#include <osmod.h>

+ Inheritance diagram for Pol::Module::OSExecutorModule:

Public Member Functions

 OSExecutorModule (Bscript::Executor &exec)
 
 ~OSExecutorModule ()
 
bool blocked () const
 
Bscript::BObjectImpclear_event_queue ()
 
bool in_debugger_holdlist () const
 
unsigned int pid () const
 
void revive ()
 
void revive_debugged ()
 
bool signal_event (Bscript::BObjectImp *eventimp)
 
void SleepFor (int secs)
 
void SleepForMs (int msecs)
 
void suspend ()
 
- Public Member Functions inherited from Pol::Bscript::ExecutorModule
virtual ~ExecutorModule ()=default
 
BApplicObjBasegetApplicObjParam (unsigned param, const BApplicObjType *object_type)
 
void * getApplicPtrParam (unsigned param, const BApplicObjType *pointer_type)
 
bool getObjArrayParam (unsigned param, ObjArray *&pobjarr)
 
bool getParam (unsigned param, int &value)
 
bool getParam (unsigned param, int &value, int maxval)
 
bool getParam (unsigned param, int &value, int minval, int maxval)
 
bool getParam (unsigned param, unsigned &value)
 
bool getParam (unsigned param, short &value)
 
bool getParam (unsigned param, short &value, short maxval)
 
bool getParam (unsigned param, short &value, short minval, short maxval)
 
bool getParam (unsigned param, unsigned short &value)
 
bool getParam (unsigned param, unsigned short &value, unsigned short maxval)
 
bool getParam (unsigned param, unsigned short &value, unsigned short minval, unsigned short maxval)
 
BObjectImpgetParamImp (unsigned param)
 
BObjectImpgetParamImp (unsigned param, BObjectImp::BObjectType type)
 
bool getParamImp (unsigned param, BObjectImp *&imp)
 
bool getRealParam (unsigned param, double &value)
 
const StringgetStringParam (unsigned param)
 
bool getStringParam (unsigned param, const String *&pstr)
 
const std::string & scriptname () const
 

Public Attributes

bool critical
 
unsigned char priority
 
bool warn_on_runaway
 
- Public Attributes inherited from Pol::Bscript::ExecutorModule
Executorexec
 

Protected Types

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

Protected Member Functions

Bscript::BObjectImpcreate_debug_context ()
 
void event_occurred (Bscript::BObject event)
 
Bscript::BObjectImpevents_waiting ()
 
bool getCharacterParam (unsigned param, Mobile::Character *&chrptr)
 
Bscript::BObjectImpgetpid ()
 
Bscript::BObjectImpgetprocess ()
 
Bscript::BObjectImpis_critical ()
 
Bscript::BObjectImpmf_clear_event_queue ()
 
Bscript::BObjectImpmf_debugger ()
 
Bscript::BObjectImpmf_HTTPRequest ()
 
Bscript::BObjectImpmf_Log ()
 
Bscript::BObjectImpmf_OpenConnection ()
 
Bscript::BObjectImpmf_OpenURL ()
 
Bscript::BObjectImpmf_parameter ()
 
Bscript::BObjectImpmf_performance_diff ()
 
Bscript::BObjectImpmf_set_debug ()
 
Bscript::BObjectImpmf_set_event_queue_size ()
 
Bscript::BObjectImpmf_set_priority ()
 
Bscript::BObjectImpmf_set_script_option ()
 
Bscript::BObjectImpmf_system_rpm ()
 
Bscript::BObjectImpmf_unload_scripts ()
 
Bscript::BObjectImprun_script ()
 
Bscript::BObjectImprun_script_to_completion ()
 
Bscript::BObjectImpset_critical ()
 
Bscript::BObjectImpsleep ()
 
Bscript::BObjectImpsleepms ()
 
Bscript::BObjectImpstart_script ()
 
Bscript::BObjectImpstart_skill_script ()
 
Bscript::BObjectImpwait_for_event ()
 
- Protected Member Functions inherited from Pol::Bscript::TmplExecutorModule< OSExecutorModule >
 TmplExecutorModule (const char *modname, Executor &exec)
 
virtual BObjectImpexecFunc (unsigned idx) POL_OVERRIDE
 
virtual int functionIndex (const std::string &funcname) POL_OVERRIDE
 
virtual std::string functionName (unsigned idx) POL_OVERRIDE
 
- Protected Member Functions inherited from Pol::Bscript::ExecutorModule
 ExecutorModule (const char *moduleName, Executor &iExec)
 

Protected Attributes

bool blocked_
 
std::queue< Bscript::BObjectImp * > events_
 
Core::TimeoutHandle hold_itr_
 
enum Pol::Module::OSExecutorModule:: { ... }  in_hold_list_
 
unsigned short max_eventqueue_size
 
unsigned int pid_
 
Core::polclock_t sleep_until_clock_
 
enum Pol::Module::OSExecutorModule::WAIT_TYPE wait_type
 
- Protected Attributes inherited from Pol::Bscript::ExecutorModule
boost_utils::function_name_flystring moduleName
 

Friends

class Bscript::TmplExecutorModule< OSExecutorModule >
 
Core::polclock_t Core::calc_script_clocksleft (Core::polclock_t now)
 
void Core::check_blocked (Core::polclock_t *pclocksleft)
 
void Core::deschedule_executor (Core::UOExecutor *ex)
 
class Core::ScriptScheduler
 
void new_check_blocked (void)
 
class NPCExecutorModule
 
void step_scripts (void)
 

Detailed Description

Definition at line 52 of file osmod.h.

Member Enumeration Documentation

anonymous enum
protected
Enumerator
MAX_EVENTQUEUE_SIZE 

Definition at line 132 of file osmod.h.

anonymous enum
protected
Enumerator
NO_LIST 
TIMEOUT_LIST 
NOTIMEOUT_LIST 
DEBUGGER_LIST 

Definition at line 114 of file osmod.h.

Enumerator
WAIT_SLEEP 
WAIT_EVENT 
WAIT_UNKNOWN 

Definition at line 125 of file osmod.h.

Constructor & Destructor Documentation

Pol::Module::OSExecutorModule::OSExecutorModule ( Bscript::Executor exec)
explicit

Definition at line 102 of file osmod.cpp.

Pol::Module::OSExecutorModule::~OSExecutorModule ( )

Definition at line 118 of file osmod.cpp.

References events_, Pol::Module::freepid(), and pid_.

Member Function Documentation

bool Pol::Module::OSExecutorModule::blocked ( ) const
inline

Definition at line 158 of file osmod.h.

Referenced by Pol::Core::ScriptScheduler::run_ready(), and Pol::Core::UOExecutor::state().

BObjectImp * Pol::Module::OSExecutorModule::clear_event_queue ( )

Definition at line 527 of file osmod.cpp.

References events_.

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

BObjectImp * Pol::Module::OSExecutorModule::create_debug_context ( )
protected
void Pol::Module::OSExecutorModule::event_occurred ( Bscript::BObject  event)
protected
BObjectImp * Pol::Module::OSExecutorModule::events_waiting ( )
protected

Definition at line 227 of file osmod.cpp.

References events_.

Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().

bool Pol::Module::OSExecutorModule::getCharacterParam ( unsigned  param,
Mobile::Character *&  chrptr 
)
inlineprotected

Definition at line 153 of file osmod.h.

References Pol::Core::getCharacterParam().

Referenced by mf_OpenURL(), and start_skill_script().

BObjectImp * Pol::Module::OSExecutorModule::getpid ( )
protected

Definition at line 165 of file osmod.cpp.

References pid_.

Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().

BObjectImp * Pol::Module::OSExecutorModule::getprocess ( )
protected
BObjectImp * Pol::Module::OSExecutorModule::is_critical ( )
protected

Definition at line 361 of file osmod.cpp.

References critical.

Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().

BObjectImp * Pol::Module::OSExecutorModule::mf_clear_event_queue ( )
protected

Definition at line 934 of file osmod.cpp.

References clear_event_queue().

Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().

BObjectImp * Pol::Module::OSExecutorModule::mf_debugger ( )
protected
Bscript::BObjectImp* Pol::Module::OSExecutorModule::mf_parameter ( )
protected
BObjectImp * Pol::Module::OSExecutorModule::mf_set_event_queue_size ( )
protected
BObjectImp * Pol::Module::OSExecutorModule::mf_set_priority ( )
protected
BObjectImp * Pol::Module::OSExecutorModule::mf_system_rpm ( )
protected

Definition at line 488 of file osmod.cpp.

References Pol::Core::stateManager.

Referenced by Pol::Bscript::TmplExecutorModule< T >::function_table().

unsigned int Pol::Module::OSExecutorModule::pid ( ) const
BObjectImp * Pol::Module::OSExecutorModule::set_critical ( )
protected
BObjectImp * Pol::Module::OSExecutorModule::sleep ( )
protected
void Pol::Module::OSExecutorModule::SleepFor ( int  secs)
BObjectImp * Pol::Module::OSExecutorModule::sleepms ( )
protected
void Pol::Module::OSExecutorModule::suspend ( )

Definition at line 844 of file osmod.cpp.

References blocked_, sleep_until_clock_, WAIT_SLEEP, and wait_type.

Referenced by run_script(), and Pol::Core::UOExecutor::suspend().

Friends And Related Function Documentation

Definition at line 78 of file osmod.h.

void Core::check_blocked ( Core::polclock_t pclocksleft)
friend
friend class Core::ScriptScheduler
friend

Definition at line 143 of file osmod.h.

void new_check_blocked ( void  )
friend
friend class NPCExecutorModule
friend

Definition at line 140 of file osmod.h.

void step_scripts ( void  )
friend

Member Data Documentation

bool Pol::Module::OSExecutorModule::blocked_
protected
std::queue<Bscript::BObjectImp*> Pol::Module::OSExecutorModule::events_
protected
Core::TimeoutHandle Pol::Module::OSExecutorModule::hold_itr_
protected

Definition at line 121 of file osmod.h.

Referenced by revive(), and Pol::Core::ScriptScheduler::run_ready().

enum { ... } Pol::Module::OSExecutorModule::in_hold_list_
unsigned short Pol::Module::OSExecutorModule::max_eventqueue_size
protected

Definition at line 136 of file osmod.h.

Referenced by mf_set_event_queue_size(), and signal_event().

unsigned int Pol::Module::OSExecutorModule::pid_
protected

Definition at line 123 of file osmod.h.

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

unsigned char Pol::Module::OSExecutorModule::priority

Definition at line 63 of file osmod.h.

Referenced by mf_set_priority(), and Pol::Core::ScriptScheduler::run_ready().

Core::polclock_t Pol::Module::OSExecutorModule::sleep_until_clock_
protected
enum Pol::Module::OSExecutorModule::WAIT_TYPE Pol::Module::OSExecutorModule::wait_type
protected
bool Pol::Module::OSExecutorModule::warn_on_runaway

Definition at line 64 of file osmod.h.

Referenced by mf_set_script_option(), and Pol::Core::ScriptScheduler::run_ready().


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