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/TMPL.hpp"
11 
12 namespace TestHelpers {
13 
14 struct SomeType;
15 
16 SomeType do_something();
17 
18 namespace db {
19 namespace Tags {
20 
21 struct Bad {};
22 
24  using type = SomeType;
25 };
26 
27 struct Base : ::db::BaseTag {};
28 
30  using type = SomeType;
31 };
32 
34  using argument_list = tmpl::list<>;
35  static constexpr auto function = do_something;
36  static std::string name() noexcept { return "Compute"; }
37 };
38 
40  using base = Simple;
41  using argument_list = tmpl::list<>;
42  static constexpr auto function = do_something;
43 };
44 
46  using base = Base;
47  using argument_list = tmpl::list<>;
48  static constexpr auto function = do_something;
49 };
50 
52  using base = SimpleWithBase;
53  using argument_list = tmpl::list<>;
54  static constexpr auto function = do_something;
55 };
56 
57 template <typename Tag>
59  using tag = Tag;
60  using type = SomeType;
61 };
62 
63 template <typename Tag>
65  using tag = Tag;
66  using argument_list = tmpl::list<>;
67 
68  static std::string name() noexcept {
69  return "Operator(" + ::db::tag_name<Tag>() + ")";
70  }
71  static constexpr auto function = do_something;
72 };
73 
74 template <typename Tag>
76  using base = Label<Tag>;
77  using tag = Tag;
78  using argument_list = tmpl::list<>;
79  static constexpr auto function = do_something;
80 };
81 
82 } // namespace Tags
83 } // namespace db
84 } // namespace TestHelpers
Definition: TestTags.hpp:75
Definition: TestCreation.hpp:14
Definition: TestTags.hpp:39
Definition: TestTags.hpp:23
Marks a DataBoxTag as being a compute item that executes a function.
Definition: Tag.hpp:109
Tags for the DataBox inherit from this type.
Definition: Tag.hpp:23
Definition: TestTags.hpp:64
Definition: TestTags.hpp:21
Definition: TestTags.hpp:27
Definition: DataBoxTag.hpp:27
Definition: TestTags.hpp:33
Namespace for DataBox related things.
Definition: DataBox.hpp:42
Definition: TestTags.hpp:29
Wraps the template metaprogramming library used (brigand)
Marks an item as being a prefix to another tag.
Definition: Tag.hpp:66
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
Definition: TestTags.hpp:45
Definition: TestTags.hpp:58