|
rexlib 0.1.0
Device-agnostic array computing library for CryoEM and CryoET image processing, with a pluggable backend architecture
|
Represents a non-owning area of contiguous memory. More...
#include <rexlib/core/span.hpp>
Public Types | |
| using | element_type = T |
| using | value_type = typename std::remove_cv< element_type >::type |
| using | size_type = std::size_t |
| using | difference_type = std::ptrdiff_t |
| using | pointer = element_type * |
| using | const_pointer = const element_type * |
| using | reference = element_type & |
| using | const_reference = const element_type & |
| using | iterator = pointer |
| using | reverse_iterator = std::reverse_iterator< iterator > |
Public Member Functions | |
| REXLIB_CONSTEXPR | span (pointer ptr, size_type count) |
| Construct from a pointer and size. | |
| REXLIB_CONSTEXPR | span (pointer first, pointer last) |
| Construct from a pointer pair. | |
| template<std::size_t Extent2> | |
| REXLIB_CONSTEXPR | span (const span< value_type, Extent2 > &other) |
| Construct span from another span. | |
| template<std::size_t Extent2> | |
| REXLIB_CONSTEXPR | span (const span< const value_type, Extent2 > &other) |
| Construct span from another span. | |
| span (const span &other)=default | |
| span (span &&other)=default | |
| span & | operator= (const span &other)=default |
| span & | operator= (span &&other)=default |
| REXLIB_CONSTEXPR size_type | size () const noexcept |
| Get the number of referenced objects. | |
| REXLIB_CONSTEXPR size_type | size_bytes () const noexcept |
| Get the size in bytes of the referenced objects. | |
| REXLIB_NODISCARD REXLIB_CONSTEXPR bool | empty () const noexcept |
| Check if no objects are references. | |
| REXLIB_CONSTEXPR reference | operator[] (size_type idx) const noexcept |
| Obtain a reference to an object by its index. | |
| REXLIB_CONSTEXPR reference | front () const noexcept |
| Obtain a reference to the first object. | |
| REXLIB_CONSTEXPR reference | back () const noexcept |
| Obtain a reference to the last object. | |
| REXLIB_CONSTEXPR pointer | data () const noexcept |
| Get a pointer to the referenced data. | |
| REXLIB_CONSTEXPR iterator | begin () const noexcept |
| Get an iterator to the first item. | |
| REXLIB_CONSTEXPR iterator | end () const noexcept |
| Get an iterator to the past-the-end item. | |
| REXLIB_CONSTEXPR reverse_iterator | rbegin () const noexcept |
| Get a reverse iterator to the last item. | |
| REXLIB_CONSTEXPR reverse_iterator | rend () const noexcept |
| Get a reverse iterator to the before-first item. | |
Static Public Attributes | |
| static constexpr size_type | extent = Extent |
Represents a non-owning area of contiguous memory.
Provides a pre C++20 implementation of std::span.
| T | Type of the elements. |
| Extent | Size of the area. Use dynamic_extent dynamic assignation. |
| REXLIB_CONSTEXPR rexlib::span< T, Extent >::span | ( | pointer | ptr, |
| size_type | count | ||
| ) |
Construct from a pointer and size.
| ptr | Pointer to the data. |
| count | Number of elements. |
| REXLIB_CONSTEXPR rexlib::span< T, Extent >::span | ( | pointer | first, |
| pointer | last | ||
| ) |
Construct from a pointer pair.
| first | Pointer to the first element. |
| last | Pointer to the past-the-end element. |
| REXLIB_CONSTEXPR rexlib::span< T, Extent >::span | ( | const span< value_type, Extent2 > & | other | ) |
Construct span from another span.
| Extent2 | The extent of the other span. Must be compatible with the current extent. |
| other | The other span. |
| REXLIB_CONSTEXPR rexlib::span< T, Extent >::span | ( | const span< const value_type, Extent2 > & | other | ) |
Construct span from another span.
| Extent2 | The extent of the other span. Must be compatible with the current extent. |
| other | The other span. |
|
noexcept |
Obtain a reference to the last object.
|
noexcept |
Get an iterator to the first item.
|
noexcept |
Get a pointer to the referenced data.
|
noexcept |
Check if no objects are references.
|
noexcept |
Get an iterator to the past-the-end item.
|
noexcept |
Obtain a reference to the first object.
|
noexcept |
Obtain a reference to an object by its index.
| idx | The index of the object. Must be in [0...size()) |
|
noexcept |
Get a reverse iterator to the last item.
|
noexcept |
Get a reverse iterator to the before-first item.
|
noexcept |
Get the number of referenced objects.
|
noexcept |
Get the size in bytes of the referenced objects.