libmoost
session_base Class Reference
Inheritance diagram for session_base:
Collaboration diagram for session_base:

List of all members.

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_implm_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

Detailed Description

Definition at line 328 of file remote_shell.cpp.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
max_length 

Definition at line 451 of file remote_shell.cpp.

enum session_base::state [protected]
Enumerator:
SESSION_CREATED 
SESSION_ATTACHED 
SESSION_STOPPING 
SESSION_STOPPED 

Definition at line 331 of file remote_shell.cpp.


Constructor & Destructor Documentation

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.


Member Function Documentation

void session_base::add_stderr ( const char *  buffer,
size_t  count 
)

Definition at line 526 of file remote_shell.cpp.

Here is the caller graph for this function:

void session_base::add_stdout ( const char *  buffer,
size_t  count 
)

Definition at line 514 of file remote_shell.cpp.

Here is the caller graph for this function:

virtual void session_base::close ( ) [protected, pure virtual]
void session_base::command_result ( bool  handled,
const std::string &  cmd,
const std::string &  rv 
)

Definition at line 687 of file remote_shell.cpp.

Here is the caller graph for this function:

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.

template<typename T >
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]
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]

Definition at line 630 of file remote_shell.cpp.

Here is the caller graph for this function:

void session_base::on_write_done ( std::string *  s,
state  st,
const system::error_code &  error 
) [protected]

Definition at line 599 of file remote_shell.cpp.

Here is the caller graph for this function:

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]
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 >.

Here is the caller graph for this function:

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]

Definition at line 376 of file remote_shell.cpp.

Here is the caller graph for this function:

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]

Definition at line 368 of file remote_shell.cpp.

Here is the caller graph for this function:

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]
virtual void session_base::write_stdout ( std::string *  s,
state  st 
) [protected, pure virtual]

Member Data Documentation

const bool session_base::m_allow_quit [private]

Definition at line 460 of file remote_shell.cpp.

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.

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.

Definition at line 459 of file remote_shell.cpp.

Definition at line 455 of file remote_shell.cpp.

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.


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