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::NavigationPolicyIsolatedFactoryConcept<Fn, Args...>) |
| constexpr NavigationPolicyFactory | add (Fn &&fn, Args &&... args) && |
| | Add a policy created by a factory function.
|
| 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:78
std::unique_ptr< NavigationPolicyFactory > asUniquePtr() &&
Move the factory into a unique pointer.
Definition NavigationPolicyFactory.hpp:111
◆ NavigationPolicyFactory()
| Acts::NavigationPolicyFactory::NavigationPolicyFactory |
( |
| ) |
|
|
default |
◆ add() [1/2]
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/2]
template<typename Fn, typename... Args>
requires (detail::NavigationPolicyIsolatedFactoryConcept<Fn, Args...>)
| NavigationPolicyFactory Acts::NavigationPolicyFactory::add |
( |
Fn && | fn, |
|
|
Args &&... | args ) && |
|
constexpr |
Add a policy created by a factory function.
- 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 |