|
TRIQS/nda 2.0.0
Multi-dimensional array library for C++
|
#include <nda/mem/handle.hpp>
A non-owning handle for a memory block on the heap.
| T | Value type of the data. |
| AdrSp | nda::mem::AddressSpace in which the memory is allocated. |
Definition at line 845 of file handle.hpp.
Public Types | |
| using | value_type = T |
| Value type of the data. | |
Public Member Functions | |
| handle_borrowed ()=default | |
| Default constructor leaves the handle in a null state (nullptr). | |
| template<Handle H> requires (address_space == H::address_space and (std::is_const_v<value_type> or !std::is_const_v<typename H::value_type>) and std::is_same_v<const value_type, const typename H::value_type>) | |
| handle_borrowed (H const &h, long offset=0) noexcept | |
| Construct a borrowed handle from another handle. | |
| handle_borrowed (handle_borrowed const &)=default | |
| Default copy constructor. | |
| handle_borrowed (T *ptr) noexcept | |
| Construct a borrowed handle from a pointer to the data. | |
| T * | data () const noexcept |
| Get a pointer to the stored data. | |
| bool | is_null () const noexcept |
| Check if the handle is in a null state. | |
| handle_borrowed & | operator= (handle_borrowed &&)=default |
| Default move assignment operator. | |
| handle_borrowed & | operator= (handle_borrowed const &)=default |
| Default copy assignment operator. | |
| T const & | operator[] (long i) const noexcept |
| Subscript operator to access the data. | |
| T & | operator[] (long i) noexcept |
| Subscript operator to access the data. | |
| handle_heap< T0 > const * | parent () const |
| Get a pointer to the parent handle. | |
Static Public Attributes | |
| static constexpr auto | address_space = AdrSp |
| nda::mem::AddressSpace in which the memory is allocated. | |
|
inlinenoexcept |
Construct a borrowed handle from a pointer to the data.
| ptr | Pointer to the start of the data. |
Definition at line 879 of file handle.hpp.
|
inlinenoexcept |
Construct a borrowed handle from another handle.
| H | nda::mem::Handle type. |
| h | Other handle. |
| offset | Pointer offset from the start of the data (in number of elements). |
Definition at line 891 of file handle.hpp.
|
inlinenodiscardnoexcept |
Get a pointer to the stored data.
Definition at line 927 of file handle.hpp.
|
inlinenodiscardnoexcept |
Check if the handle is in a null state.
Definition at line 915 of file handle.hpp.
|
inlinenodiscardnoexcept |
Subscript operator to access the data.
| i | Index of the element to access. |
Definition at line 909 of file handle.hpp.
|
inlinenodiscardnoexcept |
Subscript operator to access the data.
| i | Index of the element to access. |
Definition at line 901 of file handle.hpp.
|
inlinenodiscard |
Get a pointer to the parent handle.
Definition at line 921 of file handle.hpp.