StgDriver Class Reference
#include <p_driver.h>
Public Member Functions | |
stg_model_t * | LocateModel (char *basename, player_devaddr_t *addr, stg_model_initializer_t init) |
Interface * | LookupDevice (player_devaddr_t addr) |
virtual int | ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data) |
virtual int | Setup () |
virtual int | Shutdown () |
StgDriver (ConfigFile *cf, int section) | |
virtual int | Subscribe (QueuePointer &queue, player_devaddr_t addr) |
virtual int | Unsubscribe (QueuePointer &queue, player_devaddr_t addr) |
virtual void | Update () |
~StgDriver (void) | |
Static Public Attributes | |
static stg_world_t * | world = NULL |
Protected Attributes | |
GPtrArray * | devices |
Static Protected Attributes | |
static unsigned int | instance_count = 0 |
Constructor & Destructor Documentation
StgDriver::StgDriver | ( | ConfigFile * | cf, | |
int | section | |||
) |
References Interface::addr, devices, DRIVER_ERROR, player_quiet_startup, PRINT_ERR1, and PRINT_ERR3.
StgDriver::~StgDriver | ( | void | ) |
Member Function Documentation
stg_model_t * StgDriver::LocateModel | ( | char * | basename, | |
player_devaddr_t * | addr, | |||
stg_model_initializer_t | init | |||
) |
References devices, model_match(), PRINT_ERR1, and stg_world_model_name_lookup().
Referenced by InterfaceModel::InterfaceModel().
Interface * StgDriver::LookupDevice | ( | player_devaddr_t | addr | ) |
find the device record with this Player id
References Interface::addr, and devices.
Referenced by ProcessMessage(), Subscribe(), and Unsubscribe().
int StgDriver::ProcessMessage | ( | QueuePointer & | resp_queue, | |
player_msghdr * | hdr, | |||
void * | data | |||
) | [virtual] |
References LookupDevice(), PRINT_WARN3, and Interface::ProcessMessage().
int StgDriver::Setup | ( | ) | [virtual] |
References instance_count.
int StgDriver::Shutdown | ( | ) | [virtual] |
References instance_count.
int StgDriver::Subscribe | ( | QueuePointer & | queue, | |
player_devaddr_t | addr | |||
) | [virtual] |
References LookupDevice(), Interface::mod, stg_model_subscribe(), and Interface::Subscribe().
int StgDriver::Unsubscribe | ( | QueuePointer & | queue, | |
player_devaddr_t | addr | |||
) | [virtual] |
References LookupDevice(), Interface::mod, stg_model_unsubscribe(), and Interface::Unsubscribe().
void StgDriver::Update | ( | void | ) | [virtual] |
The server thread calls this method frequently. We use it to check for new commands and configs
References Interface::addr, devices, FALSE, GlobalTime, Interface::last_publish_time, Interface::mod, player_quit, Interface::Publish(), stg_world_update(), TRUE, and world.
Field Documentation
GPtrArray* StgDriver::devices [protected] |
an array of pointers to Interface objects, defined below
Referenced by LocateModel(), LookupDevice(), StgDriver(), and Update().
unsigned int StgDriver::instance_count = 0 [static, protected] |
Referenced by Setup(), and Shutdown().
stg_world_t * StgDriver::world = NULL [static] |
all player devices share the same Stage world (for now)
Referenced by StgTime::GetTime(), StgTime::GetTimeDouble(), InterfaceSimulation::InterfaceSimulation(), InterfaceSimulation::ProcessMessage(), and Update().
The documentation for this class was generated from the following files:
Generated on Wed Jun 3 23:12:29 2009 for Stage by
