Warning, file /include/Acts/Propagator/detail/action_list_implementation.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Utilities/detail/MPL/type_collector.hpp"
0012
0013 #include <utility>
0014
0015 namespace Acts::detail {
0016
0017 namespace {
0018
0019
0020
0021 template <bool has_result = true>
0022 struct action_caller {
0023 template <typename actor_t, typename propagator_state_t, typename stepper_t,
0024 typename navigator_t, typename... Args>
0025 static void action(const actor_t& act, propagator_state_t& state,
0026 const stepper_t& stepper, const navigator_t& navigator,
0027 Args&&... args) {
0028 act(state, stepper, navigator,
0029 state.template get<detail::result_type_t<actor_t>>(),
0030 std::forward<Args>(args)...);
0031 }
0032 };
0033
0034
0035 template <>
0036 struct action_caller<false> {
0037 template <typename actor_t, typename propagator_state_t, typename stepper_t,
0038 typename navigator_t, typename... Args>
0039 static void action(const actor_t& act, propagator_state_t& state,
0040 const stepper_t& stepper, const navigator_t& navigator,
0041 Args&&... args) {
0042 act(state, stepper, navigator, std::forward<Args>(args)...);
0043 }
0044 };
0045 }
0046
0047
0048 template <typename... actors>
0049 struct action_list_impl;
0050
0051
0052
0053
0054 template <typename first, typename... others>
0055 struct action_list_impl<first, others...> {
0056 template <typename T, typename propagator_state_t, typename stepper_t,
0057 typename navigator_t, typename... Args>
0058 static void action(const T& actors_tuple, propagator_state_t& state,
0059 const stepper_t& stepper, const navigator_t& navigator,
0060 Args&&... args) {
0061 constexpr bool has_result = has_result_type_v<first>;
0062 const auto& this_actor = std::get<first>(actors_tuple);
0063 action_caller<has_result>::action(this_actor, state, stepper, navigator,
0064 args...);
0065 action_list_impl<others...>::action(actors_tuple, state, stepper, navigator,
0066 args...);
0067 }
0068 };
0069
0070
0071
0072 template <typename last>
0073 struct action_list_impl<last> {
0074 template <typename T, typename propagator_state_t, typename stepper_t,
0075 typename navigator_t, typename... Args>
0076 static void action(const T& actors_tuple, propagator_state_t& state,
0077 const stepper_t& stepper, const navigator_t& navigator,
0078 Args&&... args) {
0079 constexpr bool has_result = has_result_type_v<last>;
0080 const auto& this_actor = std::get<last>(actors_tuple);
0081 action_caller<has_result>::action(this_actor, state, stepper, navigator,
0082 std::forward<Args>(args)...);
0083 }
0084 };
0085
0086
0087 template <>
0088 struct action_list_impl<> {
0089 template <typename T, typename propagator_state_t, typename stepper_t,
0090 typename navigator_t, typename... Args>
0091 static void action(const T& , propagator_state_t& ,
0092 const stepper_t& ,
0093 const navigator_t& , Args&&... ) {}
0094 };
0095
0096 }