|
SpECTRE
2021.08.02
|
A dynamically sized vector of DataVectors.
More...
#include <DynamicBuffer.hpp>
Public Member Functions | |
| DynamicBuffer (size_t number_of_vectors, size_t number_of_grid_points) noexcept | |
| DynamicBuffer (DynamicBuffer &&other)=default | |
| DynamicBuffer & | operator= (DynamicBuffer &&other)=default |
| DynamicBuffer (const DynamicBuffer &other) noexcept | |
| DynamicBuffer & | operator= (const DynamicBuffer &other) noexcept |
| T & | operator[] (size_t index) noexcept |
| T & | at (size_t index) noexcept |
| const T & | operator[] (size_t index) const noexcept |
| const T & | at (size_t index) const noexcept |
| auto | begin () noexcept |
| auto | end () noexcept |
| auto | begin () const noexcept |
| auto | end () const noexcept |
| size_t | size () const noexcept |
| void | pup (PUP::er &p) noexcept |
Static Public Attributes | |
| static constexpr bool | is_data_vector_type |
Friends | |
| template<typename LocalT > | |
| bool | operator== (const DynamicBuffer< LocalT > &lhs, const DynamicBuffer< LocalT > &rhs) noexcept |
A dynamically sized vector of DataVectors.
For convenience it can also be instantiated for fundamental types.
This class is useful when one wants to create a std::vector<T> with a size that is unknown at compile time. It allocates all DataVectors in a single memory chunk rather than allocating each individually. If the size of the vector is known at compile time, a TempBuffer object should be used instead.
If needed it should be fairly straightforward to generalize to ComplexDataVector.
|
noexcept |
Constructs a DynamicBuffer. The number_of_vectors corresponds to the number of DataVectors which are saved inside, each of which has size number_of_grid_points. number_of_grid_points has to be 1 if T is a fundamental type.
|
staticconstexpr |