|
Celeritas 0.7+4171d81
|
#include <cstddef>#include <type_traits>#include "Assert.hh"#include "Macros.hh"#include "Types.hh"#include <functional>#include <ostream>Classes | |
| struct | celeritas::nullid_t |
Tag type used for nullid. More... | |
| class | celeritas::OpaqueId< TagT, IndexT > |
| Type-safe "optional" index for accessing an array or collection of data. More... | |
| struct | celeritas::MakeSize< OpaqueId< I, V > > |
| Specialize size type for opaque IDs. More... | |
| struct | celeritas::detail::IsOpaqueId< T > |
| Template matching to determine if T is an OpaqueId. More... | |
| struct | celeritas::detail::IsOpaqueId< OpaqueId< I, V > > |
Macros | |
| #define | CELER_DEFINE_OPAQUEID_CMP(TOKEN) |
| #define | CELER_DEFINE_OPAQUEID_CMP(TOKEN) |
Functions | |
| template<class I > | |
| void | celeritas::detail::stream_opaqueid_impl (std::ostream &, I, I) |
| template<class T , class J > | |
| T | celeritas::detail::id_cast_impl (J value) noexcept(! 0) |
| Safely cast from one integer T to another J, avoiding the sentinel value. | |
| template<class V > | |
| void | celeritas::detail::stream_opaqueid_impl (std::ostream &os, V v, V nullint) |
| template<> | |
| void | celeritas::detail::stream_opaqueid_impl (std::ostream &os, unsigned char v, unsigned char nullid) |
| template<class IdT , class J > | |
| auto | celeritas::id_cast (J value) noexcept(! 0) -> std::enable_if_t< is_opaque_id_v< IdT > &&std::is_integral_v< J >, IdT > |
| Safely create an OpaqueId from an integer of any type. | |
| template<class I , class T > | |
| constexpr T const * | celeritas::ldg_data (OpaqueId< I, T > const *ptr) noexcept |
| Support loading OpaqueId via GPU cache. | |
Variables | |
| template<class I > | |
| constexpr I | celeritas::detail::nullid_value {static_cast<I>(-1)} |
| Sentinel value for an unassigned opaque ID. | |
| constexpr nullid_t | celeritas::nullid {0} |
| Tag instance used to instantiate and compare to a null OpaqueId. | |
| template<class T > | |
| constexpr bool | celeritas::is_opaque_id_v = detail::IsOpaqueId<std::remove_cv_t<T>>::value |
| True if T is an OpaqueID. | |
| #define CELER_DEFINE_OPAQUEID_CMP | ( | TOKEN | ) |
| #define CELER_DEFINE_OPAQUEID_CMP | ( | TOKEN | ) |
|
inlinenoexcept |
Safely create an OpaqueId from an integer of any type.
This asserts that the integer is in the valid range of the target ID type, and casts to it.
static_cast<FooId>(*FooId{}) will not work.