|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
A reference to a multidimensional array that does not keep it alive. More...
#include <vitrio/array/array_ref.hpp>
Public Member Functions | |
| array_ref () noexcept | |
| Construct a reference to nothing. | |
| array_ref (span< byte > memory, const array_descriptor &descriptor) | |
| Construct a reference to memory the caller keeps alive. | |
| array_ref (span< byte > memory, const array_descriptor &&descriptor)=delete | |
| array_ref (array &other) noexcept | |
| Construct a reference to an array. | |
| array_ref (array &&other)=delete | |
| array_ref (const array_ref &other) noexcept=default | |
| array_ref & | operator= (const array_ref &other) noexcept=default |
| const array_descriptor & | get_descriptor () const noexcept |
| Get how the memory is read as an array. | |
| byte * | get_data () const noexcept |
| Get the memory holding the elements. | |
A reference to a multidimensional array that does not keep it alive.
A reference is two pointers, one to the memory of an array and one to its descriptor. It owns neither, so copying it copies the two pointers and nothing else, as copying a span does.
It is the parameter type of a function that uses an array only until it returns. What it refers to must outlive it, so a reference should not be stored.
An array converts to a reference to itself.
|
noexcept |
Construct a reference to nothing.
Its descriptor is not initialized and it has no memory.
| vitrio::array_ref::array_ref | ( | span< byte > | memory, |
| const array_descriptor & | descriptor | ||
| ) |
Construct a reference to memory the caller keeps alive.
| memory | The memory holding the elements. It must outlive the reference and its copies. |
| descriptor | How memory is read as an array. It must outlive the reference and its copies. |
| std::invalid_argument | If descriptor is not initialized, or if memory is not aligned to the elements. |
| std::out_of_range | If an element descriptor addresses lies outside memory. |
|
noexcept |
Construct a reference to an array.
| other | The array to refer to. It must outlive the reference and its copies. |
|
noexcept |
Get the memory holding the elements.
|
noexcept |
Get how the memory is read as an array.