Joedb 10.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
joedb::Readonly_Journal Class Reference

#include <joedb/journal/Readonly_Journal.h>

Inheritance diagram for joedb::Readonly_Journal:
Collaboration diagram for joedb::Readonly_Journal:

Public Member Functions

 Readonly_Journal (Journal_Construction_Lock &lock)
 Readonly_Journal (Journal_Construction_Lock &&lock)
 Readonly_Journal (Abstract_File &file)
int64_t get_position () const
int64_t get_checkpoint () const
int64_t get_hard_checkpoint () const
bool is_empty () const
bool is_shared () const
int64_t pull ()
const Abstract_File & get_file () const
void replay_log (Writable &writable)
void replay_with_checkpoint_comments (Writable &writable)
void rewind ()
void one_step (Writable &writable)
void play_until (Writable &writable, int64_t end)
void raw_play_until (Writable &writable, int64_t end)
void play_until_checkpoint (Writable &writable)
void raw_play_until_checkpoint (Writable &writable)
void skip_directly_to (int64_t position)
bool equal_to (Readonly_Journal &journal, int64_t from, int64_t until) const
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

Static Public Attributes

static constexpr uint32_t format_version = 5

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 , delete_vector = 0x14 ,
  updates = 0x80 , update_string , update_last_string , update_next_string ,
  update_vector_string , update_int32 , update_last_int32 , update_next_int32 ,
  update_vector_int32 , update_int64 , update_last_int64 , update_next_int64 ,
  update_vector_int64 , update_reference , update_last_reference , update_next_reference ,
  update_vector_reference , update_boolean , update_last_boolean , update_next_boolean ,
  update_vector_boolean , update_float32 , update_last_float32 , update_next_float32 ,
  update_vector_float32 , update_float64 , update_last_float64 , update_next_float64 ,
  update_vector_float64 , update_int8 , update_last_int8 , update_next_int8 ,
  update_vector_int8 , update_int16 , update_last_int16 , update_next_int16 ,
  update_vector_int16 , update_blob , update_last_blob , update_next_blob ,
  update_vector_blob
}

Protected Member Functions

void reset_context ()
Type read_type ()
std::string safe_read_string ()
void read_vector_of_string (std::string *data, size_t size)
void read_vector_of_int32 (int32_t *data, size_t size)
void read_vector_of_int64 (int64_t *data, size_t size)
void read_vector_of_reference (joedb::Record_Id *data, size_t size)
void read_vector_of_boolean (char *data, size_t size)
void read_vector_of_float32 (float *data, size_t size)
void read_vector_of_float64 (double *data, size_t size)
void read_vector_of_int8 (int8_t *data, size_t size)
void read_vector_of_int16 (int16_t *data, size_t size)
void read_vector_of_blob (joedb::Blob *data, size_t size)

Protected Attributes

Abstract_File & file
File_Buffer file_buffer
int hard_index
int soft_index
int64_t checkpoint_position
int64_t hard_checkpoint_position
Table_Id table_of_last_operation
Record_Id record_of_last_operation
Field_Id field_of_last_update

Friends

class Writable_Journal

Detailed Description

Definition at line 17 of file Readonly_Journal.h.

Member Enumeration Documentation

◆ 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 
delete_vector 
updates 
update_string 
update_last_string 
update_next_string 
update_vector_string 
update_int32 
update_last_int32 
update_next_int32 
update_vector_int32 
update_int64 
update_last_int64 
update_next_int64 
update_vector_int64 
update_reference 
update_last_reference 
update_next_reference 
update_vector_reference 
update_boolean 
update_last_boolean 
update_next_boolean 
update_vector_boolean 
update_float32 
update_last_float32 
update_next_float32 
update_vector_float32 
update_float64 
update_last_float64 
update_next_float64 
update_vector_float64 
update_int8 
update_last_int8 
update_next_int8 
update_vector_int8 
update_int16 
update_last_int16 
update_next_int16 
update_vector_int16 
update_blob 
update_last_blob 
update_next_blob 
update_vector_blob 

Definition at line 51 of file Readonly_Journal.h.

Constructor & Destructor Documentation

◆ Readonly_Journal() [1/3]

joedb::Readonly_Journal::Readonly_Journal ( Journal_Construction_Lock & lock)
explicit

Definition at line 32 of file Readonly_Journal.cpp.

◆ Readonly_Journal() [2/3]

joedb::Readonly_Journal::Readonly_Journal ( Journal_Construction_Lock && lock)
inlineexplicit

Definition at line 85 of file Readonly_Journal.h.

◆ Readonly_Journal() [3/3]

joedb::Readonly_Journal::Readonly_Journal ( Abstract_File & file)
inlineexplicit

Definition at line 90 of file Readonly_Journal.h.

Member Function Documentation

◆ equal_to()

bool joedb::Readonly_Journal::equal_to ( Readonly_Journal & journal,
int64_t from,
int64_t until ) const
inline

Definition at line 120 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 130 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 125 of file Readonly_Journal.h.

◆ get_checkpoint()

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

Definition at line 96 of file Readonly_Journal.h.

◆ get_file()

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

Definition at line 101 of file Readonly_Journal.h.

◆ get_hard_checkpoint()

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

Definition at line 97 of file Readonly_Journal.h.

◆ get_position()

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

Definition at line 95 of file Readonly_Journal.h.

◆ is_empty()

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

Definition at line 98 of file Readonly_Journal.h.

◆ is_shared()

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

Definition at line 99 of file Readonly_Journal.h.

◆ one_step()

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

Definition at line 187 of file Readonly_Journal.cpp.

◆ play_until()

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

Definition at line 166 of file Readonly_Journal.cpp.

◆ play_until_checkpoint()

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

Definition at line 108 of file Readonly_Journal.h.

◆ pull()

int64_t joedb::Readonly_Journal::pull ( )

Definition at line 114 of file Readonly_Journal.cpp.

◆ raw_play_until()

void joedb::Readonly_Journal::raw_play_until ( Writable & writable,
int64_t end )

Definition at line 158 of file Readonly_Journal.cpp.

◆ raw_play_until_checkpoint()

void joedb::Readonly_Journal::raw_play_until_checkpoint ( Writable & writable)
inline

Definition at line 112 of file Readonly_Journal.h.

◆ read_type()

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

Definition at line 394 of file Readonly_Journal.cpp.

◆ read_vector_of_blob()

void joedb::Readonly_Journal::read_vector_of_blob ( joedb::Blob * data,
size_t size )
protected

◆ read_vector_of_boolean()

void joedb::Readonly_Journal::read_vector_of_boolean ( char * data,
size_t size )
protected

◆ read_vector_of_float32()

void joedb::Readonly_Journal::read_vector_of_float32 ( float * data,
size_t size )
protected

◆ read_vector_of_float64()

void joedb::Readonly_Journal::read_vector_of_float64 ( double * data,
size_t size )
protected

◆ read_vector_of_int16()

void joedb::Readonly_Journal::read_vector_of_int16 ( int16_t * data,
size_t size )
protected

◆ read_vector_of_int32()

void joedb::Readonly_Journal::read_vector_of_int32 ( int32_t * data,
size_t size )
protected

◆ read_vector_of_int64()

void joedb::Readonly_Journal::read_vector_of_int64 ( int64_t * data,
size_t size )
protected

◆ read_vector_of_int8()

void joedb::Readonly_Journal::read_vector_of_int8 ( int8_t * data,
size_t size )
protected

◆ read_vector_of_reference()

void joedb::Readonly_Journal::read_vector_of_reference ( joedb::Record_Id * data,
size_t size )
protected

◆ read_vector_of_string()

void joedb::Readonly_Journal::read_vector_of_string ( std::string * data,
size_t size )
protected

◆ replay_log()

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

Definition at line 124 of file Readonly_Journal.cpp.

◆ replay_with_checkpoint_comments()

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

Definition at line 132 of file Readonly_Journal.cpp.

◆ reset_context()

void joedb::Readonly_Journal::reset_context ( )
protected

Definition at line 23 of file Readonly_Journal.cpp.

◆ rewind()

void joedb::Readonly_Journal::rewind ( )

Definition at line 150 of file Readonly_Journal.cpp.

◆ safe_read_string()

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

Definition at line 405 of file Readonly_Journal.cpp.

◆ skip_directly_to()

void joedb::Readonly_Journal::skip_directly_to ( int64_t position)
inline

Definition at line 116 of file Readonly_Journal.h.

◆ Writable_Journal

friend class Writable_Journal
friend

Definition at line 19 of file Readonly_Journal.h.

Member Data Documentation

◆ checkpoint_position

int64_t joedb::Readonly_Journal::checkpoint_position
protected

Definition at line 35 of file Readonly_Journal.h.

◆ field_of_last_update

Field_Id joedb::Readonly_Journal::field_of_last_update
protected

Definition at line 40 of file Readonly_Journal.h.

◆ file

Abstract_File& joedb::Readonly_Journal::file
protected

Definition at line 30 of file Readonly_Journal.h.

◆ file_buffer

File_Buffer joedb::Readonly_Journal::file_buffer
protected

Definition at line 31 of file Readonly_Journal.h.

◆ format_version

uint32_t joedb::Readonly_Journal::format_version = 5
staticconstexpr

Definition at line 140 of file Readonly_Journal.h.

◆ hard_checkpoint_position

int64_t joedb::Readonly_Journal::hard_checkpoint_position
protected

Definition at line 36 of file Readonly_Journal.h.

◆ hard_index

int joedb::Readonly_Journal::hard_index
protected

Definition at line 33 of file Readonly_Journal.h.

◆ record_of_last_operation

Record_Id joedb::Readonly_Journal::record_of_last_operation
protected

Definition at line 39 of file Readonly_Journal.h.

◆ soft_index

int joedb::Readonly_Journal::soft_index
protected

Definition at line 34 of file Readonly_Journal.h.

◆ table_of_last_operation

Table_Id joedb::Readonly_Journal::table_of_last_operation
protected

Definition at line 38 of file Readonly_Journal.h.


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