jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
enum_util.hpp File Reference
#include <array>
#include <type_traits>
#include <string_view>
#include <cstring>
#include <ostream>
#include <jau/cpp_lang_util.hpp>
Include dependency graph for enum_util.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jau::enums::enum_info< EnumType, Vargs >
 Enumeration info template class including iterator (enum_iterator) More...
 
class  jau::enums::enum_iterator< EnumType, Vargs >
 Enumeration iterator, see enum_info. More...
 
struct  jau::enums::is_enum_info< class, class >
 template< class T > is_enum_info<T>::value compile-time Type Trait, determining whether the given template class is a enum_info type. More...
 
struct  jau::enums::is_enum_info< T, std::void_t< typename T::enum_info_tag > >
 template< class T > is_enum_info<T>::value compile-time Type Trait, determining whether the given template class is a enum_info type. More...
 
struct  jau::enums::NameTable< Vargs >
 
struct  jau::enums::ValueTable< E, N >
 

Namespaces

namespace  jau
 __pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
 
namespace  jau::enums
 Author: Sven Gothel sgoth.nosp@m.el@j.nosp@m.ausof.nosp@m.t.co.nosp@m.m Copyright Gothel Software e.K.
 

Macros

#define JAU_APPEND_BITSTR(U, V, M)
 
#define JAU_ENUM_CASE_LONG(type, name)
 
#define JAU_ENUM_CASE_SHORT(type, name)
 
#define JAU_ENUM_TYPE_VALUE(type, name)
 
#define JAU_ENUM_VALUE(type, name)
 
#define JAU_EXPAND(...)
 
#define JAU_EXPAND1(...)
 
#define JAU_EXPAND2(...)
 
#define JAU_EXPAND3(...)
 
#define JAU_EXPAND4(...)
 
#define JAU_FOR_EACH(macro, type, ...)
 
#define JAU_FOR_EACH_AGAIN()
 
#define JAU_FOR_EACH_HELPER(macro, type, a1, ...)
 
#define JAU_FOR_EACH_LIST(macro, type, ...)
 
#define JAU_FOR_EACH_LIST_AGAIN()
 
#define JAU_FOR_EACH_LIST_HELPER(macro, type, a1, ...)
 
#define JAU_FOR_EACH_VALUE(macro, type, value, ...)
 
#define JAU_FOR_EACH_VALUE_AGAIN()
 
#define JAU_FOR_EACH_VALUE_HELPER(macro, type, value, a1, ...)
 
#define JAU_MAKE_BITFIELD_ENUM_STRING(type, ...)
 
#define JAU_MAKE_BITFIELD_ENUM_STRING2(type, stype, ...)
 
#define JAU_MAKE_ENUM_INFO(type, ...)
 
#define JAU_MAKE_ENUM_INFO2(type, stype, ...)
 
#define JAU_MAKE_ENUM_STRING(type, ...)
 
#define JAU_MAKE_ENUM_STRING_SUB(type, stype, ...)
 
#define JAU_PARENS   ()
 

Functions

template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr void jau::enums::append_bitstr (std::string &out, E mask, E bit, const std::string &bitstr, bool &comma)
 
template<typename E, E V>
consteval_cxx20 const char * jau::enums::enum_funcname () noexcept
 clang + gcc
 
template<auto... Vargs>
consteval_cxx20 NameTable< Vargs... > jau::enums::get_names () noexcept
 
template<typename... Args>
constexpr ValueTable< std::common_type_t< Args... >, sizeof...(Args)> jau::enums::get_values (Args... args) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr bool jau::enums::has_any (const E mask, const E bits) noexcept
 
template<auto V, std::enable_if_t< std::is_enum_v< decltype(V)> > * = nullptr>
consteval_cxx20 bool jau::enums::is_enum () noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr bool jau::enums::is_set (const E mask, const E bits) noexcept
 
template<auto V, std::enable_if_t< std::is_enum_v< decltype(V)> > * = nullptr>
consteval_cxx20 std::string_view jau::enums::long_name () noexcept
 
template<auto V, std::enable_if_t< std::is_enum_v< decltype(V)> > * = nullptr>
consteval_cxx20 std::string_view jau::enums::name () noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr std::underlying_type_t< E > jau::enums::number (const E v) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr bool jau::enums::operator!= (const E lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E jau::enums::operator& (const E lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E & jau::enums::operator&= (E &lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr std::underlying_type_t< E > jau::enums::operator* (const E v) noexcept
 
template<typename enum_info_t, std::enable_if_t< is_enum_info< enum_info_t >::value > * = nullptr>
std::ostream & jau::enums::operator<< (std::ostream &os, const enum_info_t &v)
 
template<typename T, std::enable_if_t< std::is_enum_v< T > > * = nullptr>
std::ostream & jau::enums::operator<< (std::ostream &os, const T v)
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr bool jau::enums::operator== (const E lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E jau::enums::operator^ (const E lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E & jau::enums::operator^= (E &lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E jau::enums::operator| (const E lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E & jau::enums::operator|= (E &lhs, const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E jau::enums::operator~ (const E rhs) noexcept
 
template<typename E, std::enable_if_t< std::is_enum_v< E > > * = nullptr>
constexpr E & jau::enums::write (E &store, const E bits, bool set) noexcept
 If set==true, sets the bits in store, i.e.