ACTS
Experiment-independent tracking
Loading...
Searching...
No Matches
detray::types::registry< ID, registered_types > Class Template Reference

match types with indices/identifiers and vice versa. More...

#include <detray/utils/type_registry.hpp>

Inheritance diagram for detray::types::registry< ID, registered_types >:
[legend]

Public Types

enum  : std::size_t { n_types = sizeof...(registered_types) , e_any = sizeof...(registered_types) , e_unknown = sizeof...(registered_types) + 1 }
 Conventions for some basic info.
using id = ID
 Make the type IDs accessible.
using type_list = detray::types::list<registered_types...>
 Make the registered types accessible.

Static Public Member Functions

static constexpr bool is_valid (const std::size_t type_idx)
template<typename id_t = id>
requires (!std::convertible_to<id_t, std::size_t>)
static constexpr bool is_valid (const id_t type_id)
 Check whether an identifier corresponds to a registered type.

Detailed Description

template<concepts::type_id ID, typename... registered_types>
class detray::types::registry< ID, registered_types >

match types with indices/identifiers and vice versa.

Template Parameters
IDsenum that references the types (not used in base class)
registered_typesthe types that is mapped to the ID enum values

Member Function Documentation

◆ is_valid() [1/2]

template<concepts::type_id ID, typename... registered_types>
template<typename id_t = id>
requires (!std::convertible_to<id_t, std::size_t>)
constexpr bool detray::types::registry< ID, registered_types >::is_valid ( const id_t type_id)
staticconstexpr

Check whether an identifier corresponds to a registered type.

Parameters
type_idthe type identifier to be checked
Returns
whether the identifier is in range

◆ is_valid() [2/2]

template<concepts::type_id ID, typename... registered_types>
constexpr bool detray::types::registry< ID, registered_types >::is_valid ( const std::size_t type_idx)
staticconstexpr
Returns
whether a given index/identifier can be mapped to a type.

Check whether an index corresponds to a registered type.

Parameters
type_idxthe type index to be checked
Returns
whether the index is in range