PhaseDependentActionList.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <type_traits>
7 
8 #include "Utilities/TMPL.hpp"
9 
10 namespace Parallel {
11 /*!
12  * \ingroup ParallelGroup
13  * \brief List of all the actions to be executed in the specified phase.
14  */
15 template <typename PhaseType, PhaseType Phase, typename ActionsList>
16 struct PhaseActions {
17  using action_list = ActionsList;
18  using phase_type = PhaseType;
19  static constexpr phase_type phase = Phase;
21  static constexpr size_t number_of_actions = tmpl::size<ActionsList>::value;
22 };
23 
24 /*!
25  * \ingroup ParallelGroup
26  * \brief (Lazy) metafunction to get the action list from a `PhaseActions`
27  */
28 template <typename PhaseDepActionList>
30  using type = typename PhaseDepActionList::action_list;
31 };
32 
33 /*!
34  * \ingroup ParallelGroup
35  * \brief (Lazy) metafunction to get the phase type from a `PhaseActions`
36  */
37 template <typename PhaseDepActionList>
39  using type = typename PhaseDepActionList::phase_type;
40 };
41 
42 /*!
43  * \ingroup ParallelGroup
44  * \brief (Lazy) metafunction to get the phase as a `std::integral_constant`
45  * from a `PhaseActions`
46  */
47 template <typename PhaseDepActionList>
49  using type = typename PhaseDepActionList::integral_constant_phase;
50 };
51 } // namespace Parallel
(Lazy) metafunction to get the phase as a std::integral_constant from a PhaseActions ...
Definition: PhaseDependentActionList.hpp:48
Contains functions that forward to Charm++ parallel functions.
Definition: Abort.hpp:13
(Lazy) metafunction to get the phase type from a PhaseActions
Definition: PhaseDependentActionList.hpp:38
Wraps the template metaprogramming library used (brigand)
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
(Lazy) metafunction to get the action list from a PhaseActions
Definition: PhaseDependentActionList.hpp:29