TestTags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <string>
7 
8 #include "DataStructures/DataBox/Tag.hpp"
9 #include "DataStructures/DataBox/TagName.hpp"
10 #include "Utilities/Gsl.hpp"
11 #include "Utilities/TMPL.hpp"
12 
13 namespace TestHelpers {
14 
15 struct SomeType;
16 
17 void do_something(gsl::not_null<SomeType*> /* return_value */);
18 
19 namespace db {
20 namespace Tags {
21 
22 struct Bad {};
23 
25  using type = SomeType;
26 };
27 
28 struct Base : ::db::BaseTag {};
29 
31  using type = SomeType;
32 };
33 
35  using base = Simple;
36  using return_type = SomeType;
37  using argument_tags = tmpl::list<>;
38  static constexpr auto function = do_something;
39 };
40 
42  using base = SimpleWithBase;
43  using return_type = SomeType;
44  using argument_tags = tmpl::list<>;
45  static constexpr auto function = do_something;
46 };
47 
49  using type = SomeType;
50 };
51 
53  using base = Simple;
54  using parent_tag = ParentTag;
55  static const auto& get(const typename parent_tag::type& /* parent_value */);
56  using argument_tags = tmpl::list<parent_tag>;
57 };
58 
60  using base = SimpleWithBase;
61  using parent_tag = ParentTag;
62  static const auto& get(const typename parent_tag::type& /* parent_value */);
63  using argument_tags = tmpl::list<parent_tag>;
64 };
65 
66 template <typename Tag>
68  using tag = Tag;
69  using type = SomeType;
70 };
71 
72 
73 } // namespace Tags
74 } // namespace db
75 } // namespace TestHelpers
db::ComputeTag
Mark a struct as a compute tag by inheriting from this.
Definition: Tag.hpp:157
db::PrefixTag
Mark a struct as a prefix tag by inheriting from this.
Definition: Tag.hpp:103
TestHelpers::db::Tags::SimpleWithBaseCompute
Definition: TestTags.hpp:41
db::SimpleTag
Mark a struct as a simple tag by inheriting from this.
Definition: Tag.hpp:36
TestHelpers::db::Tags::SimpleReference
Definition: TestTags.hpp:52
db::ReferenceTag
Mark a struct as a reference tag by inheriting from this.
Definition: Tag.hpp:188
TestHelpers::db::Tags::Bad
Definition: TestTags.hpp:22
TestHelpers::db::Tags::SimpleWithBaseReference
Definition: TestTags.hpp:59
TestHelpers::db::Tags::SimpleWithBase
Definition: TestTags.hpp:30
TestHelpers::db::Tags::ParentTag
Definition: TestTags.hpp:48
TestHelpers::db::Tags::SimpleCompute
Definition: TestTags.hpp:34
db::BaseTag
Mark a (usually) empty struct as a base tag by inheriting from this.
Definition: Tag.hpp:69
TestHelpers::db::Tags::Simple
Definition: TestTags.hpp:24
Gsl.hpp
TestHelpers::db::Tags::Label
Definition: TestTags.hpp:67
TMPL.hpp
TestHelpers::db::Tags::Base
Definition: TestTags.hpp:28
db
Namespace for DataBox related things.
Definition: DataBox.hpp:44
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13
string