libmoost
|
Public Member Functions | |
session_base (remote_shell_server_impl &srv, remote_shell_iface *rsi, bool allow_quit, bool enable_cout_cerr, bool enable_cls) | |
virtual | ~session_base () |
void | start (appender_ptr appender) |
void | stop (const std::string &msg) |
void | set_stdout_state (bool on) |
void | set_stderr_state (bool on) |
std::string | get_info () const |
void | add_stdout (const char *buffer, size_t count) |
void | add_stderr (const char *buffer, size_t count) |
void | command_result (bool handled, const std::string &cmd, const std::string &rv) |
Protected Types | |
enum | state { SESSION_CREATED, SESSION_ATTACHED, SESSION_STOPPING, SESSION_STOPPED } |
Protected Member Functions | |
virtual void | set_nodelay ()=0 |
virtual std::string | get_peer_string () const =0 |
virtual void | close ()=0 |
virtual void | read_more (char *data, size_t max)=0 |
virtual void | write_stdout (std::string *s, state st)=0 |
virtual void | write_stderr (std::string *s, state st)=0 |
void | on_write_done (std::string *s, state st, const system::error_code &error) |
void | on_read_done (const system::error_code &error, size_t bytes_transferred) |
Private Types | |
enum | { max_length = 1024 } |
Private Member Functions | |
void | read_more () |
void | write (const std::string &str) |
void | write (const std::string &str, state st) |
bool | is_attached () const |
bool | is_stopped () const |
template<typename T > | |
void | get_more_help (std::ostream &os, const T &obj) const |
void | get_help (std::string &rv) const |
void | continue_session (const std::string &str="") |
void | handle_stop () |
bool | handle_command (std::string &rv, const std::string &cmd, const std::string &args) |
bool | read_next_command (std::string &cmd, std::string &args) |
bool | log_level (std::string &rv, const std::string &args) |
void | process_input () |
Private Attributes | |
remote_shell_server_impl & | m_srv |
std::string | m_peer |
char | m_data [max_length] |
appender_ptr | m_app |
enum state | m_state |
remote_shell_iface *const | m_rsi |
std::string | m_inbuf |
bool | m_cout_on |
bool | m_cerr_on |
bool | m_processing_input |
const bool | m_allow_quit |
const bool | m_enable_cout_cerr |
const bool | m_enable_cls |
const boost::posix_time::ptime | m_t_connect |
Definition at line 328 of file remote_shell.cpp.
anonymous enum [private] |
Definition at line 451 of file remote_shell.cpp.
enum session_base::state [protected] |
Definition at line 331 of file remote_shell.cpp.
session_base::session_base | ( | remote_shell_server_impl & | srv, |
remote_shell_iface * | rsi, | ||
bool | allow_quit, | ||
bool | enable_cout_cerr, | ||
bool | enable_cls | ||
) | [inline] |
Definition at line 339 of file remote_shell.cpp.
virtual session_base::~session_base | ( | ) | [inline, virtual] |
Definition at line 353 of file remote_shell.cpp.
void session_base::add_stderr | ( | const char * | buffer, |
size_t | count | ||
) |
void session_base::add_stdout | ( | const char * | buffer, |
size_t | count | ||
) |
virtual void session_base::close | ( | ) | [protected, pure virtual] |
Implemented in session< SessionIoT, AllowQuit, EnableCLS >.
void session_base::command_result | ( | bool | handled, |
const std::string & | cmd, | ||
const std::string & | rv | ||
) |
void session_base::continue_session | ( | const std::string & | str = "" | ) | [private] |
Definition at line 703 of file remote_shell.cpp.
void session_base::get_help | ( | std::string & | rv | ) | const [private] |
Definition at line 564 of file remote_shell.cpp.
std::string session_base::get_info | ( | ) | const [inline] |
Definition at line 386 of file remote_shell.cpp.
void session_base::get_more_help | ( | std::ostream & | os, |
const T & | obj | ||
) | const [private] |
Definition at line 540 of file remote_shell.cpp.
virtual std::string session_base::get_peer_string | ( | ) | const [protected, pure virtual] |
Implemented in session< SessionIoT, AllowQuit, EnableCLS >.
bool session_base::handle_command | ( | std::string & | rv, |
const std::string & | cmd, | ||
const std::string & | args | ||
) | [private] |
Definition at line 752 of file remote_shell.cpp.
void session_base::handle_stop | ( | ) | [private] |
Definition at line 733 of file remote_shell.cpp.
bool session_base::is_attached | ( | ) | const [inline, private] |
Definition at line 428 of file remote_shell.cpp.
bool session_base::is_stopped | ( | ) | const [inline, private] |
Definition at line 433 of file remote_shell.cpp.
bool session_base::log_level | ( | std::string & | rv, |
const std::string & | args | ||
) | [private] |
void session_base::on_read_done | ( | const system::error_code & | error, |
size_t | bytes_transferred | ||
) | [protected] |
void session_base::on_write_done | ( | std::string * | s, |
state | st, | ||
const system::error_code & | error | ||
) | [protected] |
void session_base::process_input | ( | ) | [private] |
Definition at line 643 of file remote_shell.cpp.
virtual void session_base::read_more | ( | char * | data, |
size_t | max | ||
) | [protected, pure virtual] |
Implemented in session< SessionIoT, AllowQuit, EnableCLS >.
void session_base::read_more | ( | ) | [inline, private] |
Definition at line 412 of file remote_shell.cpp.
bool session_base::read_next_command | ( | std::string & | cmd, |
std::string & | args | ||
) | [private] |
Definition at line 813 of file remote_shell.cpp.
virtual void session_base::set_nodelay | ( | ) | [protected, pure virtual] |
Implemented in session< SessionIoT, AllowQuit, EnableCLS >.
void session_base::set_stderr_state | ( | bool | on | ) | [inline] |
Definition at line 381 of file remote_shell.cpp.
void session_base::set_stdout_state | ( | bool | on | ) | [inline] |
void session_base::start | ( | appender_ptr | appender | ) | [inline] |
Definition at line 357 of file remote_shell.cpp.
void session_base::stop | ( | const std::string & | msg | ) | [inline] |
void session_base::write | ( | const std::string & | str | ) | [inline, private] |
Definition at line 417 of file remote_shell.cpp.
void session_base::write | ( | const std::string & | str, |
state | st | ||
) | [inline, private] |
Definition at line 422 of file remote_shell.cpp.
virtual void session_base::write_stderr | ( | std::string * | s, |
state | st | ||
) | [protected, pure virtual] |
Implemented in session< SessionIoT, AllowQuit, EnableCLS >.
virtual void session_base::write_stdout | ( | std::string * | s, |
state | st | ||
) | [protected, pure virtual] |
Implemented in session< SessionIoT, AllowQuit, EnableCLS >.
const bool session_base::m_allow_quit [private] |
Definition at line 460 of file remote_shell.cpp.
appender_ptr session_base::m_app [private] |
Definition at line 453 of file remote_shell.cpp.
bool session_base::m_cerr_on [private] |
Definition at line 458 of file remote_shell.cpp.
bool session_base::m_cout_on [private] |
Definition at line 457 of file remote_shell.cpp.
char session_base::m_data[max_length] [private] |
Definition at line 452 of file remote_shell.cpp.
const bool session_base::m_enable_cls [private] |
Definition at line 462 of file remote_shell.cpp.
const bool session_base::m_enable_cout_cerr [private] |
Definition at line 461 of file remote_shell.cpp.
std::string session_base::m_inbuf [private] |
Definition at line 456 of file remote_shell.cpp.
std::string session_base::m_peer [private] |
Definition at line 450 of file remote_shell.cpp.
bool session_base::m_processing_input [private] |
Definition at line 459 of file remote_shell.cpp.
remote_shell_iface* const session_base::m_rsi [private] |
Definition at line 455 of file remote_shell.cpp.
remote_shell_server_impl& session_base::m_srv [private] |
Definition at line 449 of file remote_shell.cpp.
enum state session_base::m_state [private] |
Definition at line 454 of file remote_shell.cpp.
const boost::posix_time::ptime session_base::m_t_connect [private] |
Definition at line 463 of file remote_shell.cpp.