MySQL 8.0.39
Source Code Documentation
server_mock::DuktapeStatementReader Class Reference

#include <duktape_statement_reader.h>

Inheritance diagram for server_mock::DuktapeStatementReader:
[legend]

Classes

struct  Pimpl
 

Public Types

enum class  HandshakeState { INIT , GREETED , AUTH_SWITCHED , DONE }
 

Public Member Functions

 DuktapeStatementReader (std::string filename, std::vector< std::string > module_prefixes, std::map< std::string, std::function< std::string()> > session_data, std::shared_ptr< MockServerGlobalScope > shared_globals)
 
 DuktapeStatementReader (const DuktapeStatementReader &)=delete
 
 DuktapeStatementReader (DuktapeStatementReader &&)
 
DuktapeStatementReaderoperator= (const DuktapeStatementReader &)=delete
 
DuktapeStatementReaderoperator= (DuktapeStatementReader &&)
 
void handle_statement (const std::string &statement, ProtocolBase *protocol) override
 handle the clients statement More...
 
std::chrono::microseconds get_default_exec_time () override
 Returns the default execution time in microseconds. More...
 
 ~DuktapeStatementReader () override
 
std::vector< AsyncNoticeget_async_notices () override
 
stdx::expected< classic_protocol::message::server::Greeting, std::error_code > server_greeting (bool with_tls) override
 
stdx::expected< handshake_data, ErrorResponsehandshake () override
 
std::chrono::microseconds server_greeting_exec_time () override
 
void set_session_ssl_info (const SSL *ssl) override
 
- Public Member Functions inherited from server_mock::StatementReaderBase
 StatementReaderBase ()=default
 
 StatementReaderBase (const StatementReaderBase &)=default
 
 StatementReaderBase (StatementReaderBase &&)=default
 
StatementReaderBaseoperator= (const StatementReaderBase &)=default
 
StatementReaderBaseoperator= (StatementReaderBase &&)=default
 
virtual ~StatementReaderBase ()=default
 

Private Attributes

std::unique_ptr< Pimplpimpl_
 
bool has_notices_ {false}
 
HandshakeState handshake_state_ {HandshakeState::INIT}
 

Member Enumeration Documentation

◆ HandshakeState

Enumerator
INIT 
GREETED 
AUTH_SWITCHED 
DONE 

Constructor & Destructor Documentation

◆ DuktapeStatementReader() [1/3]

server_mock::DuktapeStatementReader::DuktapeStatementReader ( std::string  filename,
std::vector< std::string >  module_prefixes,
std::map< std::string, std::function< std::string()> >  session_data,
std::shared_ptr< MockServerGlobalScope shared_globals 
)

◆ DuktapeStatementReader() [2/3]

server_mock::DuktapeStatementReader::DuktapeStatementReader ( const DuktapeStatementReader )
delete

◆ DuktapeStatementReader() [3/3]

server_mock::DuktapeStatementReader::DuktapeStatementReader ( DuktapeStatementReader &&  )
default

◆ ~DuktapeStatementReader()

server_mock::DuktapeStatementReader::~DuktapeStatementReader ( )
override

Member Function Documentation

◆ get_async_notices()

std::vector< AsyncNotice > server_mock::DuktapeStatementReader::get_async_notices ( )
overridevirtual

◆ get_default_exec_time()

std::chrono::microseconds server_mock::DuktapeStatementReader::get_default_exec_time ( )
overridevirtual

Returns the default execution time in microseconds.

If no default execution time is provided in json file, then 0 microseconds is returned.

Implements server_mock::StatementReaderBase.

◆ handle_statement()

void server_mock::DuktapeStatementReader::handle_statement ( const std::string &  statement,
ProtocolBase protocol 
)
overridevirtual

handle the clients statement

Parameters
statementstatement-text of the current clients COM_QUERY/StmtExecute
protocolprotocol to send response to

Implements server_mock::StatementReaderBase.

◆ handshake()

stdx::expected< DuktapeStatementReader::handshake_data, ErrorResponse > server_mock::DuktapeStatementReader::handshake ( )
overridevirtual

◆ operator=() [1/2]

DuktapeStatementReader & server_mock::DuktapeStatementReader::operator= ( const DuktapeStatementReader )
delete

◆ operator=() [2/2]

DuktapeStatementReader & server_mock::DuktapeStatementReader::operator= ( DuktapeStatementReader &&  )
default

◆ server_greeting()

stdx::expected< classic_protocol::message::server::Greeting, std::error_code > server_mock::DuktapeStatementReader::server_greeting ( bool  with_tls)
overridevirtual

◆ server_greeting_exec_time()

std::chrono::microseconds server_mock::DuktapeStatementReader::server_greeting_exec_time ( )
overridevirtual

◆ set_session_ssl_info()

void server_mock::DuktapeStatementReader::set_session_ssl_info ( const SSL *  ssl)
overridevirtual

Member Data Documentation

◆ handshake_state_

HandshakeState server_mock::DuktapeStatementReader::handshake_state_ {HandshakeState::INIT}
private

◆ has_notices_

bool server_mock::DuktapeStatementReader::has_notices_ {false}
private

◆ pimpl_

std::unique_ptr<Pimpl> server_mock::DuktapeStatementReader::pimpl_
private

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