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

Wrapper class for a navigation policy state stored in the state manager. More...

#include <Acts/Navigation/INavigationPolicy.hpp>

Public Member Functions

template<typename T>
T & as ()
 Cast the state to a specific type.
template<typename T>
const T & as () const
 Cast the state to a specific type (const version).
NavigationPolicyState atIndex (std::size_t index) const
 Access another state managed by the same manager, by absolute stack index.
bool empty () const
 Check if the state is empty (not associated with a manager).
std::size_t index () const
 Absolute index of this state within its manager's state stack.
bool isDefault () const
 Whether this state is the default sentinel, i.e.

Detailed Description

Wrapper class for a navigation policy state stored in the state manager.

This class provides type-safe access to the underlying state through the as<T>() method. The state is stored as a type-erased, small-buffer optimized value (NavigationPolicyStateStorage) in the NavigationPolicyStateManager.

Member Function Documentation

◆ as() [1/2]

template<typename T>
T & Acts::NavigationPolicyState::as ( )

Cast the state to a specific type.

Template Parameters
TThe type to cast to
Returns
Reference to the state as type T

◆ as() [2/2]

template<typename T>
const T & Acts::NavigationPolicyState::as ( ) const

Cast the state to a specific type (const version).

Template Parameters
TThe type to cast to
Returns
Const reference to the state as type T

◆ atIndex()

NavigationPolicyState Acts::NavigationPolicyState::atIndex ( std::size_t index) const

Access another state managed by the same manager, by absolute stack index.

Composite policies use this to reach their child states, which are pushed contiguously onto the stack directly below the composite's own state.

Parameters
indexabsolute stack index of the state to access
Returns
wrapper for the state at index in the same manager

◆ empty()

bool Acts::NavigationPolicyState::empty ( ) const

Check if the state is empty (not associated with a manager).

Returns
True if the state is empty, false otherwise

◆ index()

std::size_t Acts::NavigationPolicyState::index ( ) const

Absolute index of this state within its manager's state stack.

Returns
the stack index

◆ isDefault()

bool Acts::NavigationPolicyState::isDefault ( ) const

Whether this state is the default sentinel, i.e.

either no state at all or the INavigationPolicy::EmptyState pushed by policies that do not override createState(). Such policies also use the default (always-true) isValid(), so the navigator treats a default state as "no validity constraint" and skips the per-step isValid() call. A policy with a meaningful isValid() necessarily pushes a real state to check against, so this signal cannot be forgotten.

Returns
True if this is the default/empty state