1#ifndef joedb_Readonly_Journal_declared
2#define joedb_Readonly_Journal_declared
12 class Writable_Journal;
37 return static_cast<int>(check) &
static_cast<int>(flag);
41 void read_checkpoint(
const std::array<int64_t, 4> &pos);
42 void pull_without_locking();
44 #define TYPE_MACRO(cpp_type, return_type, type_id, read_method, W)\
45 void perform_update_##type_id(Writable &writable);
61 #define TYPE_MACRO(cpp_type, return_type, type_id, read_method, W)\
62 void read_vector_of_##type_id(cpp_type *data, size_t size);
87 #define TYPE_MACRO(t, rt, type_id, r, w)\
89 update_last_##type_id,\
90 update_next_##type_id,\
91 update_vector_##type_id,
159 return offset == 17 || offset == 33;
virtual int64_t get_size() const
bool is_shared() const noexcept
int64_t get_position() const noexcept
virtual Writable_Journal * get_writable_journal()
static constexpr uint32_t version_number
void play_until(Writable &writable, int64_t end)
void one_step(Writable &writable)
void seek_to_checkpoint()
std::string safe_read_string()
Record_Id record_of_last_operation
Readonly_Journal(Buffered_File &file, Check check=Check::readonly)
static constexpr bool is_second_checkpoint_copy(int64_t offset)
Readonly_Journal(Journal_Construction_Lock &&lock, Check check)
int64_t get_position() const
uint32_t get_file_version() const
void replay_with_checkpoint_comments(Writable &writable)
static constexpr uint32_t compatible_version
void set_position(int64_t position)
virtual ~Readonly_Journal()=default
void replay_log(Writable &writable)
static bool check_flag(Check check, Check flag)
Async_Reader get_async_reader(int64_t start_position, int64_t until_position) const
static constexpr int64_t checkpoint_offset
bool at_end_of_file() const
Field_Id field_of_last_update
int64_t get_checkpoint_position() const
int64_t checkpoint_position
unsigned checkpoint_index
const Buffered_File & get_file() const
void play_until_checkpoint(Writable &writable)
Async_Reader get_async_blob_reader(Blob blob) const
static constexpr int64_t header_size
Async_Reader get_async_tail_reader(int64_t start_position) const
Table_Id table_of_last_operation
void default_checkpoint()