header_utils
Loading...
Searching...
No Matches
ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE > Struct Template Reference

Holds a set of changes to be made to an enum_flags<ENUM, VALUE_TYPE> - conceptually holds a set of std::pair<ENUM, enum_flag_change>. More...

#include <enum_flags.h>

Public Types

using value_type
 The underlying integral value type that holds the bits representing the flags.
using enum_type
 Type of the enum that is the source of the flags.
using self_type
using flags_type

Public Member Functions

constexpr enum_flag_changes (enum_flag_changes const &) noexcept=default
constexpr enum_flag_changes (enum_flag_changes &&) noexcept=default
constexpr enum_flag_changes & operator= (enum_flag_changes const &) noexcept=default
constexpr enum_flag_changes & operator= (enum_flag_changes &&) noexcept=default
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type & set_change_of (enum_flag_change change, ARGS... args) noexcept
constexpr enum_flag_change change_of (enum_type flag) const noexcept
constexpr flags_type flags_to_set () const noexcept
constexpr flags_type flags_to_unset () const noexcept
constexpr flags_type flags_to_toggle () const noexcept
constexpr flags_type flags_to_not_change () const noexcept
constexpr flags_type flags_to (enum_flag_change change) const noexcept
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type & set (ARGS... args) noexcept
constexpr self_type & set (flags_type other) noexcept
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type & unset (ARGS... args) noexcept
constexpr self_type & unset (flags_type other) noexcept
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type & toggle (ARGS... args) noexcept
constexpr self_type & toggle (flags_type other) noexcept
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type & dont_change (ARGS... args) noexcept
constexpr self_type & dont_change (flags_type other) noexcept
constexpr self_type & dont_change_any () noexcept
constexpr auto operator<=> (self_type const &other) const noexcept=default

Static Public Member Functions

static constexpr self_type no_changes () noexcept
template<std::convertible_to< enum_type >... ARGS>
static constexpr self_type to_set (ARGS... args) noexcept
static constexpr self_type to_set (flags_type other) noexcept
static constexpr self_type to_set_all () noexcept
template<std::convertible_to< enum_type >... ARGS>
static constexpr self_type to_unset (ARGS... args) noexcept
static constexpr self_type to_unset (flags_type other) noexcept
static constexpr self_type to_unset_all () noexcept
template<std::convertible_to< enum_type >... ARGS>
static constexpr self_type to_toggle (ARGS... args) noexcept
static constexpr self_type to_toggle (flags_type other) noexcept
static constexpr self_type to_toggle_all () noexcept

Public Attributes

flags_type bits_to_set
flags_type bits_to_unset

Detailed Description

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
struct ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >

Holds a set of changes to be made to an enum_flags<ENUM, VALUE_TYPE> - conceptually holds a set of std::pair<ENUM, enum_flag_change>.

Definition at line 395 of file enum_flags.h.

Member Typedef Documentation

◆ enum_type

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
using ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::enum_type

Type of the enum that is the source of the flags.

Definition at line 401 of file enum_flags.h.

◆ flags_type

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
using ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::flags_type

Definition at line 404 of file enum_flags.h.

◆ self_type

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
using ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::self_type

Definition at line 402 of file enum_flags.h.

◆ value_type

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
using ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::value_type

The underlying integral value type that holds the bits representing the flags.

Definition at line 398 of file enum_flags.h.

Member Function Documentation

◆ change_of()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
enum_flag_change ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::change_of ( enum_type flag) const
inlineconstexprnoexcept

Definition at line 442 of file enum_flags.h.

◆ dont_change() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::dont_change ( ARGS... args)
inlineconstexprnoexcept

Definition at line 480 of file enum_flags.h.

◆ dont_change() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::dont_change ( flags_type other)
inlineconstexprnoexcept

Definition at line 481 of file enum_flags.h.

◆ dont_change_any()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::dont_change_any ( )
inlineconstexprnoexcept

Definition at line 483 of file enum_flags.h.

◆ flags_to()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::flags_to ( enum_flag_change change) const
inlineconstexprnoexcept

Definition at line 452 of file enum_flags.h.

◆ flags_to_not_change()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::flags_to_not_change ( ) const
inlineconstexprnoexcept

Definition at line 450 of file enum_flags.h.

◆ flags_to_set()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::flags_to_set ( ) const
inlineconstexprnoexcept

Definition at line 447 of file enum_flags.h.

◆ flags_to_toggle()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::flags_to_toggle ( ) const
inlineconstexprnoexcept

Definition at line 449 of file enum_flags.h.

◆ flags_to_unset()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::flags_to_unset ( ) const
inlineconstexprnoexcept

Definition at line 448 of file enum_flags.h.

◆ no_changes()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::no_changes ( )
inlinestaticconstexprnoexcept

Definition at line 412 of file enum_flags.h.

◆ set() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::set ( ARGS... args)
inlineconstexprnoexcept

Definition at line 468 of file enum_flags.h.

◆ set() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::set ( flags_type other)
inlineconstexprnoexcept

Definition at line 469 of file enum_flags.h.

◆ set_change_of()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::set_change_of ( enum_flag_change change,
ARGS... args )
inlineconstexprnoexcept

Definition at line 428 of file enum_flags.h.

◆ to_set() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_set ( ARGS... args)
inlinestaticconstexprnoexcept

Definition at line 415 of file enum_flags.h.

◆ to_set() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_set ( flags_type other)
inlinestaticconstexprnoexcept

Definition at line 416 of file enum_flags.h.

◆ to_set_all()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_set_all ( )
inlinestaticconstexprnoexcept

Definition at line 417 of file enum_flags.h.

◆ to_toggle() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_toggle ( ARGS... args)
inlinestaticconstexprnoexcept

Definition at line 423 of file enum_flags.h.

◆ to_toggle() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_toggle ( flags_type other)
inlinestaticconstexprnoexcept

Definition at line 424 of file enum_flags.h.

◆ to_toggle_all()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_toggle_all ( )
inlinestaticconstexprnoexcept

Definition at line 425 of file enum_flags.h.

◆ to_unset() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_unset ( ARGS... args)
inlinestaticconstexprnoexcept

Definition at line 419 of file enum_flags.h.

◆ to_unset() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_unset ( flags_type other)
inlinestaticconstexprnoexcept

Definition at line 420 of file enum_flags.h.

◆ to_unset_all()

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
constexpr self_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::to_unset_all ( )
inlinestaticconstexprnoexcept

Definition at line 421 of file enum_flags.h.

◆ toggle() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::toggle ( ARGS... args)
inlineconstexprnoexcept

Definition at line 476 of file enum_flags.h.

◆ toggle() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::toggle ( flags_type other)
inlineconstexprnoexcept

Definition at line 477 of file enum_flags.h.

◆ unset() [1/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
template<std::convertible_to< enum_type >... ARGS>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::unset ( ARGS... args)
inlineconstexprnoexcept

Definition at line 472 of file enum_flags.h.

◆ unset() [2/2]

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
self_type & ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::unset ( flags_type other)
inlineconstexprnoexcept

Definition at line 473 of file enum_flags.h.

Member Data Documentation

◆ bits_to_set

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::bits_to_set

Definition at line 487 of file enum_flags.h.

◆ bits_to_unset

template<integral_or_enum ENUM, detail::valid_integral VALUE_TYPE>
flags_type ghassanpl::enum_flag_changes< ENUM, VALUE_TYPE >::bits_to_unset

Definition at line 488 of file enum_flags.h.