File indexing completed on 2025-12-15 09:42:12
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
0019 using type = typename T::result_type;
0020 };
0021
0022
0023
0024
0025
0026
0027 template <typename... actors_t>
0028 requires((std::is_default_constructible_v<actors_t> && ...) &&
0029 (std::is_copy_constructible_v<actors_t> && ...) &&
0030 (std::is_move_constructible_v<actors_t> && ...) &&
0031 ((Types::count<actors_t, TypeList<actors_t...>>::value == 1) && ...))
0032 struct ActorList {
0033
0034
0035
0036 template <template <typename...> class R>
0037 using result_type = typename Types::apply<
0038 R, typename Types::map<ActorResultTypeExtractor,
0039 typename Types::filter<ActorHasResultStruct,
0040 actors_t...>::type>::type>::
0041 type;
0042
0043
0044
0045 ActorList() = default;
0046
0047
0048
0049
0050 ActorList(const ActorList<actors_t...>& actors) = default;
0051
0052
0053
0054
0055 ActorList(ActorList<actors_t...>&& actors) noexcept = default;
0056
0057
0058
0059
0060
0061 ActorList<actors_t...>& operator=(const ActorList<actors_t...>& actors) =
0062 default;
0063
0064
0065
0066
0067
0068 ActorList<actors_t...>& operator=(ActorList<actors_t...>&& actors) noexcept =
0069 default;
0070
0071
0072
0073
0074 explicit ActorList(const std::tuple<actors_t...>& actors)
0075 : m_actors(actors) {}
0076
0077
0078
0079
0080 explicit ActorList(std::tuple<actors_t...>&& actors)
0081 : m_actors(std::move(actors)) {}
0082
0083
0084
0085
0086
0087 template <typename actor_t>
0088 const actor_t& get() const {
0089 return std::get<actor_t>(m_actors);
0090 }
0091
0092
0093
0094
0095
0096 template <typename actor_t>
0097 actor_t& get() {
0098 return std::get<actor_t>(m_actors);
0099 }
0100
0101
0102
0103
0104
0105
0106
0107
0108 template <typename... appendices_t>
0109 ActorList<actors_t..., appendices_t...> append(appendices_t... aps) const {
0110 auto catTuple =
0111 std::tuple_cat(m_actors, std::tuple<appendices_t...>(aps...));
0112 return ActorList<actors_t..., appendices_t...>(std::move(catTuple));
0113 }
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125 template <typename propagator_state_t, typename stepper_t,
0126 typename navigator_t, typename... Args>
0127 void act(propagator_state_t& state, const stepper_t& stepper,
0128 const navigator_t& navigator, Args&&... args) const {
0129 using impl = detail::actor_list_impl<actors_t...>;
0130 impl::act(m_actors, state, stepper, navigator, std::forward<Args>(args)...);
0131 }
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144 template <typename propagator_state_t, typename stepper_t,
0145 typename navigator_t, typename... Args>
0146 bool checkAbort(propagator_state_t& state, const stepper_t& stepper,
0147 const navigator_t& navigator, Args&&... args) const {
0148 using impl = detail::actor_list_impl<actors_t...>;
0149 return impl::checkAbort(m_actors, state, stepper, navigator,
0150 std::forward<Args>(args)...);
0151 }
0152
0153 private:
0154 std::tuple<actors_t...> m_actors;
0155 };
0156
0157 }