modm API documentation
modm::FlagsOperators< Enum, T > Struct Template Reference

#include <modm/architecture/interface/register.hpp>

Inheritance diagram for modm::FlagsOperators< Enum, T >:
modm::Register< T > modm::Flags< Enum, T >

Public Typedefs

typedef Enum EnumType
 The enum type.
 
- Public Typedefs inherited from modm::Register< T >
typedef T UnderlyingType
 The integer type internally used to represent the register.
 

Public Member Functions

constexpr FlagsOperators operator~ () const
 bitwise negation
 
constexpr FlagsOperators ()
 default constructor initializes value to zero
 
constexpr FlagsOperators (Enum flag)
 constructs itself out of a strongly-typed enum
 
constexpr FlagsOperators (UnderlyingType flag)
 When explicitly called, this class constructs itself out of the underlying type.
 
constexpr FlagsOperators (Register< T > const &o)
 When explicitly called, this class constructs itself out of the superclass.
 
constexpr FlagsOperators (FlagsOperators const &o) = default
 Copy constructor.
 
constexpr FlagsOperators (FlagsOperators &&o) = default
 Move constructor.
 
FlagsOperators & operator= (FlagsOperators const &o) = default
 Copy assignment.
 
FlagsOperators & operator= (FlagsOperators &&o) = default
 Move assignment.
 
constexpr FlagsOperators operator& (FlagsOperators const &o) const
 bitwise AND with multiple bits
 
constexpr FlagsOperators operator| (FlagsOperators const &o) const
 bitwise OR with multiple bits
 
constexpr FlagsOperators operator^ (FlagsOperators const &o) const
 bitwise XOR with multiple bits
 
FlagsOperators & operator&= (FlagsOperators const &o)
 bitwise AND with multiple bits
 
FlagsOperators & operator|= (FlagsOperators const &o)
 bitwise OR with multiple bits
 
FlagsOperators & operator^= (FlagsOperators const &o)
 bitwise XOR with multiple bits
 
FlagsOperators & operator&= (Enum const &flag)
 bitwise AND with a single bit
 
FlagsOperators & operator|= (Enum const &flag)
 bitwise OR with a single bit
 
FlagsOperators & operator^= (Enum const &flag)
 bitwise XOR with a single bit
 
- Public Member Functions inherited from modm::Register< T >
constexpr Register ()
 Default constructor initializes value to zero.
 
constexpr operator bool () const
 
constexpr bool operator! () const
 Returns true if value is zero.
 

Static Public Member Functions

static constexpr FlagsOperators mask ()
 returns the mask of the integer type
 

Friends

constexpr friend FlagsOperators operator& (Enum const &a, FlagsOperators const &b)
 bitwise AND with a single bit
 
constexpr friend FlagsOperators operator| (Enum const &a, FlagsOperators const &b)
 bitwise OR with a single bit
 
constexpr friend FlagsOperators operator^ (Enum const &a, FlagsOperators const &b)
 bitwise XOR with a single bit
 
constexpr friend FlagsOperators operator& (FlagsOperators const &a, Enum const &b)
 bitwise AND with a single bit
 
constexpr friend FlagsOperators operator| (FlagsOperators const &a, Enum const &b)
 bitwise OR with a single bit
 
constexpr friend FlagsOperators operator^ (FlagsOperators const &a, Enum const &b)
 bitwise XOR with a single bit
 
constexpr friend FlagsOperators operator& (Enum const &a, Enum const &b)
 bitwise AND with a single bit
 
constexpr friend FlagsOperators operator| (Enum const &a, Enum const &b)
 bitwise OR with a single bit
 
constexpr friend FlagsOperators operator^ (Enum const &a, Enum const &b)
 bitwise XOR with a single bit
 
constexpr friend bool operator== (FlagsOperators const &a, Enum const &b)
 
constexpr friend bool operator!= (FlagsOperators const &a, Enum const &b)
 
constexpr friend bool operator== (Enum const &a, FlagsOperators const &b)
 
constexpr friend bool operator!= (Enum const &a, FlagsOperators const &b)
 
IOStreamoperator<< (IOStream &s, const Register< T > &m)
 Printing a register will output its numeric value.
 

Additional Inherited Members

- Public Attributes inherited from modm::Register< T >
UnderlyingType value
 The underlying integer value.
 
- Protected Member Functions inherited from modm::Register< T >
constexpr Register (UnderlyingType initialValue)
 This class is meant to be subclassed.
 

Detailed Description

template<typename Enum, typename T>
struct modm::FlagsOperators< Enum, T >

Class for operating on a register.

This class extends the Register base class by adding constructor and bitwise operation overloading between a strongly-typed enum and itself. It is the common base class for Flags, Configurations and Values!

Template Parameters
Enuma strongly-typed enum containing the bit masks
Tthe underlying integer type to be for internal representation
See also
Flags
Author
Niklas Hauser

Friends And Related Function Documentation

template<typename Enum , typename T >
constexpr friend bool operator== ( FlagsOperators< Enum, T > const &  a,
Enum const &  b 
)
friend

Compares if two flags are equal


The documentation for this struct was generated from the following file: