Return value at the given index
| 328 | |
| 329 | // Return value at the given index |
| 330 | ResultType at(std::uint32_t index) const |
| 331 | { |
| 332 | if (values.empty()) |
| 333 | return ResultType(); |
| 334 | |
| 335 | // Get block external ad internal indices |
| 336 | const BlocksNumberType block_idx = index / (BLOCK_SIZE + 1); |
| 337 | const std::uint32_t internal_idx = index % (BLOCK_SIZE + 1); |
| 338 | |
| 339 | if (block_idx >= blocks.size()) |
| 340 | return ResultType(); |
| 341 | |
| 342 | // Get block first and last iterators |
| 343 | auto first = values.begin() + blocks[block_idx].offset; |
| 344 | auto last = block_idx + 1 == blocks.size() ? values.end() |
| 345 | : values.begin() + blocks[block_idx + 1].offset; |
| 346 | |
| 347 | const GroupBlockPolicy block; |
| 348 | block.ReadRefrencedBlock(blocks[block_idx], internal_idx, first, last); |
| 349 | |
| 350 | return adapt(first, last); |
| 351 | } |
| 352 | |
| 353 | friend void serialization::read<GroupBlockPolicy, Ownership>(storage::tar::FileReader &reader, |
| 354 | const std::string &name, |
nothing calls this directly
no test coverage detected