AddOptionsToDataBox.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <utility>
7 
9 
10 namespace Parallel {
11 /// \ingroup ParallelGroup
12 /// An `add_options_to_databox` struct that does not add any options to the
13 /// DataBox and should be used when a parallel component does not take any input
14 /// file options.
16  using simple_tags = tmpl::list<>;
17 
18  template <typename DbTagsList, typename... Args>
20  Args&&... /*args*/) noexcept {
21  return std::move(box);
22  }
23 };
24 
25 /// Given the tags `SimpleTags`, forwards them into the `DataBox`.
26 template <typename SimpleTagsList>
28 
29 /// \cond
30 template <typename... SimpleTags>
31 struct ForwardAllOptionsToDataBox<tmpl::list<SimpleTags...>> {
32  using simple_tags = tmpl::list<SimpleTags...>;
33 
34  template <typename DbTagsList, typename... Args>
35  static auto apply(db::DataBox<DbTagsList>&& box, Args&&... args) noexcept {
36  static_assert(
37  sizeof...(SimpleTags) == sizeof...(Args),
38  "The number of arguments passed to ForwardAllOptionsToDataBox must "
39  "match the number of SimpleTags passed.");
40  return db::create_from<db::RemoveTags<>, simple_tags>(
41  std::move(box), std::forward<Args>(args)...);
42  }
43 };
44 /// \endcond
45 } // namespace Parallel
Definition: Digraph.hpp:11
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
An add_options_to_databox struct that does not add any options to the DataBox and should be used when...
Definition: AddOptionsToDataBox.hpp:15
Defines classes and functions used for manipulating DataBox&#39;s.
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
Given the tags SimpleTags, forwards them into the DataBox.
Definition: AddOptionsToDataBox.hpp:27