Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::TrackerVisitor Class Reference

Apply a functor to a universe tracker of unknown type. More...

#include <TrackerVisitor.hh>

Public Types

Type aliases
using ParamsRef = NativeCRef< OrangeParamsData >
 

Public Member Functions

CELER_FUNCTION TrackerVisitor (ParamsRef const &params)
 Construct from ORANGE params.
 
template<class F >
decltype(auto) CELER_FUNCTION operator() (F &&func, UniverseId id)
 

Detailed Description

Apply a functor to a universe tracker of unknown type.

An instance of this class is like std::visit but accepting a UniverseId rather than a std::variant .

Example:

TrackerVisitor visit_tracker{params_};
auto new_pos = visit_tracker(
[&pos](auto&& u) { return u.initialize(pos); },
uid);
CELER_FUNCTION TrackerVisitor(ParamsRef const &params)
Construct from ORANGE params.
Definition: TrackerVisitor.hh:59

The documentation for this class was generated from the following file: