vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
image_location_grouping.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/export.hpp>
6#include <vitrio/platform.hpp>
7#include <vitrio/span.hpp>
8
9#include <cstddef>
10#include <string>
11#include <vector>
12
13namespace vitrio
14{
15
16class image_location;
17
31{
32public:
33 class group;
34
40 VITRIO_API
42
43 VITRIO_API
45 VITRIO_API
47 VITRIO_API
49
50 VITRIO_API
52 operator=(const image_location_grouping &other);
53 VITRIO_API
55 operator=(image_location_grouping &&other) noexcept;
56
63 VITRIO_API
64 std::size_t get_group_count() const noexcept;
65
74 VITRIO_API
75 group get_group(std::size_t index) const;
76
77private:
78 VITRIO_STD_MEMBER_INTERFACE
79 std::vector<std::string> m_keys;
80 VITRIO_STD_MEMBER_INTERFACE
81 std::vector<std::size_t> m_indices;
82 VITRIO_STD_MEMBER_INTERFACE
83 std::vector<std::size_t> m_first_positions;
84};
85
93{
94public:
100 VITRIO_API
101 const std::string& get_key() const noexcept;
102
109 VITRIO_API
110 bool is_whole() const noexcept;
111
118 VITRIO_API
119 span<const std::size_t> get_indices() const noexcept;
120
121private:
122 friend class image_location_grouping;
123
124 group(const std::string &key, span<const std::size_t> indices) noexcept;
125
126 const std::string *m_key;
127 span<const std::size_t> m_indices;
128};
129
130} // namespace vitrio
The locations of one file in an image_location_grouping.
Definition image_location_grouping.hpp:93
const std::string & get_key() const noexcept
Get the key of the file.
Groups a list of image locations by file.
Definition image_location_grouping.hpp:31
std::size_t get_group_count() const noexcept
Get the number of groups.
image_location_grouping(span< const image_location > locations)
Group a list of locations by file.
group get_group(std::size_t index) const
Get the group of a file.
A view of a contiguous sequence of elements.
Definition span.hpp:29