Celeritas  0.5.0-86+4a8eea4
Classes | Macros | Functions
UniverseTypeTraits.hh File Reference
#include "corecel/math/Algorithms.hh"
#include "orange/OrangeTypes.hh"
This graph shows which files directly or indirectly include this file:

Classes

struct  celeritas::UniverseTypeTraits< UniverseType::simple >
 
struct  celeritas::UniverseTypeTraits< UniverseType::rect_array >
 

Macros

#define ORANGE_UNIV_TRAITS(ENUM_VALUE, CLS)
 
#define ORANGE_UT_VISIT_CASE(TYPE)
 

Functions

template<class F >
decltype(auto) CELER_CONSTEXPR_FUNCTION celeritas::visit_universe_type (F &&func, UniverseType ut)
 Expand a macro to a switch statement over all possible universe types. More...
 

Macro Definition Documentation

◆ ORANGE_UNIV_TRAITS

#define ORANGE_UNIV_TRAITS (   ENUM_VALUE,
  CLS 
)
Value:
template<> \
struct UniverseTypeTraits<UniverseType::ENUM_VALUE> \
{ \
using record_type = CLS##Record; \
using tracker_type = CLS##Tracker; \
}

◆ ORANGE_UT_VISIT_CASE

#define ORANGE_UT_VISIT_CASE (   TYPE)
Value:
case UniverseType::TYPE: \
return celeritas::forward<F>(func)( \
UniverseTypeTraits<UniverseType::TYPE>{})

Function Documentation

◆ visit_universe_type()

template<class F >
decltype(auto) CELER_CONSTEXPR_FUNCTION celeritas::visit_universe_type ( F &&  func,
UniverseType  ut 
)

Expand a macro to a switch statement over all possible universe types.

The func argument should be a functor that takes a single argument which is a UniverseTypeTraits instance.