Celeritas  0.5.0-86+4a8eea4
Public Member Functions | List of all members
celeritas::LocalSurfaceVisitor Class Reference

Apply a functor to a type-deleted local surface. More...

#include <LocalSurfaceVisitor.hh>

Public Types

Type aliases
using ParamsRef = NativeCRef< OrangeParamsData >
 

Public Member Functions

CELER_FUNCTION LocalSurfaceVisitor (ParamsRef const &params, SurfacesRecord const &local_surfaces)
 Construct from ORANGE data ans local surfaces. More...
 
CELER_FUNCTION LocalSurfaceVisitor (ParamsRef const &params, SimpleUnitId unit)
 Construct from ORANGE data with surfaces from a simple unit.
 
template<class F >
decltype(auto) CELER_FUNCTION operator() (F &&typed_visitor, LocalSurfaceId t)
 
template<class T , class U >
CELER_FORCEINLINE_FUNCTIONget_item (Items< T > const &items, ItemRange< T > const &offsets, ItemId< U > item)
 Get a pointer to the item offset using the given range in a given collection.
 

Detailed Description

Apply a functor to a type-deleted local surface.

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

Example:

LocalSurfaceVisitor visit_surface{params_};
auto sense = visit_surface(
[&pos](auto const& s) { return s.calc_sense(pos); },
surface_id);
CELER_FUNCTION LocalSurfaceVisitor(ParamsRef const &params, SurfacesRecord const &local_surfaces)
Construct from ORANGE data ans local surfaces.
Definition: LocalSurfaceVisitor.hh:89

Constructor & Destructor Documentation

◆ LocalSurfaceVisitor()

CELER_FORCEINLINE_FUNCTION celeritas::LocalSurfaceVisitor::LocalSurfaceVisitor ( ParamsRef const &  params,
SurfacesRecord const &  local_surfaces 
)
inline

Construct from ORANGE data ans local surfaces.

This is meant to be called from inside a simple unit tracker.


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