Base class for navigation policy factories.
More...
#include <Acts/Geometry/NavigationPolicyFactory.hpp>
|
|
| NavigationPolicyFactory ()=default |
| | Default constructor.
|
template<NavigationPolicyConcept P, typename... Args>
requires (std::is_constructible_v<P, const GeometryContext&, const TrackingVolume&, const Logger&, Args...> && (std::is_copy_constructible_v<Args> && ...)) |
| constexpr NavigationPolicyFactory | add (Args &&... args) && |
| | Add a navigation policy to the factory.
|
template<typename Fn, typename... Args>
requires (detail::NavigationPolicyValueFactoryConcept<Fn, Args...> && !detail::NavigationPolicyPointerFactoryConcept<Fn, Args...> && (std::is_copy_constructible_v<Args> && ...)) |
| constexpr NavigationPolicyFactory | add (Fn &&fn, Args &&... args) && |
| | Add a policy created by a factory function that returns a concrete policy by value.
|
template<typename Fn, typename... Args>
requires (detail::NavigationPolicyPointerFactoryConcept<Fn, Args...> && (std::is_copy_constructible_v<Args> && ...)) |
| constexpr NavigationPolicyFactory | add (Fn &&fn, Args &&... args) && |
| | Add a policy created by a factory function that returns a std::unique_ptr to a navigation policy.
|
| std::unique_ptr< NavigationPolicyFactory > | asUniquePtr () && |
| | Move the factory into a unique pointer.
|
| std::unique_ptr< INavigationPolicy > | build (const GeometryContext &gctx, const TrackingVolume &volume, const Logger &logger) const |
| | Construct a navigation policy using the factories (alias for operator()).
|
| std::unique_ptr< MultiNavigationPolicy > | operator() (const GeometryContext &gctx, const TrackingVolume &volume, const Logger &logger) const |
| | Construct a multi-navigation policy using the registered factories.
|
Base class for navigation policy factories.
The factory can be assembled iteratively by using make followed by a number of calls to the add function of the helper type. Example:
auto factory = NavigationPolicyFactory{}
.add<NavigationPolicy1>(arg1, arg2)
constexpr NavigationPolicyFactory add(Args &&... args) &&
Add a navigation policy to the factory.
Definition NavigationPolicyFactory.hpp:101
std::unique_ptr< NavigationPolicyFactory > asUniquePtr() &&
Move the factory into a unique pointer.
Definition NavigationPolicyFactory.hpp:169
◆ add() [1/3]
template<NavigationPolicyConcept P, typename... Args>
requires (std::is_constructible_v<P, const
GeometryContext&, const
TrackingVolume&, const
Logger&, Args...> && (std::is_copy_constructible_v<Args> && ...))
| NavigationPolicyFactory Acts::NavigationPolicyFactory::add |
( |
Args &&... | args | ) |
&& |
|
constexpr |
Add a navigation policy to the factory.
- Template Parameters
-
- Parameters
-
| args | The arguments to pass to the policy constructor |
- Note
- Arguments need to be copy constructible because the factory must be able to execute multiple times.
- Returns
- New instance of this object with the added factory for method chaining
◆ add() [2/3]
template<typename Fn, typename... Args>
requires (detail::NavigationPolicyValueFactoryConcept<Fn, Args...> && !detail::NavigationPolicyPointerFactoryConcept<Fn, Args...> && (std::is_copy_constructible_v<Args> && ...))
| NavigationPolicyFactory Acts::NavigationPolicyFactory::add |
( |
Fn && | fn, |
|
|
Args &&... | args ) && |
|
constexpr |
Add a policy created by a factory function that returns a concrete policy by value.
- Template Parameters
-
| Fn | The type of the function to construct the policy |
- Parameters
-
| fn | The factory function |
| args | The arguments to pass to the policy factory |
- Note
- Arguments need to be copy constructible because the factory must be able to execute multiple times.
- Returns
- New instance of this object with the added factory for method chaining
- Deprecated
- Return a std::unique_ptr<INavigationPolicy> from the factory function instead. This also lets the function select the concrete policy type at runtime.
◆ add() [3/3]
template<typename Fn, typename... Args>
requires (detail::NavigationPolicyPointerFactoryConcept<Fn, Args...> && (std::is_copy_constructible_v<Args> && ...))
| NavigationPolicyFactory Acts::NavigationPolicyFactory::add |
( |
Fn && | fn, |
|
|
Args &&... | args ) && |
|
constexpr |
Add a policy created by a factory function that returns a std::unique_ptr to a navigation policy.
Returning a pointer allows the factory function to select between different concrete policy types at runtime (e.g. based on the volume geometry).
- Template Parameters
-
| Fn | The type of the function to construct the policy |
- Parameters
-
| fn | The factory function |
| args | The arguments to pass to the policy factory |
- Note
- Arguments need to be copy constructible because the factory must be able to execute multiple times.
- Returns
- New instance of this object with the added factory for method chaining
◆ asUniquePtr()
| std::unique_ptr< NavigationPolicyFactory > Acts::NavigationPolicyFactory::asUniquePtr |
( |
| ) |
&& |
Move the factory into a unique pointer.
- Returns
- A unique pointer to the factory
◆ build()
Construct a navigation policy using the factories (alias for operator()).
- Parameters
-
| gctx | The geometry context |
| volume | The tracking volume |
| logger | The logger |
- Returns
- A unique pointer to the constructed navigation policy
◆ operator()()
Construct a multi-navigation policy using the registered factories.
- Parameters
-
| gctx | The geometry context |
| volume | The tracking volume |
| logger | The logger |
- Returns
- A unique pointer to the constructed MultiNavigationPolicy
- Exceptions
-
| std::runtime_error | if no factories are registered |