TRIQS/nda 1.3.0
Multi-dimensional array library for C++
|
#include <nda/mem/handle.hpp>
A handle for a memory block on the stack.
Host
nda::mem::AddressSpace.T | Value type of the data. |
Size | Size of the data (number of elements). |
Definition at line 359 of file handle.hpp.
Public Types | |
using | value_type = T |
Value type of the data. | |
Public Member Functions | |
handle_stack ()=default | |
Default constructor leaves the data uninitialized. | |
handle_stack (handle_stack &&h) noexcept | |
Move constructor simply calls the copy assignment operator. | |
handle_stack (handle_stack const &h) noexcept | |
Copy constructor simply calls the copy assignment operator. | |
handle_stack (long) | |
Construct a handle and initialize the data depending on the value type. | |
handle_stack (long, do_not_initialize_t) | |
Construct a handle and do not initialize the data. | |
handle_stack (long, init_zero_t) | |
Construct a handle and initialize the data to zero (only for scalar and complex types). | |
~handle_stack () noexcept | |
Destructor for the handle. | |
T * | data () const noexcept |
Get a pointer to the stored data. | |
handle_stack & | operator= (handle_stack &&h) noexcept |
Move assignment operator simply calls the copy assignment operator. | |
handle_stack & | operator= (handle_stack const &h) |
Copy assignment operator makes a deep copy of the data from the source handle using placement new. | |
T const & | operator[] (long i) const noexcept |
Subscript operator to access the data. | |
T & | operator[] (long i) noexcept |
Subscript operator to access the data. | |
Static Public Member Functions | |
static constexpr bool | is_null () noexcept |
Check if the handle is in a null state. | |
static constexpr long | size () noexcept |
Get the size of the handle. | |
Static Public Attributes | |
static constexpr auto | address_space = Host |
nda::mem::AddressSpace in which the memory is allocated (always on Host ). | |
|
inlinenoexcept |
Destructor for the handle.
For non-trivial objects, it explicitly calls their destructors. Otherwise, it does nothing.
Definition at line 378 of file handle.hpp.
|
inlinenoexcept |
Move constructor simply calls the copy assignment operator.
If an exception occurs in the constructor of T
, the program terminates.
h | Source handle. |
Definition at line 393 of file handle.hpp.
|
inlinenoexcept |
Copy constructor simply calls the copy assignment operator.
If an exception occurs in the constructor of T
, the program terminates.
h | Source handle. |
Definition at line 410 of file handle.hpp.
|
inline |
Construct a handle and initialize the data depending on the value type.
The data is initialized as follows:
T
is not trivial and not complex, the data is default constructed by placement new operator calls.Definition at line 437 of file handle.hpp.
|
inlinenodiscardnoexcept |
Get a pointer to the stored data.
Definition at line 469 of file handle.hpp.
|
inlinestaticconstexprnoexcept |
Check if the handle is in a null state.
Definition at line 463 of file handle.hpp.
|
inlinenoexcept |
Move assignment operator simply calls the copy assignment operator.
If an exception occurs in the constructor of T
, the program terminates.
h | Source handle. |
Definition at line 400 of file handle.hpp.
|
inline |
Copy assignment operator makes a deep copy of the data from the source handle using placement new.
h | Source handle. |
Definition at line 416 of file handle.hpp.
|
inlinenodiscardnoexcept |
Subscript operator to access the data.
i | Index of the element to access. |
Definition at line 457 of file handle.hpp.
|
inlinenodiscardnoexcept |
Subscript operator to access the data.
i | Index of the element to access. |
Definition at line 449 of file handle.hpp.
|
inlinestaticconstexprnoexcept |
Get the size of the handle.
T
in the handled memory. Definition at line 475 of file handle.hpp.