Joedb 10.2.0
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 std::map< std::string, id_of_city > & get_index_of_city_by_name ()
 
const std::multimap< std::tuple< std::string, std::string >, id_of_person > & get_index_of_person_by_name ()
 
id_of_city next_city_by_name (id_of_city id)
 
id_of_city previous_city_by_name (id_of_city id)
 
id_of_city find_city_by_name (const std::string &field_value_of_name) const
 
range_of_person_by_name find_person_by_name (const std::string &field_value_of_last_name, const std::string &field_value_of_first_name) const
 

Static Public Member Functions

template<typename E = joedb::Exception>
static void throw_exception (const std::string &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, const 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, const 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, const 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
 
std::map< std::string, id_of_cityindex_of_city_by_name
 
std::multimap< std::tuple< std::string, std::string >, id_of_personindex_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 90 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 123 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 154 of file Database.h.

◆ find_city_by_name()

id_of_city tutorial::Database::find_city_by_name ( const std::string &  field_value_of_name) const
inline

Definition at line 435 of file Database.h.

◆ find_person_by_name()

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

Definition at line 592 of file Database.h.

◆ get_city_table()

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

Definition at line 489 of file Database.h.

◆ get_first_name()

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

Definition at line 388 of file Database.h.

◆ get_home()

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

Definition at line 400 of file Database.h.

◆ get_index_of_city_by_name()

const std::map< std::string, id_of_city > & tutorial::Database::get_index_of_city_by_name ( )
inline

Definition at line 406 of file Database.h.

◆ get_index_of_person_by_name()

const std::multimap< std::tuple< std::string, std::string >, id_of_person > & tutorial::Database::get_index_of_person_by_name ( )
inline

Definition at line 411 of file Database.h.

◆ get_last_name()

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

Definition at line 394 of file Database.h.

◆ get_name()

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

Definition at line 356 of file Database.h.

◆ get_person_table()

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

Definition at line 547 of file Database.h.

◆ internal_delete_city()

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

Definition at line 167 of file Database.h.

◆ internal_delete_person()

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

Definition at line 174 of file Database.h.

◆ internal_insert_city()

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

Definition at line 184 of file Database.h.

◆ internal_insert_person()

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

Definition at line 201 of file Database.h.

◆ internal_update_city__name()

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

Definition at line 219 of file Database.h.

◆ internal_update_person__first_name()

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

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

◆ internal_update_person__last_name()

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

Definition at line 277 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 231 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 260 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 316 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 289 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 190 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 207 of file Database.h.

◆ is_valid() [1/2]

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

Definition at line 104 of file Database.h.

◆ is_valid() [2/2]

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

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

◆ next() [1/2]

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

Definition at line 332 of file Database.h.

◆ next() [2/2]

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

Definition at line 364 of file Database.h.

◆ next_city_by_name()

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

Definition at line 416 of file Database.h.

◆ null_city()

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

Definition at line 351 of file Database.h.

◆ null_person()

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

Definition at line 383 of file Database.h.

◆ previous() [1/2]

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

Definition at line 340 of file Database.h.

◆ previous() [2/2]

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

Definition at line 372 of file Database.h.

◆ previous_city_by_name()

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

Definition at line 426 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 114 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 145 of file Database.h.

◆ sorted_city()

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

Definition at line 495 of file Database.h.

◆ sorted_person()

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

Definition at line 553 of file Database.h.

◆ throw_exception()

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

Definition at line 99 of file Database.h.

Friends And Related Symbol Documentation

◆ container_of_city

friend class container_of_city
friend

Definition at line 93 of file Database.h.

◆ container_of_person

friend class container_of_person
friend

Definition at line 94 of file Database.h.

◆ range_of_person_by_name

friend class range_of_person_by_name
friend

Definition at line 95 of file Database.h.

◆ Readable

friend class Readable
friend

Definition at line 92 of file Database.h.

Member Data Documentation

◆ index_of_city_by_name

std::map<std::string, id_of_city> tutorial::Database::index_of_city_by_name
protected

Definition at line 113 of file Database.h.

◆ index_of_person_by_name

std::multimap<std::tuple<std::string, std::string>, id_of_person> tutorial::Database::index_of_person_by_name
protected

Definition at line 144 of file Database.h.

◆ storage_of_city

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

Definition at line 108 of file Database.h.

◆ storage_of_person

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

Definition at line 110 of file Database.h.


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