obby::command_queue Class Reference

#include <command.hpp>

List of all members.

Public Types

typedef sigc::signal< void,
const command_query &, const
command_result & > 
signal_result_type
typedef sigc::signal< void,
const command_query & > 
signal_query_failed_type
typedef sigc::signal< void,
const std::string &, const
std::string & > 
signal_help_type

Public Member Functions

 command_queue ()
void query (const command_query &query)
 Waits for a result for the given query.
void result (const command_result &result)
 Replies a query in the queue.
void clear ()
 Clears the command queue.
signal_result_type result_event (const std::string &command) const
 Signal that is emitted when a result for a previously sent command is available.
signal_query_failed_type query_failed_event () const
 Emitted when a query failed because the server did not know the command.
signal_help_type help_event () const
 Emitted for each help entry when a help command has been queried.

Protected Types

typedef std::map< std::string,
signal_result_type
map_type

Protected Member Functions

void on_help (const command_query &query, const command_result &result)

Protected Attributes

std::auto_ptr< map_typem_map
std::queue< command_querym_commands
signal_query_failed_type m_signal_query_failed
signal_help_type m_signal_help


Detailed Description

Command execution queue.

Stores commands that have been sent to be executed and waits for results.

Definition at line 195 of file command.hpp.


Member Typedef Documentation

typedef sigc::signal<void, const command_query&, const command_result&> obby::command_queue::signal_result_type

Definition at line 199 of file command.hpp.

typedef sigc::signal<void, const command_query&> obby::command_queue::signal_query_failed_type

Definition at line 202 of file command.hpp.

typedef sigc::signal<void, const std::string&, const std::string&> obby::command_queue::signal_help_type

Definition at line 205 of file command.hpp.

typedef std::map<std::string, signal_result_type> obby::command_queue::map_type [protected]

Definition at line 239 of file command.hpp.


Constructor & Destructor Documentation

obby::command_queue::command_queue (  ) 

Definition at line 273 of file command.cpp.

References on_help(), and result_event().


Member Function Documentation

void obby::command_queue::query ( const command_query query  ) 

Waits for a result for the given query.

Definition at line 281 of file command.cpp.

References m_commands.

Referenced by result().

void obby::command_queue::result ( const command_result result  ) 

Replies a query in the queue.

Definition at line 286 of file command.cpp.

References m_commands, m_map, m_signal_query_failed, obby::command_result::NOT_FOUND, and query().

Referenced by on_help().

void obby::command_queue::clear (  ) 

Clears the command queue.

Definition at line 305 of file command.cpp.

References m_commands.

obby::command_queue::signal_result_type obby::command_queue::result_event ( const std::string &  command  )  const

Signal that is emitted when a result for a previously sent command is available.

Definition at line 312 of file command.cpp.

References m_map.

Referenced by obby::basic_client_buffer< Document, Selector >::basic_client_buffer(), and command_queue().

obby::command_queue::signal_query_failed_type obby::command_queue::query_failed_event (  )  const

Emitted when a query failed because the server did not know the command.

Definition at line 318 of file command.cpp.

References m_signal_query_failed.

obby::command_queue::signal_help_type obby::command_queue::help_event (  )  const

Emitted for each help entry when a help command has been queried.

Definition at line 323 of file command.cpp.

References m_signal_help.

void obby::command_queue::on_help ( const command_query query,
const command_result result 
) [protected]

Definition at line 328 of file command.cpp.

References m_signal_help, and result().

Referenced by command_queue().


Member Data Documentation

std::auto_ptr<map_type> obby::command_queue::m_map [protected]

Definition at line 241 of file command.hpp.

Referenced by result(), and result_event().

std::queue<command_query> obby::command_queue::m_commands [protected]

Definition at line 242 of file command.hpp.

Referenced by clear(), query(), and result().

signal_query_failed_type obby::command_queue::m_signal_query_failed [protected]

Definition at line 243 of file command.hpp.

Referenced by query_failed_event(), and result().

signal_help_type obby::command_queue::m_signal_help [protected]

Definition at line 244 of file command.hpp.

Referenced by help_event(), and on_help().


The documentation for this class was generated from the following files:
Generated on Fri Jan 11 10:01:32 2008 for obby by  doxygen 1.5.1