Joedb 9.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 "Content mismatch: the file and the connection have diverged"
8 )
9 {
10 }
11
13 {
14 throw Content_Mismatch();
15 }
16
18 (
19 const Readonly_Journal &client_journal,
20 Content_Check content_check
21 )
22 {
23 return client_journal.get_checkpoint();
24 }
25
27 (
28 Lock_Action lock_action,
29 Data_Transfer data_transfer,
30 Writable_Journal &client_journal,
31 std::chrono::milliseconds wait
32 )
33 {
34 return client_journal.get_checkpoint();
35 }
36
38 (
39 const Readonly_Journal &client_journal,
40 int64_t from,
41 int64_t until,
42 Unlock_Action unlock_action
43 )
44 {
45 return client_journal.get_checkpoint();
46 }
47
49 {
50 }
51
53 {
54 return false;
55 }
56
57 Connection::~Connection() = default;
58}
virtual bool is_pullonly() const
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.
virtual int64_t handshake(const Readonly_Journal &client_journal, Content_Check content_check)
Called during Client construction.
int64_t get_checkpoint() const
Data_Transfer
Definition Connection.h:27
Lock_Action
Definition Connection.h:34
Content_Check
Definition Connection.h:19
Unlock_Action
Definition Connection.h:41
Definition Blob.h:7