18 std::map<Table_Id, Table_Id> table_map;
21 for (
const auto &[tid, tname]:
db.get_tables())
24 table_map[tid] = mapped_tid;
32 std::map<Table_Id, std::map<Field_Id, Field_Id>> field_maps;
34 for (
const auto &[tid, tname]:
db.get_tables())
37 for (
const auto &[fid, fname]:
db.get_fields(tid))
40 Type type =
db.get_field_type(tid, fid);
43 field_maps[tid][fid] = mapped_fid;
45 writable.
add_field(table_map[tid], fname, type);
56 for (
const auto &[tid, tname]:
db.get_tables())
60 for (
Record_Id record_id{0}; record_id < table_size;)
62 while (record_id < table_size && !
db.is_used(tid, record_id))
69 record_id + size < table_size &&
70 db.is_used(tid, record_id + size)
79 record_id = record_id + size;
83 for (
const auto &[fid, fname]:
db.get_fields(tid))
85 for (
Record_Id record_id{0}; record_id < table_size; ++record_id)
87 if (
db.is_used(tid, record_id))
89 Table_Id mapped_tid = table_map[tid];
90 Field_Id mapped_fid = field_maps[tid][fid];
92 switch (
db.get_field_type(tid, fid).get_type_id())
97 #define TYPE_MACRO(type, return_type, type_id, R, W)\
98 case Type::Type_Id::type_id:\
99 writable.update_##type_id\
101 mapped_tid, record_id, mapped_fid, db.get_##type_id(tid, record_id, fid)\
116 for (
const auto &[tid, tname]:
db.get_tables())
121 for (
Record_Id record_id{0}; record_id < table_size;)
125 record_id < table_size &&
126 !freedom_keeper.
is_used(record_id)
136 record_id + size < table_size &&
137 freedom_keeper.
is_used(record_id + size)
150 for (
const auto &[fid, fname]:
db.get_fields(tid))
152 switch(
db.get_field_type(tid, fid).get_type_id())
157 #define TYPE_MACRO(type, return_type, type_id, R, W)\
158 case Type::Type_Id::type_id:\
160 const type &value = db.get_##type_id(tid, record_id, fid);\
162 writable.update_vector_##type_id(tid, record_id, fid, size, &value);\
164 writable.update_##type_id(tid, record_id, fid, value);\
172 record_id = record_id + size;