Checkout span to automatically manage the lifetime of checked-out memory. More...
#include <checkout_span.hpp>
Public Types | |
using | element_type = T |
using | value_type = std::remove_cv_t< element_type > |
using | size_type = std::size_t |
using | pointer = element_type * |
using | const_pointer = std::add_const_t< element_type > * |
using | difference_type = typename std::iterator_traits< pointer >::difference_type |
using | reference = typename std::iterator_traits< pointer >::reference |
using | const_reference = typename std::iterator_traits< const_pointer >::reference |
using | iterator = pointer |
using | const_iterator = const_pointer |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
Public Member Functions | |
checkout_span () | |
checkout_span (ori::global_ptr< T > gptr, std::size_t n, Mode) | |
Construct a checkout span by checking out a global memory region. More... | |
~checkout_span () | |
Perform the checkin operation when destroyed. More... | |
checkout_span (const checkout_span &)=delete | |
checkout_span & | operator= (const checkout_span &)=delete |
checkout_span (checkout_span &&cs) | |
checkout_span & | operator= (checkout_span &&cs) |
constexpr pointer | data () const noexcept |
constexpr size_type | size () const noexcept |
constexpr iterator | begin () const noexcept |
constexpr iterator | end () const noexcept |
constexpr const_iterator | cbegin () const noexcept |
constexpr const_iterator | cend () const noexcept |
constexpr reverse_iterator | rbegin () const noexcept |
constexpr reverse_iterator | rend () const noexcept |
constexpr const_reverse_iterator | crbegin () const noexcept |
constexpr const_reverse_iterator | crend () const noexcept |
constexpr reference | operator[] (size_type i) const |
constexpr reference | front () const |
constexpr reference | back () const |
constexpr bool | empty () const noexcept |
void | checkout (ori::global_ptr< T > gptr, std::size_t n, Mode) |
Manually perform the checkout operation by checking in the previous span. More... | |
void | checkout_nb (ori::global_ptr< T > gptr, std::size_t n, Mode) |
Manually perform the nonblocking checkout operation by checking in the previous span. More... | |
void | checkin () |
Manually perform the checkin operation by discarding the current checkout span. More... | |
Checkout span to automatically manage the lifetime of checked-out memory.
A global memory region can be checked out at the constructor and checked in at the destructor. The checkout span can be moved but cannot be copied, in order to ensure the checkin operation is performed only once. The checkout span can be used as in std::span
(C++20) to access elements in the checked-out memory region.
ityr::make_checkout()
is a helper function to create the checkout span.
ityr::make_checkout()
. using ityr::checkout_span< T, Mode >::const_iterator = const_pointer |
using ityr::checkout_span< T, Mode >::const_pointer = std::add_const_t<element_type>* |
using ityr::checkout_span< T, Mode >::const_reference = typename std::iterator_traits<const_pointer>::reference |
using ityr::checkout_span< T, Mode >::const_reverse_iterator = std::reverse_iterator<const_iterator> |
using ityr::checkout_span< T, Mode >::difference_type = typename std::iterator_traits<pointer>::difference_type |
using ityr::checkout_span< T, Mode >::element_type = T |
using ityr::checkout_span< T, Mode >::iterator = pointer |
using ityr::checkout_span< T, Mode >::pointer = element_type* |
using ityr::checkout_span< T, Mode >::reference = typename std::iterator_traits<pointer>::reference |
using ityr::checkout_span< T, Mode >::reverse_iterator = std::reverse_iterator<iterator> |
using ityr::checkout_span< T, Mode >::size_type = std::size_t |
using ityr::checkout_span< T, Mode >::value_type = std::remove_cv_t<element_type> |
|
inline |
|
inlineexplicit |
Construct a checkout span by checking out a global memory region.
|
inline |
Perform the checkin operation when destroyed.
|
delete |
|
inline |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
Manually perform the checkin operation by discarding the current checkout span.
|
inline |
Manually perform the checkout operation by checking in the previous span.
|
inline |
Manually perform the nonblocking checkout operation by checking in the previous span.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexpr |
|
inline |
|
delete |
|
inlineconstexpr |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |