ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
Acts::NavigationPolicyFactory Class Reference

Base class for navigation policy factories. More...

#include <Acts/Geometry/NavigationPolicyFactory.hpp>

Public Member Functions

 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< INavigationPolicybuild (const GeometryContext &gctx, const TrackingVolume &volume, const Logger &logger) const
 Construct a navigation policy using the factories (alias for operator()).
std::unique_ptr< MultiNavigationPolicyoperator() (const GeometryContext &gctx, const TrackingVolume &volume, const Logger &logger) const
 Construct a multi-navigation policy using the registered factories.

Detailed Description

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)
.add<NavigationPolicy2>(/*no args*/)
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

Constructor & Destructor Documentation

◆ NavigationPolicyFactory()

Acts::NavigationPolicyFactory::NavigationPolicyFactory ( )
default

Default constructor.

Member Function Documentation

◆ 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
PThe policy type to add
Parameters
argsThe 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
FnThe type of the function to construct the policy
Parameters
fnThe factory function
argsThe 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()

std::unique_ptr< INavigationPolicy > Acts::NavigationPolicyFactory::build ( const GeometryContext & gctx,
const TrackingVolume & volume,
const Logger & logger ) const

Construct a navigation policy using the factories (alias for operator()).

Parameters
gctxThe geometry context
volumeThe tracking volume
loggerThe logger
Returns
A unique pointer to the constructed navigation policy

◆ operator()()

std::unique_ptr< MultiNavigationPolicy > Acts::NavigationPolicyFactory::operator() ( const GeometryContext & gctx,
const TrackingVolume & volume,
const Logger & logger ) const

Construct a multi-navigation policy using the registered factories.

Parameters
gctxThe geometry context
volumeThe tracking volume
loggerThe logger
Returns
A unique pointer to the constructed MultiNavigationPolicy
Exceptions
std::runtime_errorif no factories are registered