A read-only reference to a multidimensional array that does not keep it alive.
More...
#include <vitrio/array/const_array_ref.hpp>
A read-only reference to a multidimensional array that does not keep it alive.
It is an array_ref whose elements can only be read: two pointers that own nothing and are as cheap to copy. An array, a const_array and an array_ref each convert to it.
- See also
- const_array
-
array_ref
◆ const_array_ref() [1/5]
| vitrio::const_array_ref::const_array_ref |
( |
| ) |
|
|
noexcept |
Construct a reference to nothing.
Its descriptor is not initialized and it has no memory.
◆ const_array_ref() [2/5]
Construct a reference to memory the caller keeps alive.
- Parameters
-
| 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. |
- Exceptions
-
| 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. |
◆ const_array_ref() [3/5]
| vitrio::const_array_ref::const_array_ref |
( |
const array & |
other | ) |
|
|
noexcept |
Construct a reference to an array.
- Parameters
-
| other | The array to refer to. It must outlive the reference and its copies. |
◆ const_array_ref() [4/5]
Construct a reference to a read-only array.
- Parameters
-
| other | The array to refer to. It must outlive the reference and its copies. |
◆ const_array_ref() [5/5]
| vitrio::const_array_ref::const_array_ref |
( |
array_ref |
other | ) |
|
|
noexcept |
Construct a reference to what another reference refers to.
- Parameters
-
| other | The reference whose array to refer to. |
◆ get_data()
| const byte * vitrio::const_array_ref::get_data |
( |
| ) |
const |
|
noexcept |
Get the memory holding the elements.
- Returns
- const byte* The first byte of the memory. The element at the origin is at the offset the descriptor states. Null when the reference is to nothing.
◆ get_descriptor()
Get how the memory is read as an array.
- Returns
- const array_descriptor& The descriptor. Not initialized when the reference is to nothing.
The documentation for this class was generated from the following file: