Joedb 9.1.3
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
joedb::Readonly_Journal Class Reference

#include <joedb/journal/Readonly_Journal.h>

Inheritance diagram for joedb::Readonly_Journal:
Inheritance graph
[legend]
Collaboration diagram for joedb::Readonly_Journal:
Collaboration graph
[legend]

Public Types

enum class  Check {
  joedb = 1 , version = 2 , big_size = 4 , small_size = 8 ,
  set_checkpoint = 16 , checkpoint_mismatch = 32 , all = joedb | version | big_size | small_size | checkpoint_mismatch , readonly = joedb | version | small_size ,
  overwrite = all & ~big_size & ~checkpoint_mismatch , none = set_checkpoint
}
 

Public Member Functions

 Readonly_Journal (Journal_Construction_Lock &lock, Check check)
 
 Readonly_Journal (Journal_Construction_Lock &&lock, Check check)
 
 Readonly_Journal (Buffered_File &file, Check check=Check::readonly)
 
uint32_t get_file_version () const
 
bool at_end_of_file () const
 
int64_t get_position () const
 
int64_t get_checkpoint_position () const
 
bool is_empty () const
 
bool is_shared () const
 
void pull ()
 
const Buffered_Fileget_file () const
 
void replay_log (Writable &writable)
 
void replay_with_checkpoint_comments (Writable &writable)
 
void rewind ()
 
void set_position (int64_t position)
 
void one_step (Writable &writable)
 
void play_until (Writable &writable, int64_t end)
 
void play_until_checkpoint (Writable &writable)
 
void seek_to_checkpoint ()
 
Async_Reader get_async_tail_reader (int64_t start_position) const
 
Async_Reader get_async_reader (int64_t start_position, int64_t until_position) const
 
Async_Reader get_async_blob_reader (Blob blob) const
 
virtual Writable_Journalget_writable_journal ()
 
virtual ~Readonly_Journal ()=default
 

Static Public Member Functions

static bool check_flag (Check check, Check flag)
 
static constexpr bool is_second_checkpoint_copy (int64_t offset)
 

Static Public Attributes

static constexpr uint32_t version_number = 0x00000004
 
static constexpr uint32_t compatible_version = 0x00000004
 
static constexpr int64_t header_size = 41
 
static constexpr int64_t checkpoint_offset = 5 + 4
 

Protected Types

enum class  operation_t : uint8_t {
  create_table = 0x01 , drop_table = 0x02 , add_field = 0x03 , drop_field = 0x04 ,
  insert_into = 0x05 , delete_from = 0x06 , update = 0x07 , append = 0x08 ,
  update_last = 0x09 , comment = 0x0a , timestamp = 0x0b , rename_table = 0x0c ,
  rename_field = 0x0d , valid_data = 0x0e , insert_vector = 0x0f , custom = 0x10 ,
  update_vector = 0x11 , update_next = 0x12 , blob = 0x13 , updates = 0x80 ,
  TYPE_MACRO
}
 

Protected Member Functions

Type read_type ()
 
std::string safe_read_string ()
 

Protected Attributes

Buffered_Filefile
 
uint32_t file_version
 
unsigned checkpoint_index
 
int64_t checkpoint_position
 
Table_Id table_of_last_operation
 
Record_Id record_of_last_operation
 
Field_Id field_of_last_update
 

Friends

class Writable_Journal
 
class Journal_Hasher
 

Detailed Description

Definition at line 15 of file Readonly_Journal.h.

Member Enumeration Documentation

◆ Check

enum class joedb::Readonly_Journal::Check
strong
Enumerator
joedb 
version 
big_size 
small_size 
set_checkpoint 
checkpoint_mismatch 
all 
readonly 
overwrite 
none 

Definition at line 21 of file Readonly_Journal.h.

◆ operation_t

enum class joedb::Readonly_Journal::operation_t : uint8_t
strongprotected
Enumerator
create_table 
drop_table 
add_field 
drop_field 
insert_into 
delete_from 
update 
append 
update_last 
comment 
timestamp 
rename_table 
rename_field 
valid_data 
insert_vector 
custom 
update_vector 
update_next 
blob 
updates 
TYPE_MACRO 

Definition at line 65 of file Readonly_Journal.h.

Constructor & Destructor Documentation

◆ Readonly_Journal() [1/3]

joedb::Readonly_Journal::Readonly_Journal ( Journal_Construction_Lock lock,
Check  check 
)
explicit

Definition at line 29 of file Readonly_Journal.cpp.

◆ Readonly_Journal() [2/3]

joedb::Readonly_Journal::Readonly_Journal ( Journal_Construction_Lock &&  lock,
Check  check 
)
inlineexplicit

Definition at line 98 of file Readonly_Journal.h.

◆ Readonly_Journal() [3/3]

joedb::Readonly_Journal::Readonly_Journal ( Buffered_File file,
Check  check = Check::readonly 
)
inlineexplicit

Definition at line 103 of file Readonly_Journal.h.

◆ ~Readonly_Journal()

virtual joedb::Readonly_Journal::~Readonly_Journal ( )
virtualdefault

Member Function Documentation

◆ at_end_of_file()

bool joedb::Readonly_Journal::at_end_of_file ( ) const

Definition at line 206 of file Readonly_Journal.cpp.

◆ check_flag()

static bool joedb::Readonly_Journal::check_flag ( Check  check,
Check  flag 
)
inlinestatic

Definition at line 35 of file Readonly_Journal.h.

◆ get_async_blob_reader()

Async_Reader joedb::Readonly_Journal::get_async_blob_reader ( Blob  blob) const
inline

Definition at line 148 of file Readonly_Journal.h.

◆ get_async_reader()

Async_Reader joedb::Readonly_Journal::get_async_reader ( int64_t  start_position,
int64_t  until_position 
) const
inline

Definition at line 138 of file Readonly_Journal.h.

◆ get_async_tail_reader()

Async_Reader joedb::Readonly_Journal::get_async_tail_reader ( int64_t  start_position) const
inline

Definition at line 133 of file Readonly_Journal.h.

◆ get_checkpoint_position()

int64_t joedb::Readonly_Journal::get_checkpoint_position ( ) const
inline

Definition at line 115 of file Readonly_Journal.h.

◆ get_file()

const Buffered_File & joedb::Readonly_Journal::get_file ( ) const
inline

Definition at line 119 of file Readonly_Journal.h.

◆ get_file_version()

uint32_t joedb::Readonly_Journal::get_file_version ( ) const
inline

Definition at line 112 of file Readonly_Journal.h.

◆ get_position()

int64_t joedb::Readonly_Journal::get_position ( ) const
inline

Definition at line 114 of file Readonly_Journal.h.

◆ get_writable_journal()

virtual Writable_Journal * joedb::Readonly_Journal::get_writable_journal ( )
inlinevirtual

Reimplemented in joedb::Writable_Journal.

Definition at line 162 of file Readonly_Journal.h.

◆ is_empty()

bool joedb::Readonly_Journal::is_empty ( ) const
inline

Definition at line 116 of file Readonly_Journal.h.

◆ is_second_checkpoint_copy()

static constexpr bool joedb::Readonly_Journal::is_second_checkpoint_copy ( int64_t  offset)
inlinestaticconstexpr

Definition at line 157 of file Readonly_Journal.h.

◆ is_shared()

bool joedb::Readonly_Journal::is_shared ( ) const
inline

Definition at line 117 of file Readonly_Journal.h.

◆ one_step()

void joedb::Readonly_Journal::one_step ( Writable writable)

Definition at line 213 of file Readonly_Journal.cpp.

◆ play_until()

void joedb::Readonly_Journal::play_until ( Writable writable,
int64_t  end 
)

Definition at line 197 of file Readonly_Journal.cpp.

◆ play_until_checkpoint()

void joedb::Readonly_Journal::play_until_checkpoint ( Writable writable)
inline

Definition at line 126 of file Readonly_Journal.h.

◆ pull()

void joedb::Readonly_Journal::pull ( )

Definition at line 150 of file Readonly_Journal.cpp.

◆ read_type()

joedb::Type joedb::Readonly_Journal::read_type ( )
protected

Definition at line 404 of file Readonly_Journal.cpp.

◆ replay_log()

void joedb::Readonly_Journal::replay_log ( Writable writable)

Definition at line 159 of file Readonly_Journal.cpp.

◆ replay_with_checkpoint_comments()

void joedb::Readonly_Journal::replay_with_checkpoint_comments ( Writable writable)

Definition at line 167 of file Readonly_Journal.cpp.

◆ rewind()

void joedb::Readonly_Journal::rewind ( )

Definition at line 183 of file Readonly_Journal.cpp.

◆ safe_read_string()

std::string joedb::Readonly_Journal::safe_read_string ( )
protected

Definition at line 415 of file Readonly_Journal.cpp.

◆ seek_to_checkpoint()

void joedb::Readonly_Journal::seek_to_checkpoint ( )
inline

Definition at line 131 of file Readonly_Journal.h.

◆ set_position()

void joedb::Readonly_Journal::set_position ( int64_t  position)

Definition at line 190 of file Readonly_Journal.cpp.

Friends And Related Symbol Documentation

◆ Journal_Hasher

friend class Journal_Hasher
friend

Definition at line 18 of file Readonly_Journal.h.

◆ Writable_Journal

friend class Writable_Journal
friend

Definition at line 17 of file Readonly_Journal.h.

Member Data Documentation

◆ checkpoint_index

unsigned joedb::Readonly_Journal::checkpoint_index
protected

Definition at line 51 of file Readonly_Journal.h.

◆ checkpoint_offset

constexpr int64_t joedb::Readonly_Journal::checkpoint_offset = 5 + 4
staticconstexpr

Definition at line 156 of file Readonly_Journal.h.

◆ checkpoint_position

int64_t joedb::Readonly_Journal::checkpoint_position
protected

Definition at line 52 of file Readonly_Journal.h.

◆ compatible_version

constexpr uint32_t joedb::Readonly_Journal::compatible_version = 0x00000004
staticconstexpr

Definition at line 154 of file Readonly_Journal.h.

◆ field_of_last_update

Field_Id joedb::Readonly_Journal::field_of_last_update
protected

Definition at line 56 of file Readonly_Journal.h.

◆ file

Buffered_File& joedb::Readonly_Journal::file
protected

Definition at line 49 of file Readonly_Journal.h.

◆ file_version

uint32_t joedb::Readonly_Journal::file_version
protected

Definition at line 50 of file Readonly_Journal.h.

◆ header_size

constexpr int64_t joedb::Readonly_Journal::header_size = 41
staticconstexpr

Definition at line 155 of file Readonly_Journal.h.

◆ record_of_last_operation

Record_Id joedb::Readonly_Journal::record_of_last_operation
protected

Definition at line 55 of file Readonly_Journal.h.

◆ table_of_last_operation

Table_Id joedb::Readonly_Journal::table_of_last_operation
protected

Definition at line 54 of file Readonly_Journal.h.

◆ version_number

constexpr uint32_t joedb::Readonly_Journal::version_number = 0x00000004
staticconstexpr

Definition at line 153 of file Readonly_Journal.h.


The documentation for this class was generated from the following files: