Joedb 9.1.4
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 journal;
15 Database database;
16
17 public:
18 Readonly_Database_Client_Data(Buffered_File &file):
19 journal(file)
20 {
21 }
22 };
23 };
24
25 /// @ingroup concurrency
27 protected detail::Readonly_Database_Client_Data,
28 public Client
29 {
30 protected:
31 void read_journal() override {journal.play_until_checkpoint(database);}
32
33 public:
35 (
36 Buffered_File &file,
37 Connection &connection,
38 bool content_check = true
39 ):
40 Readonly_Database_Client_Data(file),
41 Client(journal, connection, content_check)
42 {
44 }
45
46 const Database &get_database() const
47 {
48 return database;
49 }
50 };
51}
52
53#endif
Handle concurrent access to a file with a joedb::Connection.
Definition Client.h:12
Readonly_Database_Client(Buffered_File &file, Connection &connection, bool content_check=true)
Definition Blob.h:7