9 #include "DataStructures/TempBuffer.hpp"
12 #include "Utilities/TaggedTuple.hpp"
28 template <
typename Computer,
typename... Tags>
34 : data_(size), computer_(std::move(computer)) {}
37 template <
typename Tag>
38 const typename Tag::type&
get_var(Tag ) noexcept {
41 if (not
get<Computed<Tag>>(computed_flags_)) {
43 get<Computed<Tag>>(computed_flags_) =
true;
45 return get<Tag>(data_);
49 template <
typename Tag>
56 ((void)Tags{},
false)...};
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:638
const Tag::type & get_var(Tag) noexcept
Obtain a value from the buffer, computing it if necessary.
Definition: CachedTempBuffer.hpp:38
Definition: CachedTempBuffer.hpp:29
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
CachedTempBuffer(const size_t size, Computer computer) noexcept
Construct the buffer with the given computer. size is passed to the underlying TempBuffer constructor...
Definition: CachedTempBuffer.hpp:33
gsl::not_null< T * > make_not_null(T *ptr) noexcept
Construct a not_null from a pointer. Often this will be done as an implicit conversion,...
Definition: Gsl.hpp:880
A TempBuffer holds a set of Tensor<DataType>s, where DataType is either a DataVector (or similar type...
Definition: TempBuffer.hpp:30