vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
Loading...
Searching...
No Matches
const_array_ref.hpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2
3#pragma once
4
5#include <vitrio/array/array_descriptor.hpp>
6#include <vitrio/array/array_ref.hpp>
7#include <vitrio/byte.hpp>
8#include <vitrio/export.hpp>
9#include <vitrio/span.hpp>
10
11namespace vitrio
12{
13
14class array;
15class const_array;
16
29{
30public:
36 VITRIO_API
37 const_array_ref() noexcept;
38
51 VITRIO_API
53 span<const byte> memory,
54 const array_descriptor &descriptor
55 );
56
57 // A temporary descriptor would be gone before the reference is used.
59 span<const byte> memory,
60 const array_descriptor &&descriptor
61 ) = delete;
62
69 VITRIO_API
70 const_array_ref(const array &other) noexcept;
71
78 VITRIO_API
79 const_array_ref(const const_array &other) noexcept;
80
86 VITRIO_API
87 const_array_ref(array_ref other) noexcept;
88
89 const_array_ref(const const_array_ref &other) noexcept = default;
90 ~const_array_ref() = default;
91
93 operator=(const const_array_ref &other) noexcept = default;
94
101 VITRIO_API
102 const array_descriptor& get_descriptor() const noexcept;
103
111 VITRIO_API
112 const byte* get_data() const noexcept;
113
114private:
115 const byte *m_data;
116 const array_descriptor *m_descriptor;
117};
118
119} // namespace vitrio
How a block of memory is read as a multidimensional array.
Definition array_descriptor.hpp:31
A reference to a multidimensional array that does not keep it alive.
Definition array_ref.hpp:32
A multidimensional array of numbers in host memory.
Definition array.hpp:37
A read-only reference to a multidimensional array that does not keep it alive.
Definition const_array_ref.hpp:29
const_array_ref() noexcept
Construct a reference to nothing.
const array_descriptor & get_descriptor() const noexcept
Get how the memory is read as an array.
const byte * get_data() const noexcept
Get the memory holding the elements.
A multidimensional array of numbers that cannot be written through.
Definition const_array.hpp:29
A view of a contiguous sequence of elements.
Definition span.hpp:29