File indexing completed on 2025-07-23 08:06:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Propagator/detail/actor_list_implementation.hpp"
0012 #include "Acts/Utilities/TypeList.hpp"
0013
0014 namespace Acts {
0015
0016 template <typename T>
0017 struct ActorResultTypeExtractor {
0018 using type = typename T::result_type;
0019 };
0020
0021
0022
0023
0024
0025
0026 template <typename... actors_t>
0027 requires((std::is_default_constructible_v<actors_t> && ...) &&
0028 (std::is_copy_constructible_v<actors_t> && ...) &&
0029 (std::is_move_constructible_v<actors_t> && ...) &&
0030 ((Types::count<actors_t, TypeList<actors_t...>>::value == 1) && ...))
0031 struct ActorList {
0032
0033
0034
0035 template <template <typename...> class R>
0036 using result_type = typename Types::apply<
0037 R, typename Types::map<ActorResultTypeExtractor,
0038 typename Types::filter<ActorHasResultStruct,
0039 actors_t...>::type>::type>::
0040 type;
0041
0042
0043
0044 ActorList() = default;
0045
0046
0047
0048
0049 ActorList(const ActorList<actors_t...>& actors) = default;
0050
0051
0052
0053
0054 ActorList(ActorList<actors_t...>&& actors) = default;
0055
0056
0057
0058
0059 ActorList<actors_t...>& operator=(const ActorList<actors_t...>& actors) =
0060 default;
0061
0062
0063
0064
0065 ActorList<actors_t...>& operator=(ActorList<actors_t...>&& actors) = default;
0066
0067
0068
0069
0070 ActorList(const std::tuple<actors_t...>& actors) : m_actors(actors) {}
0071
0072
0073
0074
0075 ActorList(std::tuple<actors_t...>&& actors) : m_actors(std::move(actors)) {}
0076
0077
0078
0079
0080 template <typename actor_t>
0081 const actor_t& get() const {
0082 return std::get<actor_t>(m_actors);
0083 }
0084
0085
0086
0087
0088 template <typename actor_t>
0089 actor_t& get() {
0090 return std::get<actor_t>(m_actors);
0091 }
0092
0093
0094
0095
0096
0097
0098
0099
0100 template <typename... appendices_t>
0101 ActorList<actors_t..., appendices_t...> append(appendices_t... aps) const {
0102 auto catTuple =
0103 std::tuple_cat(m_actors, std::tuple<appendices_t...>(aps...));
0104 return ActorList<actors_t..., appendices_t...>(std::move(catTuple));
0105 }
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117 template <typename propagator_state_t, typename stepper_t,
0118 typename navigator_t, typename... Args>
0119 void act(propagator_state_t& state, const stepper_t& stepper,
0120 const navigator_t& navigator, Args&&... args) const {
0121 using impl = detail::actor_list_impl<actors_t...>;
0122 impl::act(m_actors, state, stepper, navigator, std::forward<Args>(args)...);
0123 }
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135 template <typename propagator_state_t, typename stepper_t,
0136 typename navigator_t, typename... Args>
0137 bool checkAbort(propagator_state_t& state, const stepper_t& stepper,
0138 const navigator_t& navigator, Args&&... args) const {
0139 using impl = detail::actor_list_impl<actors_t...>;
0140 return impl::checkAbort(m_actors, state, stepper, navigator,
0141 std::forward<Args>(args)...);
0142 }
0143
0144 private:
0145 std::tuple<actors_t...> m_actors;
0146 };
0147
0148 }