Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Connection.cpp
Go to the documentation of this file.
2
3namespace joedb
4{
6 {
7 throw Exception("Content mismatch. The file and the connection have diverged, and cannot be synced by pulling or pushing.");
8 }
9
11 (
12 Readonly_Journal &client_journal,
13 bool content_check
14 )
15 {
16 return client_journal.get_checkpoint_position();
17 }
18
20 (
21 Writable_Journal &client_journal,
22 std::chrono::milliseconds wait
23 )
24 {
25 return client_journal.get_checkpoint_position();
26 }
27
29 (
30 Writable_Journal &client_journal,
31 std::chrono::milliseconds wait
32 )
33 {
34 return client_journal.get_checkpoint_position();
35 }
36
38 (
39 Readonly_Journal &client_journal,
40 std::chrono::milliseconds wait
41 )
42 {
43 return client_journal.get_checkpoint_position();
44 }
45
47 (
48 Readonly_Journal &client_journal,
49 int64_t from_checkpoint,
50 int64_t until_checkpoint,
51 bool unlock_after
52 )
53 {
54 return client_journal.get_checkpoint_position();
55 }
56
58 {
59 }
60
61 Connection::~Connection() = default;
62}
virtual int64_t pull(Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
Pull new data from the connection.
virtual int64_t lock_pull(Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
Fused lock_pull, executed at the start of a write transaction.
virtual int64_t handshake(Readonly_Journal &client_journal, bool content_check)
Called during Client construction.
virtual void unlock()
Can be used to cancel a transaction without pushing.
virtual int64_t push_until(Readonly_Journal &client_journal, int64_t from_checkpoint, int64_t until_checkpoint, bool unlock_after)
Push new data to the connection.
virtual ~Connection()
virtual int64_t get_checkpoint(Readonly_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
Get new connection checkpoint without pulling.
static void content_mismatch()
Definition Connection.cpp:5
int64_t get_checkpoint_position() const
Definition Blob.h:7