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

implement joedb::Writable in a Database More...

#include <joedb/db/encoded_file/Database_Writable.h>

Inheritance diagram for joedb::db::encoded_file::Database_Writable:
Collaboration diagram for joedb::db::encoded_file::Database_Writable:

Public Member Functions

 Database_Writable ()
void set_max_record_id (joedb::index_t record_id)
int64_t get_schema_checkpoint () const
void initialize_with_readonly_journal (joedb::Readonly_Journal &journal)
Public Member Functions inherited from joedb::db::encoded_file::Database
bool is_valid (id_of_buffer id) const
container_of_buffer get_buffer_table () const
id_of_buffer next (id_of_buffer id) const
id_of_buffer previous (id_of_buffer id) const
template<class Comparator>
std::vector< id_of_buffer > sorted_buffer (Comparator comparator) const
joedb::Blob get_data (id_of_buffer record) const
int64_t get_size (id_of_buffer record) const
int64_t get_offset (id_of_buffer record) const
Public Member Functions inherited from joedb::Writable
virtual int64_t get_position () const
virtual void start_writing (int64_t position)
virtual void end_writing (int64_t position)
virtual void soft_checkpoint ()
virtual void hard_checkpoint ()
virtual void flush ()
virtual void update_string (Table_Id table_id, Record_Id record_id, Field_Id field_id, std::string_view value)
virtual void update_int32 (Table_Id table_id, Record_Id record_id, Field_Id field_id, int32_t value)
virtual void update_boolean (Table_Id table_id, Record_Id record_id, Field_Id field_id, bool value)
virtual void update_float32 (Table_Id table_id, Record_Id record_id, Field_Id field_id, float value)
virtual void update_float64 (Table_Id table_id, Record_Id record_id, Field_Id field_id, double value)
virtual void update_int8 (Table_Id table_id, Record_Id record_id, Field_Id field_id, int8_t value)
virtual void update_int16 (Table_Id table_id, Record_Id record_id, Field_Id field_id, int16_t value)
virtual void update_vector_string (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const std::string *value)
virtual std::string * get_own_string_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const std::string * get_own_string_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_int32 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const int32_t *value)
virtual int32_t * get_own_int32_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const int32_t * get_own_int32_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
const int64_t * get_own_int64_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_reference (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const joedb::Record_Id *value)
virtual joedb::Record_Id * get_own_reference_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const joedb::Record_Id * get_own_reference_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_boolean (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const char *value)
virtual char * get_own_boolean_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const char * get_own_boolean_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_float32 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const float *value)
virtual float * get_own_float32_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const float * get_own_float32_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_float64 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const double *value)
virtual double * get_own_float64_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const double * get_own_float64_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_int8 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const int8_t *value)
virtual int8_t * get_own_int8_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const int8_t * get_own_int8_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void update_vector_int16 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const int16_t *value)
virtual int16_t * get_own_int16_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity)
const int16_t * get_own_int16_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
const joedb::Blob * get_own_blob_const_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) const
virtual void on_blob (Blob blob)
virtual bool wants_blob_data () const
virtual Blob write_blob (std::string_view data)
virtual ~Writable ()=default

Protected Member Functions

void delete_from (Table_Id table_id, Record_Id record_id) override
void insert_into (Table_Id table_id, Record_Id record_id) override
void delete_vector (Table_Id table_id, Record_Id record_id, size_t size) override
void insert_vector (Table_Id table_id, Record_Id record_id, size_t size) override
void update_int64 (Table_Id table_id, Record_Id record_id, Field_Id field_id, int64_t value) override
void update_blob (Table_Id table_id, Record_Id record_id, Field_Id field_id, joedb::Blob value) override
void update_vector_int64 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const int64_t *value) override
void update_vector_blob (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const joedb::Blob *value) override
int64_t * get_own_int64_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) override
joedb::Blob * get_own_blob_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) override
void comment (const std::string &comment) override
void timestamp (int64_t timestamp) override
void valid_data () override
bool requires_schema_upgrade () const
void check_schema ()
void create_table (const std::string &name) override
void drop_table (Table_Id table_id) override
void rename_table (Table_Id table_id, const std::string &name) override
void add_field (Table_Id table_id, const std::string &name, joedb::Type type) override
void drop_field (Table_Id table_id, Field_Id field_id) override
void rename_field (Table_Id table_id, Field_Id field_id, const std::string &name) override
void custom (const std::string &name) override
Protected Member Functions inherited from joedb::db::encoded_file::Database
bool is_valid_record_id_for_buffer (Record_Id record_id) const
void internal_delete_buffer (Record_Id record_id)
void internal_insert_buffer (Record_Id record_id)
void internal_vector_insert_buffer (Record_Id record_id, size_t size)
void internal_update_buffer__data (Record_Id record_id, joedb::Blob field_value_of_data)
void internal_update_vector_buffer__data (Record_Id record_id, size_t size, const joedb::Blob *value)
void internal_update_buffer__size (Record_Id record_id, int64_t field_value_of_size)
void internal_update_vector_buffer__size (Record_Id record_id, size_t size, const int64_t *value)
void internal_update_buffer__offset (Record_Id record_id, int64_t field_value_of_offset)
void internal_update_vector_buffer__offset (Record_Id record_id, size_t size, const int64_t *value)

Protected Attributes

joedb::index_t max_record_id
Table_Id current_table_id = Table_Id{0}
bool upgrading_schema = false
joedb::Memory_File schema_file
joedb::Writable_Journal schema_journal
Protected Attributes inherited from joedb::db::encoded_file::Database
detail::data_of_buffer storage_of_buffer

Additional Inherited Members

Static Public Member Functions inherited from joedb::db::encoded_file::Database
template<typename E = joedb::Exception>
static void throw_exception (std::string_view message)
static id_of_buffer null_buffer ()

Detailed Description

Definition at line 36 of file Database_Writable.h.

Constructor & Destructor Documentation

◆ Database_Writable()

joedb::db::encoded_file::Database_Writable::Database_Writable ( )
inline

Definition at line 334 of file Database_Writable.h.

Member Function Documentation

◆ add_field()

void joedb::db::encoded_file::Database_Writable::add_field ( Table_Id table_id,
const std::string & name,
joedb::Type type )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 299 of file Database_Writable.h.

◆ check_schema()

void joedb::db::encoded_file::Database_Writable::check_schema ( )
inlineprotected

Definition at line 255 of file Database_Writable.h.

◆ comment()

void joedb::db::encoded_file::Database_Writable::comment ( const std::string & comment)
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 242 of file Database_Writable.h.

◆ create_table()

void joedb::db::encoded_file::Database_Writable::create_table ( const std::string & name)
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 276 of file Database_Writable.h.

◆ custom()

void joedb::db::encoded_file::Database_Writable::custom ( const std::string & name)
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 327 of file Database_Writable.h.

◆ delete_from()

void joedb::db::encoded_file::Database_Writable::delete_from ( Table_Id table_id,
Record_Id record_id )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 42 of file Database_Writable.h.

◆ delete_vector()

void joedb::db::encoded_file::Database_Writable::delete_vector ( Table_Id table_id,
Record_Id record_id,
size_t size )
inlineoverrideprotectedvirtual

Implements joedb::Writable.

Definition at line 62 of file Database_Writable.h.

◆ drop_field()

void joedb::db::encoded_file::Database_Writable::drop_field ( Table_Id table_id,
Field_Id field_id )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 310 of file Database_Writable.h.

◆ drop_table()

void joedb::db::encoded_file::Database_Writable::drop_table ( Table_Id table_id)
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 283 of file Database_Writable.h.

◆ get_own_blob_storage()

joedb::Blob * joedb::db::encoded_file::Database_Writable::get_own_blob_storage ( Table_Id table_id,
Record_Id record_id,
Field_Id field_id,
size_t & capacity )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 221 of file Database_Writable.h.

◆ get_own_int64_storage()

int64_t * joedb::db::encoded_file::Database_Writable::get_own_int64_storage ( Table_Id table_id,
Record_Id record_id,
Field_Id field_id,
size_t & capacity )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 196 of file Database_Writable.h.

◆ get_schema_checkpoint()

int64_t joedb::db::encoded_file::Database_Writable::get_schema_checkpoint ( ) const
inline

Definition at line 344 of file Database_Writable.h.

◆ initialize_with_readonly_journal()

void joedb::db::encoded_file::Database_Writable::initialize_with_readonly_journal ( joedb::Readonly_Journal & journal)
inline

Definition at line 349 of file Database_Writable.h.

◆ insert_into()

void joedb::db::encoded_file::Database_Writable::insert_into ( Table_Id table_id,
Record_Id record_id )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 48 of file Database_Writable.h.

◆ insert_vector()

void joedb::db::encoded_file::Database_Writable::insert_vector ( Table_Id table_id,
Record_Id record_id,
size_t size )
inlineoverrideprotectedvirtual

Implements joedb::Writable.

Definition at line 81 of file Database_Writable.h.

◆ rename_field()

void joedb::db::encoded_file::Database_Writable::rename_field ( Table_Id table_id,
Field_Id field_id,
const std::string & name )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 316 of file Database_Writable.h.

◆ rename_table()

void joedb::db::encoded_file::Database_Writable::rename_table ( Table_Id table_id,
const std::string & name )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 289 of file Database_Writable.h.

◆ requires_schema_upgrade()

bool joedb::db::encoded_file::Database_Writable::requires_schema_upgrade ( ) const
inlineprotected

Definition at line 250 of file Database_Writable.h.

◆ set_max_record_id()

void joedb::db::encoded_file::Database_Writable::set_max_record_id ( joedb::index_t record_id)
inline

Definition at line 339 of file Database_Writable.h.

◆ timestamp()

void joedb::db::encoded_file::Database_Writable::timestamp ( int64_t timestamp)
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 243 of file Database_Writable.h.

◆ update_blob()

void joedb::db::encoded_file::Database_Writable::update_blob ( Table_Id table_id,
Record_Id record_id,
Field_Id field_id,
joedb::Blob value )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 129 of file Database_Writable.h.

◆ update_int64()

void joedb::db::encoded_file::Database_Writable::update_int64 ( Table_Id table_id,
Record_Id record_id,
Field_Id field_id,
int64_t value )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 104 of file Database_Writable.h.

◆ update_vector_blob()

void joedb::db::encoded_file::Database_Writable::update_vector_blob ( Table_Id table_id,
Record_Id record_id,
Field_Id field_id,
size_t size,
const joedb::Blob * value )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 175 of file Database_Writable.h.

◆ update_vector_int64()

void joedb::db::encoded_file::Database_Writable::update_vector_int64 ( Table_Id table_id,
Record_Id record_id,
Field_Id field_id,
size_t size,
const int64_t * value )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 149 of file Database_Writable.h.

◆ valid_data()

void joedb::db::encoded_file::Database_Writable::valid_data ( )
inlineoverrideprotectedvirtual

Reimplemented from joedb::Writable.

Definition at line 244 of file Database_Writable.h.

Member Data Documentation

◆ current_table_id

Table_Id joedb::db::encoded_file::Database_Writable::current_table_id = Table_Id{0}
protected

Definition at line 40 of file Database_Writable.h.

◆ max_record_id

joedb::index_t joedb::db::encoded_file::Database_Writable::max_record_id
protected

Definition at line 39 of file Database_Writable.h.

◆ schema_file

joedb::Memory_File joedb::db::encoded_file::Database_Writable::schema_file
protected

Definition at line 247 of file Database_Writable.h.

◆ schema_journal

joedb::Writable_Journal joedb::db::encoded_file::Database_Writable::schema_journal
protected

Definition at line 248 of file Database_Writable.h.

◆ upgrading_schema

bool joedb::db::encoded_file::Database_Writable::upgrading_schema = false
protected

Definition at line 246 of file Database_Writable.h.


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