SNode.C
Loading...
Searching...
No Matches
MariaDBClient.h
Go to the documentation of this file.
1/*
2 * SNode.C - a slim toolkit for network communication
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2020, 2021, 2022, 2023, 2024, 2025
5 * 2021, 2022 Daniel Flockert
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published
9 * by the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef DATABASE_MARIADB_MARIADBCLIENT
22#define DATABASE_MARIADB_MARIADBCLIENT
23
24#ifdef __GNUC__
25#pragma GCC diagnostic push
26#ifdef __has_warning
27#if __has_warning("-Wreserved-macro-identifier")
28#pragma GCC diagnostic ignored "-Wreserved-macro-identifier"
29#endif
30#endif
31#endif
32#include "database/mariadb/MariaDBClientASyncAPI.h"
33#include "database/mariadb/MariaDBClientSyncAPI.h"
34#include "database/mariadb/MariaDBConnectionDetails.h" // IWYU pragma: export
35#ifdef __GCC__
36#pragma GCC diagnostic pop
37#endif
38
39namespace database::mariadb {
41} // namespace database::mariadb
42
43#ifndef DOXYGEN_SHOULD_SKIP_THIS
44
45#ifdef __GNUC__
46#pragma GCC diagnostic push
47#ifdef __has_warning
48#if __has_warning("-Wreserved-macro-identifier")
49#pragma GCC diagnostic ignored "-Wreserved-macro-identifier"
50#endif
51#endif
52#endif
53#ifdef __GNUC__
54#pragma GCC diagnostic pop
55#endif
56
57#endif /* DOXYGEN_SHOULD_SKIP_THIS */
58
59namespace database::mariadb {
60
63 , public MariaDBClientSyncAPI {
64 public:
65 explicit MariaDBClient(const MariaDBConnectionDetails& details);
66 ~MariaDBClient() override;
67
68 private:
70 void execute_sync(MariaDBCommandSync* mariaDBCommand) final;
71
72 void connectionVanished();
73
75
77
78 friend class MariaDBConnection;
79 };
80
81} // namespace database::mariadb
82
83#endif // DATABASE_MARIADB_MARIADBCLIENT
void * operator new(std::size_t count)=delete
static void init(int argc, char *argv[])
Definition SNodeC.cpp:32
~SNodeC()=delete
static TickStatus tick(const utils::Timeval &timeOut=0)
Definition SNodeC.cpp:46
static void free()
Definition SNodeC.cpp:50
static void stop()
Definition SNodeC.cpp:42
SNodeC()=delete
static State state()
Definition SNodeC.cpp:54
static int start(const utils::Timeval &timeOut={LONG_MAX, 0})
Definition SNodeC.cpp:38
Timer(Timer &&timer) noexcept
Definition Timer.cpp:36
virtual ~Timer()
Definition Timer.cpp:56
Timer & operator=(Timer &&timer) noexcept
Definition Timer.cpp:45
Timer(core::TimerEventReceiver *timerEventReceiver)
Definition Timer.cpp:30
void restart()
Definition Timer.cpp:68
TimerEventReceiver * timerEventReceiver
Definition Timer.h:51
void cancel()
Definition Timer.cpp:62
void removeTimerEventReceiver()
Definition Timer.cpp:74
Timer()=default
Timer & operator=(const Timer &)=delete
Timer & operator=(Timer &&timer) noexcept=default
static Timer singleshotTimer(const std::function< void()> &dispatcher, const utils::Timeval &timeout)
Definition Timer.cpp:35
~Timer() override
Definition Timer.cpp:32
static Timer intervalTimer(const std::function< void(const std::function< void()> &)> &dispatcher, const utils::Timeval &timeout)
Definition Timer.cpp:39
static Timer intervalTimer(const std::function< void()> &dispatcher, const utils::Timeval &timeout)
Definition Timer.cpp:43
MariaDBClient(const MariaDBConnectionDetails &details)
void execute_sync(MariaDBCommandSync *mariaDBCommand) final
MariaDBCommandSequence & execute_async(MariaDBCommand *mariaDBCommand) final
MariaDBConnection * mariaDBConnection
MariaDBConnectionDetails details
int main(int argc, char *argv[])
Definition Timer.h:37
TickStatus
Definition TickStatus.h:29
State
Definition State.h:29
State eventLoopState()
Definition State.cpp:30