SkillShellThread Class Reference

Skill shell thread. More...

Inheritance diagram for SkillShellThread:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SkillShellThread (ArgumentParser *argp)
 Constructor.
 ~SkillShellThread ()
 Destructor.
virtual void loop ()
 Code to execute in the thread.
virtual void deregistered (unsigned int id) throw ()
 This handler has been deregistered.
virtual void inbound_received (FawkesNetworkMessage *m, unsigned int id) throw ()
 Called for incoming messages.
virtual void connection_died (unsigned int id) throw ()
 Client connection died.
virtual void connection_established (unsigned int id) throw ()
 Client has established a connection.

Detailed Description

Skill shell thread.

This thread opens a network connection to a host and uses a RemoteBlackBoard connection to send skill strings for execution. It also shows Skiller log messages and uses the skiller network protocol.

Author:
Tim Niemueller

Definition at line 66 of file skillet.cpp.


Constructor & Destructor Documentation

SkillShellThread::SkillShellThread ( ArgumentParser argp  )  [inline]

Constructor.

Parameters:
argp argument parser

Definition at line 72 of file skillet.cpp.

References fawkes::FawkesNetworkClient::connect(), fawkes::ArgumentParser::parse_hostport(), and fawkes::FawkesNetworkClient::register_handler().

SkillShellThread::~SkillShellThread (  )  [inline]

Member Function Documentation

virtual void SkillShellThread::connection_died ( unsigned int  id  )  throw () [inline, virtual]

Client connection died.

This method is used to inform handlers that the connection has died for any reason. No more data can be send and no more messages should be enqueued because it is unclear when they would be sent.

Parameters:
id the id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 217 of file skillet.cpp.

References fawkes::BlackBoard::close().

virtual void SkillShellThread::connection_established ( unsigned int  id  )  throw () [inline, virtual]

Client has established a connection.

Whenever the client establishes a connection this is signaled to handlers with this method. You can register to a client at any time, you may even enqueue messages to a client while the connection is dead. If the client at some point gets connected again, the messages will then be send out in one go. You should use this in your application though to only send data if the connection is alive and you should let the user know about the connection status.

Parameters:
id the id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 234 of file skillet.cpp.

virtual void SkillShellThread::deregistered ( unsigned int  id  )  throw () [inline, virtual]

This handler has been deregistered.

This is called when this handler is deregistered from the FawkesNetworkClient. Sometimes you may not want to allow this and post a big fat warning into the log.

Parameters:
id the id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 206 of file skillet.cpp.

virtual void SkillShellThread::inbound_received ( FawkesNetworkMessage m,
unsigned int  id 
) throw () [inline, virtual]

Called for incoming messages.

This is called when an incoming message has been received. If this method was called one or more times then the a previously carried out wait(cid) call will continue.

Parameters:
m Message to handle
id the id of the calling client

Implements fawkes::FawkesNetworkClientHandler.

Definition at line 211 of file skillet.cpp.

virtual void SkillShellThread::loop (  )  [inline, virtual]

Code to execute in the thread.

Implement this method to hold the code you want to be executed continously. If you do not implement this method, the default is that the thread will exit. This is useful if you choose to only implement once().

Reimplemented from fawkes::Thread.

Definition at line 119 of file skillet.cpp.

References fawkes::FawkesNetworkClient::connect(), fawkes::FawkesNetworkClient::connected(), fawkes::FawkesNetworkClient::disconnect(), fawkes::Thread::exit(), fawkes::ArgumentParser::items(), fawkes::Interface::msgq_enqueue(), fawkes::ArgumentParser::num_items(), fawkes::BlackBoard::open_for_reading(), and fawkes::Exception::print_trace().


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

Generated on 1 Mar 2011 for Fawkes API by  doxygen 1.6.1