#include <MariaDBConnection.h>
Public Member Functions | |
| MariaDBConnection (MariaDBClient *mariaDBClient, const MariaDBConnectionDetails &connectionDetails, const std::function< void(const MariaDBState &)> &onStateChanged) | |
| MariaDBConnection (const MariaDBConnection &)=delete | |
| ~MariaDBConnection () override | |
| MariaDBConnection & | operator= (const MariaDBConnection &)=delete |
| MariaDBCommandSequence & | execute_async (MariaDBCommandSequence &&commandSequence) |
| void | execute_sync (MariaDBCommand *mariaDBCommand) |
| void | commandStart (const utils::Timeval ¤tTime) |
| void | commandContinue (int status) |
| void | commandCompleted () |
| void | unmanaged () |
Protected Member Functions | |
| void | checkStatus (int status) |
| void | readEvent () override |
| void | writeEvent () override |
| void | outOfBandEvent () override |
| void | readTimeout () override |
| void | writeTimeout () override |
| void | outOfBandTimeout () override |
| void | unobservedEvent () override |
Private Attributes | |
| MariaDBClient * | mariaDBClient |
| MYSQL * | mysql |
| const std::string | connectionName |
| std::deque< MariaDBCommandSequence > | commandSequenceQueue |
| MariaDBCommand * | currentCommand = nullptr |
| bool | connected = false |
| MariaDBCommandStartEvent | commandStartEvent |
| std::function< void(const MariaDBState &)> | onStateChanged |
Additional Inherited Members | |
| Private Member Functions inherited from core::eventreceiver::ReadEventReceiver | |
| ReadEventReceiver (const std::string &name, const utils::Timeval &timeout) | |
| Private Member Functions inherited from core::DescriptorEventReceiver | |
| DescriptorEventReceiver (const std::string &name, DescriptorEventPublisher &descriptorEventPublisher, const utils::Timeval &timeout=TIMEOUT::DISABLE) | |
| int | getRegisteredFd () const |
| bool | isEnabled () const |
| bool | isSuspended () const |
| void | setTimeout (const utils::Timeval &timeout) |
| utils::Timeval | getTimeout (const utils::Timeval ¤tTime) const |
| void | checkTimeout (const utils::Timeval ¤tTime) |
| bool | enable (int fd) |
| void | disable () |
| void | suspend () |
| void | resume () |
| Private Member Functions inherited from core::EventReceiver | |
| EventReceiver (const std::string &name) | |
| EventReceiver (EventReceiver &)=delete | |
| EventReceiver (EventReceiver &&)=delete | |
| EventReceiver & | operator= (EventReceiver &)=delete |
| EventReceiver & | operator= (EventReceiver &&)=delete |
| virtual void | destruct () |
| void | span () |
| void | relax () |
| const std::string & | getName () const |
| virtual | ~EventReceiver ()=default |
| Private Member Functions inherited from core::eventreceiver::WriteEventReceiver | |
| WriteEventReceiver (const std::string &name, const utils::Timeval &timeout) | |
| Private Member Functions inherited from core::eventreceiver::ExceptionalConditionEventReceiver | |
| ExceptionalConditionEventReceiver (const std::string &name, const utils::Timeval &timeout=60) | |
| Static Private Member Functions inherited from core::EventReceiver | |
| static void | atNextTick (const std::function< void(void)> &callBack) |
Definition at line 88 of file MariaDBConnection.h.
|
explicit |
Definition at line 62 of file MariaDBConnection.cpp.
References commandStartEvent, connectionName, database::mariadb::MariaDBConnectionDetails::connectionName, core::DescriptorEventReceiver::TIMEOUT::DISABLE, database::mariadb::MariaDBCommandSequence::execute_async(), execute_async(), mariaDBClient, database::mariadb::MariaDBCommandSequence::MariaDBCommandSequence(), and MariaDBConnection().
Referenced by MariaDBConnection().
|
delete |
|
override |
Definition at line 114 of file MariaDBConnection.cpp.
References database::mariadb::MariaDBClient::connectionVanished(), and mariaDBClient.
|
protected |
Definition at line 213 of file MariaDBConnection.cpp.
References database::mariadb::MariaDBCommand::commandCompleted(), commandCompleted(), database::mariadb::MariaDBCommand::commandError(), commandStartEvent, connected, currentCommand, core::DescriptorEventReceiver::TIMEOUT::DEFAULT, core::DescriptorEventReceiver::isEnabled(), core::DescriptorEventReceiver::isSuspended(), core::DescriptorEventReceiver::resume(), core::DescriptorEventReceiver::setTimeout(), core::EventReceiver::span(), and core::DescriptorEventReceiver::suspend().
Referenced by commandContinue(), and commandStart().
| void database::mariadb::MariaDBConnection::commandCompleted | ( | ) |
Definition at line 185 of file MariaDBConnection.cpp.
References database::mariadb::MariaDBCommand::commandInfo(), connectionName, and currentCommand.
Referenced by checkStatus().
| void database::mariadb::MariaDBConnection::commandContinue | ( | int | status | ) |
Definition at line 175 of file MariaDBConnection.cpp.
References checkStatus(), database::mariadb::MariaDBCommand::commandContinue(), currentCommand, and core::DescriptorEventReceiver::disable().
Referenced by outOfBandEvent(), outOfBandTimeout(), readEvent(), readTimeout(), writeEvent(), and writeTimeout().
| void database::mariadb::MariaDBConnection::commandStart | ( | const utils::Timeval & | currentTime | ) |
Definition at line 156 of file MariaDBConnection.cpp.
References checkStatus(), database::mariadb::MariaDBCommand::commandInfo(), database::mariadb::MariaDBCommand::commandStart(), connectionName, currentCommand, core::DescriptorEventReceiver::disable(), core::DescriptorEventReceiver::isEnabled(), core::DescriptorEventReceiver::isSuspended(), mariaDBClient, core::DescriptorEventReceiver::resume(), and database::mariadb::MariaDBCommand::setMariaDBConnection().
Referenced by database::mariadb::MariaDBCommandStartEvent::onEvent().
| MariaDBCommandSequence & database::mariadb::MariaDBConnection::execute_async | ( | MariaDBCommandSequence && | commandSequence | ) |
Definition at line 133 of file MariaDBConnection.cpp.
References commandStartEvent, and core::EventReceiver::span().
Referenced by database::mariadb::MariaDBClient::execute_async(), and MariaDBConnection().
| void database::mariadb::MariaDBConnection::execute_sync | ( | MariaDBCommand * | mariaDBCommand | ) |
Definition at line 143 of file MariaDBConnection.cpp.
References database::mariadb::MariaDBCommand::commandCompleted(), database::mariadb::MariaDBCommand::commandError(), database::mariadb::MariaDBCommand::commandStart(), and utils::Timeval::currentTime().
Referenced by database::mariadb::MariaDBClient::execute_sync().
|
delete |
|
overrideprotectedvirtual |
Implements core::eventreceiver::ExceptionalConditionEventReceiver.
Definition at line 276 of file MariaDBConnection.cpp.
References commandContinue().
|
overrideprotectedvirtual |
Reimplemented from core::eventreceiver::ExceptionalConditionEventReceiver.
Definition at line 288 of file MariaDBConnection.cpp.
References commandContinue().
|
overrideprotectedvirtual |
Implements core::eventreceiver::ReadEventReceiver.
Definition at line 268 of file MariaDBConnection.cpp.
References commandContinue().
|
overrideprotectedvirtual |
Reimplemented from core::eventreceiver::ReadEventReceiver.
Definition at line 280 of file MariaDBConnection.cpp.
References commandContinue().
| void database::mariadb::MariaDBConnection::unmanaged | ( | ) |
Definition at line 197 of file MariaDBConnection.cpp.
References core::DescriptorEventReceiver::disable(), core::DescriptorEventReceiver::isEnabled(), and mariaDBClient.
Referenced by database::mariadb::MariaDBClient::~MariaDBClient().
|
overrideprotectedvirtual |
Implements core::Observer.
Definition at line 292 of file MariaDBConnection.cpp.
References connectionName, and mariaDBClient.
|
overrideprotectedvirtual |
Implements core::eventreceiver::WriteEventReceiver.
Definition at line 272 of file MariaDBConnection.cpp.
References commandContinue().
|
overrideprotectedvirtual |
Reimplemented from core::eventreceiver::WriteEventReceiver.
Definition at line 284 of file MariaDBConnection.cpp.
References commandContinue().
|
private |
Definition at line 129 of file MariaDBConnection.h.
|
private |
Definition at line 134 of file MariaDBConnection.h.
Referenced by checkStatus(), execute_async(), and MariaDBConnection().
|
private |
Definition at line 132 of file MariaDBConnection.h.
Referenced by checkStatus().
|
private |
Definition at line 127 of file MariaDBConnection.h.
Referenced by commandCompleted(), commandStart(), MariaDBConnection(), and unobservedEvent().
|
private |
Definition at line 131 of file MariaDBConnection.h.
Referenced by checkStatus(), commandCompleted(), commandContinue(), and commandStart().
|
private |
Definition at line 125 of file MariaDBConnection.h.
Referenced by commandStart(), MariaDBConnection(), unmanaged(), unobservedEvent(), and ~MariaDBConnection().
|
private |
Definition at line 126 of file MariaDBConnection.h.
|
private |
Definition at line 136 of file MariaDBConnection.h.