vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
index_table.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6#include <vitrio/span.hpp>
7
8#include <cstddef>
9#include <vector>
10
11namespace vitrio
12{
13
29{
30public:
36
44
50 ~index_table();
51
56
65 void add(span<const std::size_t> index);
66
72
79 void reserve(std::size_t count);
80
87 std::size_t get_rank() const noexcept;
88
96
107 span<const std::size_t> get(std::size_t position) const noexcept;
108
109private:
110 std::vector<std::size_t> m_values;
111 std::size_t m_rank;
112 std::size_t m_size;
113};
114
115} // namespace vitrio
A sequence of indices of one and the same rank.
Definition index_table.hpp:29
std::size_t get_rank() const noexcept
Get the number of coordinates each index carries.
span< const std::size_t > get(std::size_t position) const noexcept
Get one index.
void reserve(std::size_t count)
Make room for a number of indices without allocating later.
void clear() noexcept
Drop the indices held, keeping the rank and the capacity.
std::size_t get_index_count() const noexcept
Get how many indices are held.
index_table() noexcept
Construct an empty table of rank zero.
void add(span< const std::size_t > index)
Append one index.
A view of a contiguous sequence of elements.
Definition span.hpp:29