|
vitrio 0.1.4
High-throughput image I/O for Cryo-Electron Microscopy (CryoEM)
|
A multidimensional array of numbers in host memory. More...
#include <vitrio/array/array.hpp>
Public Member Functions | |
| array () noexcept | |
| Construct an array that holds nothing. | |
| array (span< byte > memory, std::shared_ptr< void > owner, array_descriptor descriptor) | |
| Construct an array over memory allocated elsewhere. | |
| array (const array &other)=delete | |
| array (array &&other) noexcept | |
| array & | operator= (const array &other)=delete |
| array & | operator= (array &&other) noexcept |
| const array_descriptor & | get_descriptor () const noexcept |
| Get how the memory is read as an array. | |
| byte * | get_data () noexcept |
| Get the memory holding the elements. | |
| const byte * | get_data () const noexcept |
| Get the memory holding the elements, to read them. | |
| array | share () noexcept |
| Make another array over the same memory. | |
| const_array | share_const () const noexcept |
| Make a read-only array over the same memory. | |
A multidimensional array of numbers in host memory.
An array is a block of memory and the descriptor that says how to read it as a multidimensional array. It keeps the memory alive: the memory is released when the last array sharing it is destroyed.
An array cannot be copied, so that two names for the same elements are never made by accident. share makes another array over the same memory on purpose.
The array does nothing with its elements. It has no arithmetic, slicing or reshaping.
|
noexcept |
Construct an array that holds nothing.
Its descriptor is not initialized and it has no memory.
| vitrio::array::array | ( | span< byte > | memory, |
| std::shared_ptr< void > | owner, | ||
| array_descriptor | descriptor | ||
| ) |
Construct an array over memory allocated elsewhere.
The array keeps owner for as long as it or any array sharing its memory lives. Whatever releasing owner does is how the memory is released, so the memory may come from anywhere.
| memory | The memory holding the elements. |
| owner | What keeps memory alive. Must not be null. |
| descriptor | How memory is read as an array. |
| std::invalid_argument | If owner is null, 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 |
Get the memory holding the elements, to read them.
|
noexcept |
Get the memory holding the elements.
|
noexcept |
Get how the memory is read as an array.
|
noexcept |
Make another array over the same memory.
|
noexcept |
Make a read-only array over the same memory.