Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include "DataStructures/DataBox/Subitems.hpp"
7 : #include "DataStructures/DataBox/Tag.hpp"
8 : #include "Utilities/TMPL.hpp"
9 :
10 : namespace Tags {
11 :
12 : /// \cond
13 : // Declaration of a tag for a subitem
14 : // Unless specialized, it will be the reference tag below,
15 : template <typename Tag, typename ParentTag, typename = std::nullptr_t>
16 : struct Subitem;
17 : /// \endcond
18 :
19 : /// \brief a reference tag that refers to a particular Tag that is a subitem of
20 : /// an item tagged with ParentTag
21 : template <typename Tag, typename ParentTag, typename>
22 1 : struct Subitem : Tag, db::ReferenceTag {
23 0 : using base = Tag;
24 0 : using argument_tags = tmpl::list<typename ParentTag::base>;
25 0 : static const auto& get(
26 : const typename ParentTag::type& parent_value) {
27 : return ::db::Subitems<ParentTag>::template create_compute_item<base>(
28 : parent_value);
29 : }
30 : };
31 : } // namespace Tags
|