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

Store all the tables of the database. More...

#include <tutorial/Database.h>

Inheritance diagram for tutorial::Database:
Collaboration diagram for tutorial::Database:

Public Member Functions

bool is_valid (id_of_city id) const
bool is_valid (id_of_person id) const
container_of_city get_city_table () const
id_of_city next (id_of_city id) const
id_of_city previous (id_of_city id) const
template<class Comparator>
std::vector< id_of_city > sorted_city (Comparator comparator) const
const std::string & get_name (id_of_city record) const
container_of_person get_person_table () const
id_of_person next (id_of_person id) const
id_of_person previous (id_of_person id) const
template<class Comparator>
std::vector< id_of_person > sorted_person (Comparator comparator) const
const std::string & get_first_name (id_of_person record) const
const std::string & get_last_name (id_of_person record) const
id_of_city get_home (id_of_person record) const
const type_of_index_of_city_by_name & get_index_of_city_by_name () const
const type_of_index_of_person_by_name & get_index_of_person_by_name () const
id_of_city next_city_by_name (id_of_city id) const
id_of_city previous_city_by_name (id_of_city id) const
id_of_city find_city_by_name (std::string_view field_value_of_name) const
range_of_person_by_name find_person_by_name (std::string_view field_value_of_last_name, std::string_view field_value_of_first_name) const

Static Public Member Functions

template<typename E = joedb::Exception>
static void throw_exception (std::string_view message)
static id_of_city null_city ()
static id_of_person null_person ()

Protected Member Functions

bool is_valid_record_id_for_city (Record_Id record_id) const
bool is_valid_record_id_for_person (Record_Id record_id) const
void remove_index_of_city_by_name (Record_Id record_id)
void add_index_of_city_by_name (Record_Id record_id)
void remove_index_of_person_by_name (Record_Id record_id)
void add_index_of_person_by_name (Record_Id record_id)
void internal_delete_city (Record_Id record_id)
void internal_delete_person (Record_Id record_id)
void internal_insert_city (Record_Id record_id)
void internal_vector_insert_city (Record_Id record_id, size_t size)
void internal_insert_person (Record_Id record_id)
void internal_vector_insert_person (Record_Id record_id, size_t size)
void internal_update_city__name (Record_Id record_id, std::string field_value_of_name)
void internal_update_vector_city__name (Record_Id record_id, size_t size, const std::string *value)
void internal_update_person__first_name (Record_Id record_id, std::string field_value_of_first_name)
void internal_update_vector_person__first_name (Record_Id record_id, size_t size, const std::string *value)
void internal_update_person__last_name (Record_Id record_id, std::string field_value_of_last_name)
void internal_update_vector_person__last_name (Record_Id record_id, size_t size, const std::string *value)
void internal_update_person__home (Record_Id record_id, id_of_city field_value_of_home)
void internal_update_vector_person__home (Record_Id record_id, size_t size, const id_of_city *value)

Protected Attributes

detail::data_of_city storage_of_city
detail::data_of_person storage_of_person
type_of_index_of_city_by_name index_of_city_by_name
type_of_index_of_person_by_name index_of_person_by_name

Friends

class Readable
class container_of_city
class container_of_person
class range_of_person_by_name

Detailed Description

Definition at line 95 of file Database.h.

Member Function Documentation

◆ add_index_of_city_by_name()

void tutorial::Database::add_index_of_city_by_name ( Record_Id record_id)
inlineprotected

Definition at line 130 of file Database.h.

◆ add_index_of_person_by_name()

void tutorial::Database::add_index_of_person_by_name ( Record_Id record_id)
inlineprotected

Definition at line 161 of file Database.h.

◆ find_city_by_name()

id_of_city tutorial::Database::find_city_by_name ( std::string_view field_value_of_name) const
inline

Definition at line 442 of file Database.h.

◆ find_person_by_name()

range_of_person_by_name tutorial::Database::find_person_by_name ( std::string_view field_value_of_last_name,
std::string_view field_value_of_first_name ) const
inline

Definition at line 599 of file Database.h.

◆ get_city_table()

container_of_city tutorial::Database::get_city_table ( ) const
inline

Definition at line 496 of file Database.h.

◆ get_first_name()

const std::string & tutorial::Database::get_first_name ( id_of_person record) const
inline

Definition at line 395 of file Database.h.

◆ get_home()

id_of_city tutorial::Database::get_home ( id_of_person record) const
inline

Definition at line 407 of file Database.h.

◆ get_index_of_city_by_name()

const type_of_index_of_city_by_name & tutorial::Database::get_index_of_city_by_name ( ) const
inline

Definition at line 413 of file Database.h.

◆ get_index_of_person_by_name()

const type_of_index_of_person_by_name & tutorial::Database::get_index_of_person_by_name ( ) const
inline

Definition at line 418 of file Database.h.

◆ get_last_name()

const std::string & tutorial::Database::get_last_name ( id_of_person record) const
inline

Definition at line 401 of file Database.h.

◆ get_name()

const std::string & tutorial::Database::get_name ( id_of_city record) const
inline

Definition at line 363 of file Database.h.

◆ get_person_table()

container_of_person tutorial::Database::get_person_table ( ) const
inline

Definition at line 554 of file Database.h.

◆ internal_delete_city()

void tutorial::Database::internal_delete_city ( Record_Id record_id)
inlineprotected

Definition at line 174 of file Database.h.

◆ internal_delete_person()

void tutorial::Database::internal_delete_person ( Record_Id record_id)
inlineprotected

Definition at line 181 of file Database.h.

◆ internal_insert_city()

void tutorial::Database::internal_insert_city ( Record_Id record_id)
inlineprotected

Definition at line 191 of file Database.h.

◆ internal_insert_person()

void tutorial::Database::internal_insert_person ( Record_Id record_id)
inlineprotected

Definition at line 208 of file Database.h.

◆ internal_update_city__name()

void tutorial::Database::internal_update_city__name ( Record_Id record_id,
std::string field_value_of_name )
inlineprotected

Definition at line 226 of file Database.h.

◆ internal_update_person__first_name()

void tutorial::Database::internal_update_person__first_name ( Record_Id record_id,
std::string field_value_of_first_name )
inlineprotected

Definition at line 255 of file Database.h.

◆ internal_update_person__home()

void tutorial::Database::internal_update_person__home ( Record_Id record_id,
id_of_city field_value_of_home )
inlineprotected

Definition at line 313 of file Database.h.

◆ internal_update_person__last_name()

void tutorial::Database::internal_update_person__last_name ( Record_Id record_id,
std::string field_value_of_last_name )
inlineprotected

Definition at line 284 of file Database.h.

◆ internal_update_vector_city__name()

void tutorial::Database::internal_update_vector_city__name ( Record_Id record_id,
size_t size,
const std::string * value )
inlineprotected

Definition at line 238 of file Database.h.

◆ internal_update_vector_person__first_name()

void tutorial::Database::internal_update_vector_person__first_name ( Record_Id record_id,
size_t size,
const std::string * value )
inlineprotected

Definition at line 267 of file Database.h.

◆ internal_update_vector_person__home()

void tutorial::Database::internal_update_vector_person__home ( Record_Id record_id,
size_t size,
const id_of_city * value )
inlineprotected

Definition at line 323 of file Database.h.

◆ internal_update_vector_person__last_name()

void tutorial::Database::internal_update_vector_person__last_name ( Record_Id record_id,
size_t size,
const std::string * value )
inlineprotected

Definition at line 296 of file Database.h.

◆ internal_vector_insert_city()

void tutorial::Database::internal_vector_insert_city ( Record_Id record_id,
size_t size )
inlineprotected

Definition at line 197 of file Database.h.

◆ internal_vector_insert_person()

void tutorial::Database::internal_vector_insert_person ( Record_Id record_id,
size_t size )
inlineprotected

Definition at line 214 of file Database.h.

◆ is_valid() [1/2]

bool tutorial::Database::is_valid ( id_of_city id) const
inline

Definition at line 111 of file Database.h.

◆ is_valid() [2/2]

bool tutorial::Database::is_valid ( id_of_person id) const
inline

Definition at line 112 of file Database.h.

◆ is_valid_record_id_for_city()

bool tutorial::Database::is_valid_record_id_for_city ( Record_Id record_id) const
inlineprotected

Definition at line 116 of file Database.h.

◆ is_valid_record_id_for_person()

bool tutorial::Database::is_valid_record_id_for_person ( Record_Id record_id) const
inlineprotected

Definition at line 118 of file Database.h.

◆ next() [1/2]

id_of_city tutorial::Database::next ( id_of_city id) const
inline

Definition at line 339 of file Database.h.

◆ next() [2/2]

id_of_person tutorial::Database::next ( id_of_person id) const
inline

Definition at line 371 of file Database.h.

◆ next_city_by_name()

id_of_city tutorial::Database::next_city_by_name ( id_of_city id) const
inline

Definition at line 423 of file Database.h.

◆ null_city()

id_of_city tutorial::Database::null_city ( )
inlinestatic

Definition at line 358 of file Database.h.

◆ null_person()

id_of_person tutorial::Database::null_person ( )
inlinestatic

Definition at line 390 of file Database.h.

◆ previous() [1/2]

id_of_city tutorial::Database::previous ( id_of_city id) const
inline

Definition at line 347 of file Database.h.

◆ previous() [2/2]

id_of_person tutorial::Database::previous ( id_of_person id) const
inline

Definition at line 379 of file Database.h.

◆ previous_city_by_name()

id_of_city tutorial::Database::previous_city_by_name ( id_of_city id) const
inline

Definition at line 433 of file Database.h.

◆ remove_index_of_city_by_name()

void tutorial::Database::remove_index_of_city_by_name ( Record_Id record_id)
inlineprotected

Definition at line 121 of file Database.h.

◆ remove_index_of_person_by_name()

void tutorial::Database::remove_index_of_person_by_name ( Record_Id record_id)
inlineprotected

Definition at line 152 of file Database.h.

◆ sorted_city()

template<class Comparator>
std::vector< id_of_city > tutorial::Database::sorted_city ( Comparator comparator) const

Definition at line 502 of file Database.h.

◆ sorted_person()

template<class Comparator>
std::vector< id_of_person > tutorial::Database::sorted_person ( Comparator comparator) const

Definition at line 560 of file Database.h.

◆ throw_exception()

template<typename E = joedb::Exception>
void tutorial::Database::throw_exception ( std::string_view message)
inlinestatic

Definition at line 104 of file Database.h.

◆ container_of_city

friend class container_of_city
friend

Definition at line 98 of file Database.h.

◆ container_of_person

friend class container_of_person
friend

Definition at line 99 of file Database.h.

◆ range_of_person_by_name

friend class range_of_person_by_name
friend

Definition at line 100 of file Database.h.

◆ Readable

friend class Readable
friend

Definition at line 97 of file Database.h.

Member Data Documentation

◆ index_of_city_by_name

type_of_index_of_city_by_name tutorial::Database::index_of_city_by_name
protected

Definition at line 120 of file Database.h.

◆ index_of_person_by_name

type_of_index_of_person_by_name tutorial::Database::index_of_person_by_name
protected

Definition at line 151 of file Database.h.

◆ storage_of_city

detail::data_of_city tutorial::Database::storage_of_city
protected

Definition at line 115 of file Database.h.

◆ storage_of_person

detail::data_of_person tutorial::Database::storage_of_person
protected

Definition at line 117 of file Database.h.


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