Subitems.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 
8 #include "Utilities/TMPL.hpp"
9 
10 namespace db {
11 /// \ingroup DataBoxGroup
12 /// Struct that can be specialized to allow DataBox items to have
13 /// subitems. Specializations must define:
14 /// * `using type = tmpl::list<...>` listing the subtags of `Tag`
15 /// * A static member function to initialize a subitem of a simple
16 /// item:
17 /// ```
18 /// template <typename Subtag>
19 /// static void create_item(
20 /// const gsl::not_null<typename Tag::type*> parent_value,
21 /// const gsl::not_null<typename Subtag::type*> sub_value) noexcept;
22 /// ```
23 /// Mutating the subitems must also modify the main item.
24 /// * A static member function evaluating a subitem of a compute
25 /// item:
26 /// ```
27 /// template <typename Subtag>
28 /// static typename Subtag::type create_compute_item(
29 /// typename Tag::type& parent_value) noexcept;
30 /// ```
31 template <typename Tag, typename = std::nullptr_t>
32 struct Subitems {
33  using type = tmpl::list<>;
34 };
35 } // namespace db
cstddef
db::Subitems
Definition: Subitems.hpp:32
TMPL.hpp
db
Namespace for DataBox related things.
Definition: DataBox.hpp:43