MySQL 8.0.39
Source Code Documentation
MySQLRoutingConnectionBase Class Referenceabstract

#include <connection.h>

Inheritance diagram for MySQLRoutingConnectionBase:
[legend]

Classes

struct  Stats
 

Public Types

using clock_type = std::chrono::system_clock
 
using time_point_type = clock_type::time_point
 

Public Member Functions

 MySQLRoutingConnectionBase (MySQLRoutingContext &context, std::function< void(MySQLRoutingConnectionBase *)> remove_callback)
 
virtual ~MySQLRoutingConnectionBase ()=default
 
MySQLRoutingContextcontext ()
 
const MySQLRoutingContextcontext () const
 
virtual std::string get_destination_id () const =0
 
virtual std::string get_server_address () const =0
 Returns address of server to which connection is established. More...
 
virtual void disconnect ()=0
 
virtual std::string get_client_address () const =0
 Returns address of client which connected to router. More...
 
std::size_t get_bytes_up () const
 
std::size_t get_bytes_down () const
 
time_point_type get_started () const
 
time_point_type get_connected_to_server () const
 
time_point_type get_last_sent_to_server () const
 
time_point_type get_last_received_from_server () const
 
Stats get_stats () const
 
void transfered_to_server (size_t bytes)
 
void transfered_to_client (size_t bytes)
 
void disassociate ()
 
void accepted ()
 
virtual void connected ()
 
template<class F >
auto disconnect_request (F &&f)
 
bool disconnect_requested () const
 

Protected Attributes

MySQLRoutingContextcontext_
 wrapper for common data used by all routing threads More...
 
std::function< void(MySQLRoutingConnectionBase *)> remove_callback_
 callback that is called when thread of execution completes More...
 
Monitor< Statsstats_ {{}}
 
Monitor< bool > disconnect_ {{}}
 

Member Typedef Documentation

◆ clock_type

using MySQLRoutingConnectionBase::clock_type = std::chrono::system_clock

◆ time_point_type

using MySQLRoutingConnectionBase::time_point_type = clock_type::time_point

Constructor & Destructor Documentation

◆ MySQLRoutingConnectionBase()

MySQLRoutingConnectionBase::MySQLRoutingConnectionBase ( MySQLRoutingContext context,
std::function< void(MySQLRoutingConnectionBase *)>  remove_callback 
)
inline

◆ ~MySQLRoutingConnectionBase()

virtual MySQLRoutingConnectionBase::~MySQLRoutingConnectionBase ( )
virtualdefault

Member Function Documentation

◆ accepted()

void MySQLRoutingConnectionBase::accepted ( )

◆ connected()

void MySQLRoutingConnectionBase::connected ( )
virtual

◆ context() [1/2]

MySQLRoutingContext & MySQLRoutingConnectionBase::context ( )
inline

◆ context() [2/2]

const MySQLRoutingContext & MySQLRoutingConnectionBase::context ( ) const
inline

◆ disassociate()

void MySQLRoutingConnectionBase::disassociate ( )
inline

◆ disconnect()

virtual void MySQLRoutingConnectionBase::disconnect ( )
pure virtual

◆ disconnect_request()

template<class F >
auto MySQLRoutingConnectionBase::disconnect_request ( F &&  f)
inline

◆ disconnect_requested()

bool MySQLRoutingConnectionBase::disconnect_requested ( ) const
inline

◆ get_bytes_down()

std::size_t MySQLRoutingConnectionBase::get_bytes_down ( ) const
inline

◆ get_bytes_up()

std::size_t MySQLRoutingConnectionBase::get_bytes_up ( ) const
inline

◆ get_client_address()

virtual std::string MySQLRoutingConnectionBase::get_client_address ( ) const
pure virtual

Returns address of client which connected to router.

Returns
address of client

Implemented in MysqlRoutingClassicConnectionBase, and MysqlRoutingXConnection.

◆ get_connected_to_server()

time_point_type MySQLRoutingConnectionBase::get_connected_to_server ( ) const
inline

◆ get_destination_id()

virtual std::string MySQLRoutingConnectionBase::get_destination_id ( ) const
pure virtual

◆ get_last_received_from_server()

time_point_type MySQLRoutingConnectionBase::get_last_received_from_server ( ) const
inline

◆ get_last_sent_to_server()

time_point_type MySQLRoutingConnectionBase::get_last_sent_to_server ( ) const
inline

◆ get_server_address()

virtual std::string MySQLRoutingConnectionBase::get_server_address ( ) const
pure virtual

Returns address of server to which connection is established.

Returns
address of server

Implemented in MysqlRoutingClassicConnectionBase, and MysqlRoutingXConnection.

◆ get_started()

time_point_type MySQLRoutingConnectionBase::get_started ( ) const
inline

◆ get_stats()

Stats MySQLRoutingConnectionBase::get_stats ( ) const
inline

◆ transfered_to_client()

void MySQLRoutingConnectionBase::transfered_to_client ( size_t  bytes)
inline

◆ transfered_to_server()

void MySQLRoutingConnectionBase::transfered_to_server ( size_t  bytes)
inline

Member Data Documentation

◆ context_

MySQLRoutingContext& MySQLRoutingConnectionBase::context_
protected

wrapper for common data used by all routing threads

◆ disconnect_

Monitor<bool> MySQLRoutingConnectionBase::disconnect_ {{}}
protected

◆ remove_callback_

std::function<void(MySQLRoutingConnectionBase *)> MySQLRoutingConnectionBase::remove_callback_
protected

callback that is called when thread of execution completes

◆ stats_

Monitor<Stats> MySQLRoutingConnectionBase::stats_ {{}}
protected

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