PicobgAgent Class Reference

#include <PicobgAgent.h>

Inherits TimerAgent, and FF3DDeviceInputAgent.

Collaboration diagram for PicobgAgent:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 28 of file PicobgAgent.h.

Public Member Functions

 PicobgAgent (void)
virtual ~PicobgAgent (void)
virtual void onButtonDown ()
 onButtonDown is called after each "button down" event
virtual void onTimer ()
virtual void run ()
 the run method inherited from Thread, agent is started using Thread's start() method.
void handleTime (MicoleBus *app, int argc, const char **argv)
int getElapsedTime ()
AgentState getState ()
virtual void start ()
 start the thread
string getAgentName ()
string getAgentType ()
void onApplicationConnected (MicoleBus *app)
void onApplicationDisconnected (MicoleBus *app)
void handlePingMessage (MicoleBus *app, int argc, const char **argv)
void handleQuitMessage (MicoleBus *app, int argc, const char **argv)
void handleSuspendMessage (MicoleBus *app, int argc, const char **argv)
void handleResumeMessage (MicoleBus *app, int argc, const char **argv)
void handleRegisterReply (MicoleBus *app, int argc, const char **argv)
void handleStartMessage (MicoleBus *app, int argc, const char **argv)
void handlePrintIDMessage (MicoleBus *app, int argc, const char **argv)
int sendMessage (const char *message)
 Sends a message using bus->SendMsg.
int sendMessage (const string message)
 Sends a message using bus->SendMsg.
void sendMessage (const char *to, const char *message)
 Sends a message to the MicoleBus *app by calling app->SendMsg(const char *message) The message goes only to agent specified by const char *to.
void handleInput (MicoleBus *app, int argc, const char **argv)
 handle input store position and button state and call callback functions if needed
virtual void onInput ()
 onInput is called after each update of position
virtual void onButtonUp ()
 onButtondown is called after each time you release 3D device button
string getAgentName ()
string getAgentType ()
void onApplicationConnected (MicoleBus *app)
void onApplicationDisconnected (MicoleBus *app)
void handlePingMessage (MicoleBus *app, int argc, const char **argv)
void handleQuitMessage (MicoleBus *app, int argc, const char **argv)
void handleSuspendMessage (MicoleBus *app, int argc, const char **argv)
void handleResumeMessage (MicoleBus *app, int argc, const char **argv)
void handleRegisterReply (MicoleBus *app, int argc, const char **argv)
void handleStartMessage (MicoleBus *app, int argc, const char **argv)
void handlePrintIDMessage (MicoleBus *app, int argc, const char **argv)
int sendMessage (const char *message)
 Sends a message using bus->SendMsg.
int sendMessage (const string message)
 Sends a message using bus->SendMsg.
void sendMessage (const char *to, const char *message)
 Sends a message to the MicoleBus *app by calling app->SendMsg(const char *message) The message goes only to agent specified by const char *to.

Static Public Member Functions

static threadid getthreadid ()
 return thread identifier
static void sleep (long milliseconds=1)
 sleep the thread

Public Attributes

Vec3f _initPos
int _timestamp

Protected Member Functions

virtual void prepareToStop (int argc, const char **argv)
 dummy function just for test
virtual void prepareToSuspend (int argc, const char **argv)
void suspendAgent ()
 Suspends the agent.
void resumeAgent ()
 Resumes the agent.
virtual void stopAgent ()
 Gives inheriting class a chance to save state when the agent receives Quit-message.
int bindMessage (const char *regexp, MicoleCallback *cb)
 Binds a callback method to bus.
void unBindMessage (int messageId)
void unBindMessage (MicoleBinding &binding)
void obtainIdentifier ()
 Obtains identifier from the RegistryAgent.
int bindMessage (const char *regexp, MicoleCallback *cb)
 Binds a callback method to bus.
void unBindMessage (int messageId)
void unBindMessage (MicoleBinding &binding)
void obtainIdentifier ()
 Obtains identifier from the RegistryAgent.

Protected Attributes

vector< MicoleBindingbindings
AgentState state
int resumeId
Vec3f _position
 FF3D Device position.
bool _buttonPressed
 Button state.
vector< MicoleBindingbindings
AgentState state
int resumeId

Static Protected Attributes

static MicoleBusbus = 0
static MicoleBusbus = 0


Constructor & Destructor Documentation

PicobgAgent::PicobgAgent ( void   ) 

Definition at line 26 of file PicobgAgent.cpp.

PicobgAgent::~PicobgAgent ( void   )  [virtual]

Definition at line 31 of file PicobgAgent.cpp.


Member Function Documentation

int MicoleAgent::bindMessage ( const char *  regexp,
MicoleCallback cb 
) [protected, inherited]

Binds a callback method to bus.

When a message that satisfies condition given in *regexp is received, the call back method is called by the bus. Methods that are bound with this message are not called when the agent is SUSPENDED. Methods that are bound using bus->BindMsg() are called also when the agent's state is SUSPENDED.

Definition at line 88 of file MicoleAgent.cpp.

int MicoleAgent::bindMessage ( const char *  regexp,
MicoleCallback cb 
) [protected, inherited]

Binds a callback method to bus.

When a message that satisfies condition given in *regexp is received, the call back method is called by the bus. Methods that are bound with this message are not called when the agent is SUSPENDED. Methods that are bound using bus->BindMsg() are called also when the agent's state is SUSPENDED.

Definition at line 88 of file MicoleAgent.cpp.

string MicoleAgent::getAgentName (  )  [inherited]

Definition at line 62 of file MicoleAgent.cpp.

string MicoleAgent::getAgentName (  )  [inherited]

Definition at line 62 of file MicoleAgent.cpp.

string MicoleAgent::getAgentType (  )  [inherited]

Definition at line 67 of file MicoleAgent.cpp.

string MicoleAgent::getAgentType (  )  [inherited]

Definition at line 67 of file MicoleAgent.cpp.

int TimerAgent::getElapsedTime (  )  [inherited]

Definition at line 56 of file TimerAgent.cpp.

AgentState MicoleAgentThread::getState (  )  [inherited]

Definition at line 39 of file MicoleAgentThread.cpp.

static threadid lo2k::Thread::getthreadid (  )  [inline, static, inherited]

return thread identifier

Returns:
identifier

Definition at line 85 of file Lo2kThread.h.

void FF3DDeviceInputAgent::handleInput ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

handle input store position and button state and call callback functions if needed

Definition at line 40 of file FF3DDeviceInputAgent.cpp.

void MicoleAgent::handlePingMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 130 of file MicoleAgent.cpp.

void MicoleAgent::handlePingMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 130 of file MicoleAgent.cpp.

void MicoleAgent::handlePrintIDMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 180 of file MicoleAgent.cpp.

void MicoleAgent::handlePrintIDMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 180 of file MicoleAgent.cpp.

void MicoleAgent::handleQuitMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Reimplemented in RegistryAgent, and SoundPlayerAgent.

Definition at line 111 of file MicoleAgent.cpp.

void MicoleAgent::handleQuitMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Reimplemented in RegistryAgent, and SoundPlayerAgent.

Definition at line 111 of file MicoleAgent.cpp.

void MicoleAgent::handleRegisterReply ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 138 of file MicoleAgent.cpp.

void MicoleAgent::handleRegisterReply ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 138 of file MicoleAgent.cpp.

void MicoleAgent::handleResumeMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 105 of file MicoleAgent.cpp.

void MicoleAgent::handleResumeMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 105 of file MicoleAgent.cpp.

void MicoleAgent::handleStartMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 175 of file MicoleAgent.cpp.

void MicoleAgent::handleStartMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 175 of file MicoleAgent.cpp.

void MicoleAgent::handleSuspendMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 99 of file MicoleAgent.cpp.

void MicoleAgent::handleSuspendMessage ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 99 of file MicoleAgent.cpp.

void TimerAgent::handleTime ( MicoleBus app,
int  argc,
const char **  argv 
) [inherited]

Definition at line 52 of file TimerAgent.cpp.

void MicoleAgent::obtainIdentifier (  )  [protected, inherited]

Obtains identifier from the RegistryAgent.

Definition at line 185 of file MicoleAgent.cpp.

void MicoleAgent::obtainIdentifier (  )  [protected, inherited]

Obtains identifier from the RegistryAgent.

Definition at line 185 of file MicoleAgent.cpp.

void MicoleAgent::onApplicationConnected ( MicoleBus app  )  [inherited]

void MicoleAgent::onApplicationConnected ( MicoleBus app  )  [inherited]

void MicoleAgent::onApplicationDisconnected ( MicoleBus app  )  [inherited]

void MicoleAgent::onApplicationDisconnected ( MicoleBus app  )  [inherited]

void PicobgAgent::onButtonDown (  )  [virtual]

onButtonDown is called after each "button down" event

Reimplemented from FF3DDeviceInputAgent.

Definition at line 36 of file PicobgAgent.cpp.

virtual void FF3DDeviceInputAgent::onButtonUp (  )  [inline, virtual, inherited]

onButtondown is called after each time you release 3D device button

Definition at line 79 of file FF3DDeviceInputAgent.h.

virtual void FF3DDeviceInputAgent::onInput (  )  [inline, virtual, inherited]

onInput is called after each update of position

Reimplemented in GuidanceAgent.

Definition at line 71 of file FF3DDeviceInputAgent.h.

void PicobgAgent::onTimer (  )  [virtual]

Reimplemented from TimerAgent.

Definition at line 45 of file PicobgAgent.cpp.

void TimerAgent::prepareToStop ( int  argc,
const char **  argv 
) [protected, virtual, inherited]

dummy function just for test

Definition at line 64 of file TimerAgent.cpp.

void TimerAgent::prepareToSuspend ( int  argc,
const char **  argv 
) [protected, virtual, inherited]

Definition at line 69 of file TimerAgent.cpp.

void MicoleAgentThread::resumeAgent (  )  [protected, virtual, inherited]

Resumes the agent.

Re-binds all callback methods.

Reimplemented from MicoleAgent.

Definition at line 88 of file MicoleAgentThread.cpp.

void TimerAgent::run (  )  [virtual, inherited]

the run method inherited from Thread, agent is started using Thread's start() method.

This is an abstract function, must be implemented in inherited classes.

Implements MicoleAgentThread.

Definition at line 41 of file TimerAgent.cpp.

void MicoleAgent::sendMessage ( const char *  to,
const char *  message 
) [inherited]

Sends a message to the MicoleBus *app by calling app->SendMsg(const char *message) The message goes only to agent specified by const char *to.

The receiving agent must have appropriate regexp bound to process the message.

int MicoleAgent::sendMessage ( const string  message  )  [inherited]

Sends a message using bus->SendMsg.

The message goes to all agents.

Definition at line 79 of file MicoleAgent.cpp.

int MicoleAgent::sendMessage ( const char *  message  )  [inherited]

Sends a message using bus->SendMsg.

The message goes to all agents.

Definition at line 72 of file MicoleAgent.cpp.

void MicoleAgent::sendMessage ( const char *  to,
const char *  message 
) [inherited]

Sends a message to the MicoleBus *app by calling app->SendMsg(const char *message) The message goes only to agent specified by const char *to.

The receiving agent must have appropriate regexp bound to process the message.

int MicoleAgent::sendMessage ( const string  message  )  [inherited]

Sends a message using bus->SendMsg.

The message goes to all agents.

Definition at line 79 of file MicoleAgent.cpp.

int MicoleAgent::sendMessage ( const char *  message  )  [inherited]

Sends a message using bus->SendMsg.

The message goes to all agents.

Definition at line 72 of file MicoleAgent.cpp.

static void lo2k::Thread::sleep ( long  milliseconds = 1  )  [inline, static, inherited]

sleep the thread

Parameters:
milliseconds milliseconds

Definition at line 98 of file Lo2kThread.h.

void MicoleAgentThread::start (  )  [virtual, inherited]

start the thread

Reimplemented from lo2k::Thread.

Definition at line 56 of file MicoleAgentThread.cpp.

void MicoleAgentThread::stopAgent (  )  [protected, virtual, inherited]

Gives inheriting class a chance to save state when the agent receives Quit-message.

Reimplemented from MicoleAgent.

Definition at line 102 of file MicoleAgentThread.cpp.

void MicoleAgentThread::suspendAgent (  )  [protected, virtual, inherited]

Suspends the agent.

Unbinds all callback methods that are bound using MicoleAgent::bindMessage()

Reimplemented from MicoleAgent.

Definition at line 77 of file MicoleAgentThread.cpp.

void MicoleAgent::unBindMessage ( MicoleBinding binding  )  [protected, inherited]

void MicoleAgent::unBindMessage ( int  messageId  )  [protected, inherited]

void MicoleAgent::unBindMessage ( MicoleBinding binding  )  [protected, inherited]

void MicoleAgent::unBindMessage ( int  messageId  )  [protected, inherited]


Member Data Documentation

bool FF3DDeviceInputAgent::_buttonPressed [protected, inherited]

Button state.

Definition at line 83 of file FF3DDeviceInputAgent.h.

Vec3f PicobgAgent::_initPos

Definition at line 33 of file PicobgAgent.h.

Vec3f FF3DDeviceInputAgent::_position [protected, inherited]

FF3D Device position.

Definition at line 82 of file FF3DDeviceInputAgent.h.

int PicobgAgent::_timestamp

Definition at line 34 of file PicobgAgent.h.

vector<MicoleBinding> MicoleAgent::bindings [protected, inherited]

Definition at line 158 of file MicoleAgent.h.

vector<MicoleBinding> MicoleAgent::bindings [protected, inherited]

Definition at line 158 of file MicoleAgent.h.

MicoleBus * MicoleAgent::bus = 0 [static, protected, inherited]

Definition at line 156 of file MicoleAgent.h.

MicoleBus * MicoleAgent::bus = 0 [static, protected, inherited]

Definition at line 156 of file MicoleAgent.h.

int MicoleAgent::resumeId [protected, inherited]

Definition at line 160 of file MicoleAgent.h.

int MicoleAgent::resumeId [protected, inherited]

Definition at line 160 of file MicoleAgent.h.

AgentState MicoleAgent::state [protected, inherited]

Definition at line 159 of file MicoleAgent.h.

AgentState MicoleAgent::state [protected, inherited]

Definition at line 159 of file MicoleAgent.h.


The documentation for this class was generated from the following files:
Generated on Tue Oct 16 17:11:03 2007 for Micole by  doxygen 1.4.7