Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Readonly_Database_Client.h
Go to the documentation of this file.
1#ifndef joedb_Readonly_Database_Client_declared
2#define joedb_Readonly_Database_Client_declared
3
6
7namespace joedb
8{
9 namespace detail
10 {
11 class Readonly_Database_Client_Data
12 {
13 protected:
14 Readonly_Journal data_journal;
15 Database database;
16
17 public:
18 Readonly_Database_Client_Data(Buffered_File &file):
19 data_journal(file)
20 {
21 }
22 };
23 };
24
25 /// @ingroup concurrency
27 protected detail::Readonly_Database_Client_Data,
28 public Readonly_Client
29 {
30 protected:
31 void read_journal() override
32 {
33 data_journal.play_until_checkpoint(database);
34 }
35
36 public:
38 (
39 Buffered_File &file,
42 ):
43 Readonly_Database_Client_Data(file),
44 Readonly_Client(data_journal, connection, content_check)
45 {
47 }
48
49 const Database &get_database() const
50 {
51 return database;
52 }
53 };
54}
55
56#endif
Connection & connection
Definition Client.h:16
Specialized client for read-only files.
Readonly_Database_Client(Buffered_File &file, Connection &connection, Content_Check content_check=Content_Check::quick)
Content_Check
Definition Connection.h:19
Definition Blob.h:7