vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
detector_event_timeline.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/detector_event_position_view.hpp>
6#include <vitrio/export.hpp>
7
8#include <cstddef>
9#include <cstdint>
10#include <vector>
11
12namespace vitrio
13{
14
39{
40public:
47 VITRIO_API
48 explicit detector_event_timeline(std::size_t rank);
49
50 VITRIO_API
52 VITRIO_API
54 VITRIO_API
56
57 VITRIO_API
58 detector_event_timeline& operator=(const detector_event_timeline &other);
59 VITRIO_API
61 operator=(detector_event_timeline &&other) noexcept;
62
74 VITRIO_API
76 std::uint64_t timestamp,
78 );
79
83 VITRIO_API
84 void clear() noexcept;
85
93 VITRIO_API
94 void reserve(std::size_t group_count, std::size_t event_count);
95
101 VITRIO_API
102 std::size_t get_rank() const noexcept;
103
109 VITRIO_API
110 std::size_t get_group_count() const noexcept;
111
117 VITRIO_API
118 std::size_t get_event_count() const noexcept;
119
127 VITRIO_API
128 std::uint64_t get_timestamp(std::size_t group) const noexcept;
129
139 VITRIO_API
141 get_positions(std::size_t group) const noexcept;
142
150 VITRIO_API
152
153private:
154 std::vector<std::uint64_t> m_timestamps;
155 std::vector<std::size_t> m_group_offsets;
156 std::vector<std::uint32_t> m_coordinates;
157 std::size_t m_rank;
158};
159
160} // namespace vitrio
A view of the positions of a sequence of events, as a matrix of one row per event and one column per ...
Definition detector_event_position_view.hpp:27
The events a detector counted over a stretch of time.
Definition detector_event_timeline.hpp:39
void add_group(std::uint64_t timestamp, detector_event_position_view positions)
Append the events of one timestamp.
detector_event_position_view get_positions() const noexcept
Get the positions of every event held.
std::size_t get_rank() const noexcept
Get the number of coordinates each event carries.
void clear() noexcept
Drop the events held, keeping the rank and the capacity.
void reserve(std::size_t group_count, std::size_t event_count)
Make room for a number of groups and events without allocating later.
std::size_t get_group_count() const noexcept
Get how many groups are held.
detector_event_timeline(std::size_t rank)
Construct an empty timeline of a given rank.
std::size_t get_event_count() const noexcept
Get how many events are held, in every group.
std::uint64_t get_timestamp(std::size_t group) const noexcept
Get the timestamp of one group.