Joedb 10.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Server_Connection.h
Go to the documentation of this file.
1#ifndef joedb_Server_Connection_declared
2#define joedb_Server_Connection_declared
3
6
7namespace joedb
8{
9 /// @ingroup concurrency
11 {
12 public:
14 (
17 std::chrono::milliseconds keep_alive_interval = std::chrono::seconds(0)
18 ):
19 Server_Client(channel, logger, keep_alive_interval)
20 {
21 }
22
23 size_t pread(char *data, size_t size, int64_t offset) const;
24
25 int64_t handshake
26 (
27 const Readonly_Journal &client_journal,
28 Content_Check content_check
29 ) override;
30
32 (
33 const Readonly_Journal &client_journal,
34 Content_Check content_check,
35 int64_t from,
36 int64_t until
37 ) override;
38
39 int64_t pull
40 (
41 Lock_Action lock_action,
42 Data_Transfer data_transfer,
43 Writable_Journal &client_journal,
44 std::chrono::milliseconds wait = std::chrono::milliseconds(0)
45 ) override;
46
47 int64_t push
48 (
49 const Readonly_Journal &client_journal,
50 int64_t from,
51 int64_t until,
52 Unlock_Action unlock_action
53 ) override;
54
55 void unlock() override;
56
57 bool is_pullonly() const override
58 {
59 return this->pullonly_server;
60 }
61 };
62}
63
64#endif
Connection()=default
static Logger dummy_logger
Definition Logger.h:14
Thread_Safe< Channel & > channel
Server_Client(Channel &channel, Logger &logger=Logger::dummy_logger, std::chrono::milliseconds keep_alive_interval=std::chrono::milliseconds(0))
int64_t pull(Lock_Action lock_action, Data_Transfer data_transfer, Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0)) override
Pull from the connection.
void unlock() override
Unlock the connection.
int64_t handshake(const Readonly_Journal &client_journal, Content_Check content_check) override
Called during Client construction.
bool is_pullonly() const override
Server_Connection(Channel &channel, Logger &logger=Logger::dummy_logger, std::chrono::milliseconds keep_alive_interval=std::chrono::seconds(0))
size_t pread(char *data, size_t size, int64_t offset) const
int64_t push(const Readonly_Journal &client_journal, int64_t from, int64_t until, Unlock_Action unlock_action) override
Push new data to the connection.
void check_matching_content(const Readonly_Journal &client_journal, Content_Check content_check, int64_t from, int64_t until) override
Compare content of file and connection. Throw if mismatch.
Data_Transfer
Definition Connection.h:28
Lock_Action
Definition Connection.h:35
Content_Check
Definition Connection.h:20
Unlock_Action
Definition Connection.h:42