upd: first version of booksystem

This commit is contained in:
2023-12-14 03:01:37 +00:00
parent db4830d7d9
commit 7ca2b28548
6 changed files with 230 additions and 9 deletions

View File

@ -226,6 +226,18 @@ class DriveArray {
first_vacant_data_index;
first_vacant_data_index = index;
}
void FetchAll(std::vector<T> &vec) noexcept {
vec.clear();
for (int i = 1; i <= total_block_number; ++i) {
BlockType *blk_ptr = OrderBlock(i);
for (int j = 0; j < kDataPerBlock; ++j) {
if (blk_ptr->data[j].next_vacant_data_index == -1) {
vec.push_back(blk_ptr->data[j].val);
}
}
}
}
};
#endif // PROTECTOR_DRIVEARRAY_HPP