Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
joedb::db::encoded_file::Writable_Database Class Reference

A writable Database constructed from a writable joedb::Buffered_File. More...

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

Inheritance diagram for joedb::db::encoded_file::Writable_Database:
Inheritance graph
[legend]
Collaboration diagram for joedb::db::encoded_file::Writable_Database:
Collaboration graph
[legend]

Public Member Functions

 Writable_Database (joedb::Buffered_File &file)
 
const joedb::Readonly_Journalget_journal () const
 
std::string read_blob (joedb::Blob blob) const
 
joedb::Blob write_blob (const std::string &data) final
 
int64_t ahead_of_checkpoint () const
 
void soft_checkpoint ()
 
void hard_checkpoint ()
 
void write_comment (const std::string &comment)
 
void write_timestamp ()
 
void write_timestamp (int64_t timestamp)
 
void write_valid_data ()
 
void flush () override
 
void clear_buffer_table ()
 
id_of_buffer new_buffer ()
 
id_of_buffer new_vector_of_buffer (size_t size)
 
id_of_buffer new_buffer (joedb::Blob field_value_of_data, int64_t field_value_of_size, int64_t field_value_of_offset)
 
void delete_buffer (id_of_buffer record)
 
void delete_vector_of_buffer (id_of_buffer v, size_t size)
 
void set_data (id_of_buffer record, joedb::Blob field_value_of_data)
 
template<typename F >
void update_vector_of_data (id_of_buffer record, size_t size, F f)
 
void set_size (id_of_buffer record, int64_t field_value_of_size)
 
template<typename F >
void update_vector_of_size (id_of_buffer record, size_t size, F f)
 
void set_offset (id_of_buffer record, int64_t field_value_of_offset)
 
template<typename F >
void update_vector_of_offset (id_of_buffer record, size_t size, F f)
 
- Public Member Functions inherited from joedb::db::encoded_file::Database
void set_max_record_id (size_t record_id)
 
bool is_valid (id_of_buffer id) const
 
 Database ()
 
int64_t get_schema_checkpoint () const
 
void initialize_with_readonly_journal (joedb::Readonly_Journal &journal)
 
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_buffersorted_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 soft_checkpoint_at (int64_t position)
 
virtual void hard_checkpoint_at (int64_t position)
 
void soft_checkpoint ()
 
void hard_checkpoint ()
 
virtual void drop_table (Table_Id table_id)
 
virtual void rename_table (Table_Id table_id, const std::string &name)
 
virtual void add_field (Table_Id table_id, const std::string &name, Type type)
 
virtual void drop_field (Table_Id table_id, Field_Id field_id)
 
virtual void rename_field (Table_Id table_id, Field_Id field_id, const std::string &name)
 
virtual void insert_into (Table_Id table_id, Record_Id record_id)
 
virtual void delete_from (Table_Id table_id, Record_Id record_id)
 
virtual void insert_vector (Table_Id table_id, Record_Id record_id, size_t size)
 
virtual void delete_vector (Table_Id table_id, Record_Id record_id, size_t size)
 
virtual void on_blob (Blob blob)
 
virtual bool wants_blob_data () const
 
virtual ~Writable ()=default
 

Friends

class Client
 
class Multiplexer
 

Additional Inherited Members

- Static Public Member Functions inherited from joedb::db::encoded_file::Database
template<typename E = joedb::Exception>
static void throw_exception (const std::string &message)
 
static id_of_buffer null_buffer ()
 
- Public Attributes inherited from joedb::db::encoded_file::Database
size_t max_record_id
 
Table_Id current_table_id = Table_Id{0}
 
- 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)
 
void delete_from (Table_Id table_id, Record_Id record_id) final
 
void insert_into (Table_Id table_id, Record_Id record_id) final
 
void insert_vector (Table_Id table_id, Record_Id record_id, size_t size) final
 
void update_int64 (Table_Id table_id, Record_Id record_id, Field_Id field_id, int64_t value) final
 
void update_blob (Table_Id table_id, Record_Id record_id, Field_Id field_id, joedb::Blob value) final
 
void update_vector_int64 (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const int64_t *value) final
 
void update_vector_blob (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const joedb::Blob *value) final
 
int64_t * get_own_int64_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) final
 
joedb::Blobget_own_blob_storage (Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) final
 
void comment (const std::string &comment) override
 
void timestamp (int64_t timestamp) override
 
void valid_data () final
 
bool requires_schema_upgrade () const
 
void check_schema ()
 
void create_table (const std::string &name) override
 
void drop_table (Table_Id table_id) final
 
void rename_table (Table_Id table_id, const std::string &name) final
 
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) final
 
void rename_field (Table_Id table_id, Field_Id field_id, const std::string &name) final
 
void custom (const std::string &name) override
 
- Protected Attributes inherited from joedb::db::encoded_file::Database
detail::data_of_buffer storage_of_buffer
 
bool upgrading_schema = false
 
joedb::Memory_File schema_file
 
joedb::Writable_Journal schema_journal
 

Detailed Description

Definition at line 29 of file Writable_Database.h.

Constructor & Destructor Documentation

◆ Writable_Database()

joedb::db::encoded_file::Writable_Database::Writable_Database ( joedb::Buffered_File file)

Definition at line 101 of file Writable_Database.cpp.

Member Function Documentation

◆ ahead_of_checkpoint()

int64_t joedb::db::encoded_file::Writable_Database::ahead_of_checkpoint ( ) const
inline

Definition at line 72 of file Writable_Database.h.

◆ clear_buffer_table()

void joedb::db::encoded_file::Writable_Database::clear_buffer_table ( )

Definition at line 114 of file Writable_Database.cpp.

◆ delete_buffer()

void joedb::db::encoded_file::Writable_Database::delete_buffer ( id_of_buffer  record)
inline

Definition at line 128 of file Writable_Database.h.

◆ delete_vector_of_buffer()

void joedb::db::encoded_file::Writable_Database::delete_vector_of_buffer ( id_of_buffer  v,
size_t  size 
)
inline

Definition at line 134 of file Writable_Database.h.

◆ flush()

void joedb::db::encoded_file::Writable_Database::flush ( )
inlineoverridevirtual

Reimplemented from joedb::Writable.

Definition at line 91 of file Writable_Database.h.

◆ get_journal()

const joedb::Readonly_Journal & joedb::db::encoded_file::Writable_Database::get_journal ( ) const
inline

Definition at line 60 of file Writable_Database.h.

◆ hard_checkpoint()

void joedb::db::encoded_file::Writable_Database::hard_checkpoint ( )
inline

Definition at line 82 of file Writable_Database.h.

◆ new_buffer() [1/2]

id_of_buffer joedb::db::encoded_file::Writable_Database::new_buffer ( )
inline

Definition at line 95 of file Writable_Database.h.

◆ new_buffer() [2/2]

id_of_buffer joedb::db::encoded_file::Writable_Database::new_buffer ( joedb::Blob  field_value_of_data,
int64_t  field_value_of_size,
int64_t  field_value_of_offset 
)
inline

Definition at line 114 of file Writable_Database.h.

◆ new_vector_of_buffer()

id_of_buffer joedb::db::encoded_file::Writable_Database::new_vector_of_buffer ( size_t  size)
inline

Definition at line 105 of file Writable_Database.h.

◆ read_blob()

std::string joedb::db::encoded_file::Writable_Database::read_blob ( joedb::Blob  blob) const
inline

Definition at line 62 of file Writable_Database.h.

◆ set_data()

void joedb::db::encoded_file::Writable_Database::set_data ( id_of_buffer  record,
joedb::Blob  field_value_of_data 
)
inline

Definition at line 141 of file Writable_Database.h.

◆ set_offset()

void joedb::db::encoded_file::Writable_Database::set_offset ( id_of_buffer  record,
int64_t  field_value_of_offset 
)
inline

Definition at line 177 of file Writable_Database.h.

◆ set_size()

void joedb::db::encoded_file::Writable_Database::set_size ( id_of_buffer  record,
int64_t  field_value_of_size 
)
inline

Definition at line 159 of file Writable_Database.h.

◆ soft_checkpoint()

void joedb::db::encoded_file::Writable_Database::soft_checkpoint ( )
inline

Definition at line 77 of file Writable_Database.h.

◆ update_vector_of_data()

template<typename F >
void joedb::db::encoded_file::Writable_Database::update_vector_of_data ( id_of_buffer  record,
size_t  size,
f 
)
inline

Definition at line 147 of file Writable_Database.h.

◆ update_vector_of_offset()

template<typename F >
void joedb::db::encoded_file::Writable_Database::update_vector_of_offset ( id_of_buffer  record,
size_t  size,
f 
)
inline

Definition at line 183 of file Writable_Database.h.

◆ update_vector_of_size()

template<typename F >
void joedb::db::encoded_file::Writable_Database::update_vector_of_size ( id_of_buffer  record,
size_t  size,
f 
)
inline

Definition at line 165 of file Writable_Database.h.

◆ write_blob()

joedb::Blob joedb::db::encoded_file::Writable_Database::write_blob ( const std::string &  data)
inlinefinalvirtual

Reimplemented from joedb::Writable.

Definition at line 67 of file Writable_Database.h.

◆ write_comment()

void joedb::db::encoded_file::Writable_Database::write_comment ( const std::string &  comment)

Definition at line 21 of file Writable_Database.cpp.

◆ write_timestamp() [1/2]

void joedb::db::encoded_file::Writable_Database::write_timestamp ( )

Definition at line 28 of file Writable_Database.cpp.

◆ write_timestamp() [2/2]

void joedb::db::encoded_file::Writable_Database::write_timestamp ( int64_t  timestamp)

Definition at line 35 of file Writable_Database.cpp.

◆ write_valid_data()

void joedb::db::encoded_file::Writable_Database::write_valid_data ( )

Definition at line 42 of file Writable_Database.cpp.

Friends And Related Symbol Documentation

◆ Client

friend class Client
friend

Definition at line 32 of file Writable_Database.h.

◆ Multiplexer

friend class Multiplexer
friend

Definition at line 33 of file Writable_Database.h.


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