libmoost
moost::service::remote_shell< HandlerType > Class Template Reference

A remote command shell used for interacting with the user. More...

#include <remote_shell.h>

Inheritance diagram for moost::service::remote_shell< HandlerType >:
Collaboration diagram for moost::service::remote_shell< HandlerType >:

List of all members.

Public Member Functions

 remote_shell (HandlerType &hdl)
 remote_shell (HandlerType &hdl, boost::shared_ptr< boost::asio::io_service > ios)
virtual std::string get_prompt () const
 Return application prompt.
virtual std::string show_help () const
 Return command help.
virtual bool handle_command (std::string &_return, const std::string &cmd, const std::string &args)
 Application-specific command handler.
void run ()
void set_appender_factory (appender_factory_ptr app_factory)
void set_default_stdout_state (bool enabled)
void set_default_stderr_state (bool enabled)
void set_listen_port (unsigned short port)
void set_pre_shutdown_function (boost::function0< void > func)
void enable_local_shell (bool enabled=true)
void stop (const std::string &msg)

Private Attributes

HandlerType & m_hdl
remote_shell_server m_srv

Detailed Description

template<class HandlerType>
class moost::service::remote_shell< HandlerType >

A remote command shell used for interacting with the user.

Template Parameters:
HandlerTypeClass handling application-specific commands. This class must implement the handle_command(), get_prompt() and show_help() methods as defined by remote_shell_iface.

Definition at line 179 of file remote_shell.h.


Constructor & Destructor Documentation

template<class HandlerType>
moost::service::remote_shell< HandlerType >::remote_shell ( HandlerType &  hdl) [inline]

Definition at line 186 of file remote_shell.h.

template<class HandlerType>
moost::service::remote_shell< HandlerType >::remote_shell ( HandlerType &  hdl,
boost::shared_ptr< boost::asio::io_service >  ios 
) [inline]

Definition at line 191 of file remote_shell.h.


Member Function Documentation

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::enable_local_shell ( bool  enabled = true) [inline]

Definition at line 241 of file remote_shell.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class HandlerType>
virtual std::string moost::service::remote_shell< HandlerType >::get_prompt ( ) const [inline, virtual]

Return application prompt.

Returns:
String containing the application's prompt.

Implements moost::service::remote_shell_iface.

Definition at line 196 of file remote_shell.h.

template<class HandlerType>
virtual bool moost::service::remote_shell< HandlerType >::handle_command ( std::string &  _return,
const std::string &  cmd,
const std::string &  args 
) [inline, virtual]

Application-specific command handler.

Parameters:
_returnWrite any message to be sent back to the user to this variable.
cmdThe command entered by the user
argsAny arguments entered after the command
Returns:
Boolean indicating whether or not the command was known, not whether the command could be handled successfully. Return false if you don't implement any commands.

Implements moost::service::remote_shell_iface.

Definition at line 206 of file remote_shell.h.

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::run ( ) [inline]

Definition at line 211 of file remote_shell.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::set_appender_factory ( appender_factory_ptr  app_factory) [inline]

Definition at line 216 of file remote_shell.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::set_default_stderr_state ( bool  enabled) [inline]

Definition at line 226 of file remote_shell.h.

Here is the call graph for this function:

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::set_default_stdout_state ( bool  enabled) [inline]

Definition at line 221 of file remote_shell.h.

Here is the call graph for this function:

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::set_listen_port ( unsigned short  port) [inline]

Definition at line 231 of file remote_shell.h.

Here is the call graph for this function:

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::set_pre_shutdown_function ( boost::function0< void >  func) [inline]

Definition at line 236 of file remote_shell.h.

Here is the call graph for this function:

template<class HandlerType>
virtual std::string moost::service::remote_shell< HandlerType >::show_help ( ) const [inline, virtual]

Return command help.

Returns:
String containing usage information for the commands provided by the application's command handler. Return an empty string if you don't implement any commands.

Implements moost::service::remote_shell_iface.

Definition at line 201 of file remote_shell.h.

template<class HandlerType>
void moost::service::remote_shell< HandlerType >::stop ( const std::string &  msg) [inline]

Definition at line 246 of file remote_shell.h.

Here is the call graph for this function:


Member Data Documentation

template<class HandlerType>
HandlerType& moost::service::remote_shell< HandlerType >::m_hdl [private]

Definition at line 182 of file remote_shell.h.

template<class HandlerType>
remote_shell_server moost::service::remote_shell< HandlerType >::m_srv [private]

Definition at line 183 of file remote_shell.h.


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