File indexing completed on 2025-01-18 09:27:44
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Propagator/detail/abort_list_implementation.hpp"
0012 #include "Acts/Utilities/detail/Extendable.hpp"
0013 #include "Acts/Utilities/detail/MPL/has_duplicates.hpp"
0014 #include "Acts/Utilities/detail/MPL/type_collector.hpp"
0015
0016 #include <boost/hana/type.hpp>
0017 #include <boost/hana/unpack.hpp>
0018
0019 namespace hana = boost::hana;
0020
0021 namespace Acts {
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 template <typename... aborters_t>
0032 struct AbortList : public detail::Extendable<aborters_t...> {
0033 private:
0034 static_assert(!detail::has_duplicates_v<aborters_t...>,
0035 "same aborter type specified several times");
0036
0037 using detail::Extendable<aborters_t...>::tuple;
0038
0039 public:
0040
0041
0042 using result_type = typename decltype(hana::unpack(
0043 detail::type_collector_t<detail::action_type_extractor, aborters_t...>,
0044 hana::template_<AbortList>))::type;
0045
0046
0047 using detail::Extendable<aborters_t...>::get;
0048
0049
0050 AbortList() = default;
0051
0052
0053
0054
0055 AbortList(const AbortList<aborters_t...>& aborters) = default;
0056
0057
0058
0059
0060 AbortList(AbortList<aborters_t...>&& aborters) = default;
0061
0062
0063
0064
0065 AbortList<aborters_t...>& operator=(
0066 const AbortList<aborters_t...>& aborters) = default;
0067
0068
0069
0070
0071 AbortList<aborters_t...>& operator=(AbortList<aborters_t...>&& aborters) =
0072 default;
0073
0074
0075
0076
0077 AbortList(const std::tuple<aborters_t...>& aborters)
0078 : detail::Extendable<aborters_t...>(aborters) {}
0079
0080
0081
0082
0083 AbortList(std::tuple<aborters_t...>&& aborters)
0084 : detail::Extendable<aborters_t...>(std::move(aborters)) {}
0085
0086
0087 template <typename... appendices_t>
0088 AbortList<aborters_t..., appendices_t...> append(appendices_t... aps) const {
0089 auto catTuple =
0090 std::tuple_cat(tuple(), std::tuple<appendices_t...>(aps...));
0091 return AbortList<aborters_t..., appendices_t...>(std::move(catTuple));
0092 }
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105 template <typename propagator_state_t, typename stepper_t,
0106 typename navigator_t, typename... Args>
0107 bool operator()(propagator_state_t& state, const stepper_t& stepper,
0108 const navigator_t& navigator, Args&&... args) const {
0109 using impl = detail::abort_list_impl<aborters_t...>;
0110 return impl::check(tuple(), state, stepper, navigator,
0111 std::forward<Args>(args)...);
0112 }
0113 };
0114
0115 }