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

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

#include <tutorial/Database.h>

Inheritance diagram for tutorial::Database:
Inheritance graph
[legend]
Collaboration diagram for tutorial::Database:
Collaboration graph
[legend]

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_citysorted_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_personsorted_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_nameget_index_of_city_by_name ()
 
const type_of_index_of_person_by_nameget_index_of_person_by_name ()
 
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_view 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_view 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_view 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 94 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 129 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 160 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 441 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 598 of file Database.h.

◆ get_city_table()

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

Definition at line 495 of file Database.h.

◆ get_first_name()

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

Definition at line 394 of file Database.h.

◆ get_home()

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

Definition at line 406 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 ( )
inline

Definition at line 412 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 ( )
inline

Definition at line 417 of file Database.h.

◆ get_last_name()

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

Definition at line 400 of file Database.h.

◆ get_name()

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

Definition at line 362 of file Database.h.

◆ get_person_table()

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

Definition at line 553 of file Database.h.

◆ internal_delete_city()

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

Definition at line 173 of file Database.h.

◆ internal_delete_person()

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

Definition at line 180 of file Database.h.

◆ internal_insert_city()

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

Definition at line 190 of file Database.h.

◆ internal_insert_person()

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

Definition at line 207 of file Database.h.

◆ internal_update_city__name()

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

Definition at line 225 of file Database.h.

◆ internal_update_person__first_name()

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

Definition at line 254 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 312 of file Database.h.

◆ internal_update_person__last_name()

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

Definition at line 283 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 237 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 266 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 322 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 295 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 196 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 213 of file Database.h.

◆ is_valid() [1/2]

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

Definition at line 110 of file Database.h.

◆ is_valid() [2/2]

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

Definition at line 111 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 115 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 117 of file Database.h.

◆ next() [1/2]

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

Definition at line 338 of file Database.h.

◆ next() [2/2]

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

Definition at line 370 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 422 of file Database.h.

◆ null_city()

static id_of_city tutorial::Database::null_city ( )
inlinestatic

Definition at line 357 of file Database.h.

◆ null_person()

static id_of_person tutorial::Database::null_person ( )
inlinestatic

Definition at line 389 of file Database.h.

◆ previous() [1/2]

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

Definition at line 346 of file Database.h.

◆ previous() [2/2]

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

Definition at line 378 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 432 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 120 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 151 of file Database.h.

◆ sorted_city()

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

Definition at line 501 of file Database.h.

◆ sorted_person()

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

Definition at line 559 of file Database.h.

◆ throw_exception()

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

Definition at line 103 of file Database.h.

Friends And Related Symbol Documentation

◆ container_of_city

friend class container_of_city
friend

Definition at line 97 of file Database.h.

◆ container_of_person

friend class container_of_person
friend

Definition at line 98 of file Database.h.

◆ range_of_person_by_name

friend class range_of_person_by_name
friend

Definition at line 99 of file Database.h.

◆ Readable

friend class Readable
friend

Definition at line 96 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 119 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 150 of file Database.h.

◆ storage_of_city

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

Definition at line 114 of file Database.h.

◆ storage_of_person

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

Definition at line 116 of file Database.h.


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