12#ifndef tutorial_rpc_city_Database_declared
13#define tutorial_rpc_city_Database_declared
40 class container_of_city;
46 std::vector<std::string> field_value_of_name;
50 size_t size()
const {
return freedom_keeper.
size();}
52 void resize(
size_t new_size)
54 field_value_of_name.resize(new_size);
55 freedom_keeper.
resize(new_size);
68 template<
typename E = joedb::Exception>
71 throw E(
"tutorial::rpc::city: " + message);
101 const std::string& field_value_of_name
105 storage_of_city.field_value_of_name[to_underlying(record_id)] = field_value_of_name;
112 const std::string *value
116 std::string *target = &
storage_of_city.field_value_of_name.data()[to_underlying(record_id)];
118 std::copy_n(value, size, target);
152 return (
const std::string&)(
storage_of_city.field_value_of_name[record.get_id()]);
171 iterator(
const detail::data_of_city &data): fk(&data.freedom_keeper), index(
joedb::Freedom_Keeper_Constants::used_list) {}
void resize(Record_Id new_size)
Record_Id get_previous(Record_Id index) const
Record_Id get_next(Record_Id index) const
Strongly-typed wrapper around an integer representing a row of the city table.
Store all the tables of the database.
friend class container_of_city
void internal_insert_city(Record_Id record_id)
void internal_update_city__name(Record_Id record_id, const std::string &field_value_of_name)
static constexpr id_of_city the_city()
container_of_city get_city_table() const
const std::string & get_name(id_of_city record=id_of_city{0}) const
static id_of_city null_city()
bool is_valid_record_id_for_city(Record_Id record_id) const
id_of_city next(id_of_city id) const
static void throw_exception(const std::string &message)
bool is_valid(id_of_city id) const
detail::data_of_city storage_of_city
void internal_vector_insert_city(Record_Id record_id, size_t size)
void internal_delete_city(Record_Id record_id)
id_of_city previous(id_of_city id) const
void internal_update_vector_city__name(Record_Id record_id, size_t size, const std::string *value)
Implement the joedb::Readable interface for a compiled database.
std::forward_iterator_tag iterator_category
bool operator==(const iterator &i) const
std::ptrdiff_t difference_type
id_of_city operator*() const
bool operator!=(const iterator &i) const
returned by Database::get_city_table
static id_of_city get_at(size_t i)
joedb::index_t get_size() const
id_of_city get_end() const
bool is_valid_at(size_t i)
#define JOEDB_RELEASE_ASSERT(x)
always-tested assertion (release and debug mode)
constexpr const char * get_version()
Automatically generated by joedbc.
tutorial::id_of_city id_of_city