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 
48 template <typename Tag>
50  using tag = Tag;
51  using type = SomeType;
52 };
53 
54 
55 } // namespace Tags
56 } // namespace db
57 } // namespace TestHelpers
db::ComputeTag
Marks a DataBoxTag as being a compute item that executes a function.
Definition: Tag.hpp:109
db::PrefixTag
Marks an item as being a prefix to another tag.
Definition: Tag.hpp:66
TestHelpers::db::Tags::SimpleWithBaseCompute
Definition: TestTags.hpp:41
db::SimpleTag
Tags for the DataBox inherit from this type.
Definition: Tag.hpp:23
TestHelpers::db::Tags::Bad
Definition: TestTags.hpp:22
TestHelpers::db::Tags::SimpleWithBase
Definition: TestTags.hpp:30
TestHelpers::db::Tags::SimpleCompute
Definition: TestTags.hpp:34
db::BaseTag
Tags that are base tags, i.e. a simple or compute tag must derive off them for them to be useful.
Definition: Tag.hpp:41
TestHelpers::db::Tags::Simple
Definition: TestTags.hpp:24
Gsl.hpp
TestHelpers::db::Tags::Label
Definition: TestTags.hpp:49
TMPL.hpp
TestHelpers::db::Tags::Base
Definition: TestTags.hpp:28
db
Namespace for DataBox related things.
Definition: DataBox.hpp:43
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183
string