8#ifndef HPP_ALIB_ENUMS_RECORDS
9#define HPP_ALIB_ENUMS_RECORDS 1
11#if !defined(HPP_ALIB_SINGLETONS_SINGLETON)
17#if !defined (HPP_ALIB_ENUMS_UNDERLYING_INTEGRAL)
21#if ALIB_STRINGS && !defined (HPP_ALIB_STRINGS_LOCALSTRING)
25#if ALIB_DEBUG && !defined(HPP_ALIB_LANG_DBGTYPEDEMANGLER)
29#if !defined(_GLIBCXX_UTILITY) || !defined(_UTILITY_)
33#if !defined (_GLIBCXX_ITERATOR) && !defined (_ITERATOR_)
42 namespace lang {
class Camp; }
53#if !ALIB_CAMP || defined(ALIB_DOX)
107 template<
typename TEnum,
typename TEnableIf>
114 template<
typename TEnum,
115 typename TEnableIf=
ATMP_VOID_IF( std::is_enum<TEnum>::value )>
128namespace alib {
namespace enums {
155template<
typename TEnum>
159template<
typename TEnum>
165 static_assert( std::is_trivially_destructible<typename T_EnumRecords<TEnum>::Type>::value,
166 "Error: Enum Record types must be a trivially destructible." );
200template<
typename TEnum>
204template<
typename TEnum>
209 static_assert( std::is_trivially_destructible<typename T_EnumRecords<TEnum>::Type>::value,
210 "Error: Enum Record types must be a trivially destructible." );
262template<
typename TEnum,
typename TEnableIf>
265template<typename TEnum, typename TEnableIf=
270 static_assert( std::is_trivially_destructible<typename T_EnumRecords<TEnum>::Type>::value,
271 "Error: Enum Record types must be a trivially destructible." );
277 using
TIntegral= typename std::underlying_type<TEnum>::type;
282 #if defined(ALIB_DOX)
291 template<
typename TRecord,
typename TAssociated>
295 template<typename TRecord, typename TAssociated= typename T_EnumRecords<TEnum>::Type>
315 #if !defined(ALIB_DOX)
371 return !(*
this == other);
380 return TEnum(
node->integral );
389 return node->integral;
403 return &
node->record;
463 template <
typename... TArgs>
466 ,
record ( std::forward<TArgs>(args)... )
489 template <
typename... TArgs>
491 void Bootstrap( TEnum element, TArgs&&... args )
noexcept;
515 void Bootstrap( std::initializer_list<Initializer> definitions );
740template<
typename TEnum>
744template<
typename TEnum>
752#define ALIB_ENUMS_ASSIGN_RECORD( TEnum, TRecord ) \
753namespace alib::enums { \
754template<> struct T_EnumRecords<TEnum> : public std::true_type \
756 using Type= TRecord; \
#define ALIB_ASSERT_MODULE(modulename)
#define ATMP_VOID_IF(Cond)
#define ATMP_ISOF( T, TBase)
#define ATMP_EQ( T, TEqual)
#define ALIB_ASSERT_ERROR(cond,...)
#define ATMP_T_IF(T, Cond)
ALIB_API const void * getEnumRecord(const std::type_info &rtti, integer integral)
constexpr std::underlying_type< TEnum >::type UnderlyingIntegral(TEnum element) noexcept(true)
const T_EnumRecords< TEnum >::Type * TryRecord(TEnum element)
ALIB_API void Bootstrap()
const T_EnumRecords< TEnum >::Type & GetRecord(TEnum element)
NLocalString< 128 > NString128
Type alias name for TLocalString<nchar,128> .
characters::character character
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
int MinimumRecognitionLength
ERSerializable() noexcept=default
TIntegral Integral() const
ForwardIterator operator++(int)
typename detail::EnumRecordHook< TEnum >::Node Node
ForwardIterator(Node *start) noexcept
const TRecord & operator*() const
std::forward_iterator_tag iterator_category
Implementation of std::iterator_traits.
bool operator==(ForwardIterator other) const
bool operator!=(ForwardIterator other) const
const TRecord & value_type
Implementation of std::iterator_traits.
integer difference_type
Implementation of std::iterator_traits.
TRecord const * operator->() const
ForwardIterator & operator++()
TRecord const * pointer
Implementation of std::iterator_traits.
const TRecord & reference
Implementation of std::iterator_traits.
Initializer(TEnum elem, TArgs &&... args) noexcept
static void Bootstrap(const String &input, character innerDelim=',', character outerDelim=',')
typename std::underlying_type< TEnum >::type TIntegral
static void Bootstrap(lang::Camp &module, const NString &name, character innerDelim=',', character outerDelim=',')
static void Bootstrap(TEnum element, TArgs &&... args) noexcept
static void Bootstrap(character innerDelim=',', character outerDelim=',')
static constexpr ForwardIterator end()
static void Bootstrap(std::initializer_list< Initializer > definitions)
static ForwardIterator begin()
static void Bootstrap(lang::resources::ResourcePool &pool, const NString &category, const NString &name, character innerDelim=',', character outerDelim=',')
EnumRecords() noexcept=default
typename T_EnumRecords< TEnum >::Type TRecord
static constexpr bool AreOfType()