MySQL 8.4.2
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 read_only_destination_id () const
 
virtual std::string read_write_destination_id () const
 
virtual std::optional< net::ip::tcp::endpointdestination_endpoint () const =0
 
virtual std::optional< net::ip::tcp::endpointread_only_destination_endpoint () const
 
virtual std::optional< net::ip::tcp::endpointread_write_destination_endpoint () const
 
virtual net::impl::socket::native_handle_type get_client_fd () 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 Member Functions

void log_connection_summary ()
 

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_ {{}}
 

Private Attributes

net::impl::socket::native_handle_type client_fd_
 
std::string client_id_
 
std::string server_id_
 

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

◆ destination_endpoint()

virtual std::optional< net::ip::tcp::endpoint > MySQLRoutingConnectionBase::destination_endpoint ( ) const
pure virtual

◆ 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_client_fd()

virtual net::impl::socket::native_handle_type MySQLRoutingConnectionBase::get_client_fd ( ) const
pure virtual

◆ 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

◆ log_connection_summary()

void MySQLRoutingConnectionBase::log_connection_summary ( )
protected

◆ read_only_destination_endpoint()

virtual std::optional< net::ip::tcp::endpoint > MySQLRoutingConnectionBase::read_only_destination_endpoint ( ) const
inlinevirtual

◆ read_only_destination_id()

virtual std::string MySQLRoutingConnectionBase::read_only_destination_id ( ) const
inlinevirtual

◆ read_write_destination_endpoint()

virtual std::optional< net::ip::tcp::endpoint > MySQLRoutingConnectionBase::read_write_destination_endpoint ( ) const
inlinevirtual

◆ read_write_destination_id()

virtual std::string MySQLRoutingConnectionBase::read_write_destination_id ( ) const
inlinevirtual

◆ 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

◆ client_fd_

net::impl::socket::native_handle_type MySQLRoutingConnectionBase::client_fd_
private

◆ client_id_

std::string MySQLRoutingConnectionBase::client_id_
private

◆ 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

◆ server_id_

std::string MySQLRoutingConnectionBase::server_id_
private

◆ stats_

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

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