Joedb 10.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Connection.cpp
Go to the documentation of this file.
2
3namespace joedb
4{
6 {
7 }
8
10 {
11 throw Content_Mismatch();
12 }
13
15 (
16 const Readonly_Journal &client_journal,
17 Content_Check content_check
18 )
19 {
20 return client_journal.get_checkpoint();
21 }
22
24 (
25 const Readonly_Journal &client_journal,
26 Content_Check content_check,
27 int64_t from,
28 int64_t until
29 )
30 {
31 }
32
34 (
35 Lock_Action lock_action,
36 Data_Transfer data_transfer,
37 Writable_Journal &client_journal,
38 std::chrono::milliseconds wait
39 )
40 {
41 return client_journal.get_checkpoint();
42 }
43
45 (
46 const Readonly_Journal &client_journal,
47 int64_t from,
48 int64_t until,
49 Unlock_Action unlock_action
50 )
51 {
52 return client_journal.get_checkpoint();
53 }
54
56 {
57 }
58
60 {
61 return false;
62 }
63
65
66 Connection::~Connection() = default;
67}
virtual bool is_pullonly() const
virtual void check_matching_content(const Readonly_Journal &client_journal, Content_Check content_check, int64_t from, int64_t until)
Compare content of file and connection. Throw if mismatch.
static Connection dummy
Since this class has no internal state, this global variable can be used instead of creating an insta...
Definition Connection.h:116
virtual int64_t push(const Readonly_Journal &client_journal, int64_t from, int64_t until, Unlock_Action unlock_action)
Push new data to the connection.
virtual void unlock()
Unlock the connection.
virtual ~Connection()
virtual int64_t pull(Lock_Action lock_action, Data_Transfer data_transfer, Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
Pull from the connection.
static void content_mismatch()
Called by handshake when the file and the connection do not match.
Definition Connection.cpp:9
virtual int64_t handshake(const Readonly_Journal &client_journal, Content_Check content_check)
Called during Client construction.
Disconnection(const char *what_arg)
int64_t get_checkpoint() const
Data_Transfer
Definition Connection.h:28
Lock_Action
Definition Connection.h:35
Content_Check
Definition Connection.h:20
Unlock_Action
Definition Connection.h:42