SNode.C
Loading...
Searching...
No Matches
database::mariadb::commands::async::MariaDBFetchRowCommand Class Reference

#include <MariaDBFetchRowCommand.h>

Inheritance diagram for database::mariadb::commands::async::MariaDBFetchRowCommand:
Collaboration diagram for database::mariadb::commands::async::MariaDBFetchRowCommand:

Public Member Functions

 MariaDBFetchRowCommand (MYSQL_RES *&result, const std::function< void(const MYSQL_ROW)> &onRow, const std::function< void(const std::string &, unsigned int)> &onError)
Public Member Functions inherited from database::mariadb::MariaDBCommandASync
 ~MariaDBCommandASync () override
 MariaDBCommand (const std::string &name, const std::function< void(const std::string &, unsigned int)> &onError)
Public Member Functions inherited from database::mariadb::MariaDBCommand
 MariaDBCommand (const std::string &name, const std::function< void(const std::string &, unsigned int)> &onError)
virtual ~MariaDBCommand ()=default
const std::string & commandName ()
int commandStart (MYSQL *mysql, const utils::Timeval &currentTime)
void setMariaDBConnection (MariaDBConnection *mariaDBConnection)
virtual std::string commandInfo ()

Private Member Functions

int commandStart () override
int commandContinue (int status) override
bool commandCompleted () override
void commandError (const std::string &errorString, unsigned int errorNumber) override

Private Attributes

MYSQL_RES *& result
MYSQL_ROW row = nullptr
std::function< void(const MYSQL_ROW)> onRow

Additional Inherited Members

Protected Attributes inherited from database::mariadb::MariaDBCommand
MYSQL * mysql = nullptr
const std::function< void(const std::string &, unsigned int)> onError

Detailed Description

Definition at line 54 of file MariaDBFetchRowCommand.h.

Constructor & Destructor Documentation

◆ MariaDBFetchRowCommand()

database::mariadb::commands::async::MariaDBFetchRowCommand::MariaDBFetchRowCommand ( MYSQL_RES *& result,
const std::function< void(const MYSQL_ROW)> & onRow,
const std::function< void(const std::string &, unsigned int)> & onError )

Definition at line 51 of file MariaDBFetchRowCommand.cpp.

54 : MariaDBCommandASync("FetchRow", onError)
55 , result(result)
56 , onRow(onRow) {
57 }
const std::function< void(const std::string &, unsigned int)> onError

References MariaDBFetchRowCommand().

Referenced by MariaDBFetchRowCommand().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ commandCompleted()

bool database::mariadb::commands::async::MariaDBFetchRowCommand::commandCompleted ( )
overrideprivatevirtual

Implements database::mariadb::MariaDBCommand.

Definition at line 74 of file MariaDBFetchRowCommand.cpp.

74 {
75 onRow(row);
76
77 return row == nullptr;
78 }

◆ commandContinue()

int database::mariadb::commands::async::MariaDBFetchRowCommand::commandContinue ( int status)
overrideprivatevirtual

Implements database::mariadb::MariaDBCommand.

Definition at line 70 of file MariaDBFetchRowCommand.cpp.

70 {
71 return mysql_fetch_row_cont(&row, result, status);
72 }

◆ commandError()

void database::mariadb::commands::async::MariaDBFetchRowCommand::commandError ( const std::string & errorString,
unsigned int errorNumber )
overrideprivatevirtual

Implements database::mariadb::MariaDBCommand.

Definition at line 80 of file MariaDBFetchRowCommand.cpp.

80 {
81 onError(errorString, errorNumber);
82 }

◆ commandStart()

int database::mariadb::commands::async::MariaDBFetchRowCommand::commandStart ( )
overrideprivatevirtual

Implements database::mariadb::MariaDBCommand.

Definition at line 59 of file MariaDBFetchRowCommand.cpp.

59 {
60 int ret = 0;
61 row = nullptr;
62
63 if (result != nullptr) {
64 ret = mysql_fetch_row_start(&row, result);
65 }
66
67 return ret;
68 }

Member Data Documentation

◆ onRow

std::function<void(const MYSQL_ROW)> database::mariadb::commands::async::MariaDBFetchRowCommand::onRow
private

Definition at line 69 of file MariaDBFetchRowCommand.h.

◆ result

MYSQL_RES*& database::mariadb::commands::async::MariaDBFetchRowCommand::result
private

Definition at line 66 of file MariaDBFetchRowCommand.h.

◆ row

MYSQL_ROW database::mariadb::commands::async::MariaDBFetchRowCommand::row = nullptr
private

Definition at line 67 of file MariaDBFetchRowCommand.h.


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