DAQ  1.0.0
Data Acquisition System (basic demo)
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Session Class Reference

#include <session.h>

Inheritance diagram for Session:
Inheritance graph
[legend]
Collaboration diagram for Session:
Collaboration graph
[legend]

Public Member Functions

 Session (boost::asio::ip::tcp::socket socket, IDataAccess *da)
 
void start ()
 

Private Member Functions

void read_header ()
 
void read_save_value_request (std::size_t b_size)
 
void read_get_values_request (std::size_t b_size)
 
void read_get_variables_request (std::size_t b_size)
 
void read_add_variable_request (std::size_t b_size)
 
void read_body (message::MessageType msg_type, std::size_t b_size)
 
void do_read ()
 
void send_msg (std::shared_ptr< uint8_t > f_buf, std::size_t f_size)
 
std::shared_ptr< std::uint8_t > build_f_msg (std::unique_ptr< std::uint8_t[]> &&h_buf, std::size_t h_size, std::unique_ptr< std::uint8_t[]> &&b_buf, std::size_t b_size)
 
std::unique_ptr< std::uint8_t[]> build_h_msg (std::size_t b_size, message::MessageType msg_type, std::size_t *out_fh_size)
 
std::unique_ptr< std::uint8_t[]> build_b_response (const std::string &msg, message::ResponseStatus status, std::size_t *out_b_size, message::MessageType *prev_msg=nullptr)
 
std::unique_ptr< std::uint8_t[]> build_b_response (std::vector< VarValue > &&values, std::size_t *out_b_size)
 
std::unique_ptr< std::uint8_t[]> build_b_response (std::vector< Variable > &&vars, std::size_t *out_b_size)
 
void send_status_response (const std::string &msg, message::ResponseStatus status, message::MessageType *prev_msg=nullptr)
 
void send_values_response (std::vector< VarValue > &&values)
 
void send_variables_response (std::vector< Variable > &&variables)
 

Private Attributes

boost::asio::ip::tcp::socket socket_
 
IDataAccessda_
 

Static Private Attributes

static constexpr size_t max_values_ammount {120}
 

Constructor & Destructor Documentation

Session::Session ( boost::asio::ip::tcp::socket  socket,
IDataAccess da 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Member Function Documentation

std::unique_ptr< std::uint8_t[]> Session::build_b_response ( const std::string &  msg,
message::ResponseStatus  status,
std::size_t *  out_b_size,
message::MessageType *  prev_msg = nullptr 
)
private
std::unique_ptr< std::uint8_t[]> Session::build_b_response ( std::vector< VarValue > &&  values,
std::size_t *  out_b_size 
)
private
std::unique_ptr< std::uint8_t[]> Session::build_b_response ( std::vector< Variable > &&  vars,
std::size_t *  out_b_size 
)
private
std::shared_ptr< std::uint8_t > Session::build_f_msg ( std::unique_ptr< std::uint8_t[]> &&  h_buf,
std::size_t  h_size,
std::unique_ptr< std::uint8_t[]> &&  b_buf,
std::size_t  b_size 
)
private
std::unique_ptr< std::uint8_t[]> Session::build_h_msg ( std::size_t  b_size,
message::MessageType  msg_type,
std::size_t *  out_fh_size 
)
private
void Session::do_read ( )
inlineprivate

Here is the call graph for this function:

Here is the caller graph for this function:

void Session::read_add_variable_request ( std::size_t  b_size)
private
void Session::read_body ( message::MessageType  msg_type,
std::size_t  b_size 
)
private
void Session::read_get_values_request ( std::size_t  b_size)
private
void Session::read_get_variables_request ( std::size_t  b_size)
private
void Session::read_header ( )
private

Here is the caller graph for this function:

void Session::read_save_value_request ( std::size_t  b_size)
private
void Session::send_msg ( std::shared_ptr< uint8_t >  f_buf,
std::size_t  f_size 
)
private
void Session::send_status_response ( const std::string &  msg,
message::ResponseStatus  status,
message::MessageType *  prev_msg = nullptr 
)
private
void Session::send_values_response ( std::vector< VarValue > &&  values)
private
void Session::send_variables_response ( std::vector< Variable > &&  variables)
private
void Session::start ( )
inline

Here is the call graph for this function:

Member Data Documentation

IDataAccess* Session::da_
private
constexpr size_t Session::max_values_ammount {120}
staticprivate
boost::asio::ip::tcp::socket Session::socket_
private

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