Celeritas 0.6.0-rc.2.10+develop.de0a3a05
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::EnumStringMapper< T > Class Template Reference

Map enums to strings for user output. More...

#include <EnumStringMapper.hh>

Public Member Functions

template<class... Ts>
CELER_CONSTEXPR_FUNCTION EnumStringMapper (Ts... strings)
 Construct with one string per valid enum value.
 
char constoperator() (T value) const
 Convert an enum to the corresponding string.
 

Detailed Description

template<class T>
class celeritas::EnumStringMapper< T >

Map enums to strings for user output.

This should generally be a static const class.

Example:

char const* to_cstring(Foo value)
{
static EnumStringMapper<Foo> const convert{"foo", "bar", "baz"};
return convert(value);
}
char const * to_cstring(WLSTimeProfileSelection value)
Get a string corresponding to the wavelength shifting time model selection.
Definition GeantOpticalPhysicsOptions.cc:17
Map enums to strings for user output.
Definition EnumStringMapper.hh:35

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