Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::Temple::Bitmask< EnumType > Struct Template Reference

#include <Bitmask.h>

Public Types

Types
using Underlying = std::underlying_type_t< EnumType >
 

Public Member Functions

Constructors
constexpr Bitmask ()
 
constexpr Bitmask (EnumType a)
 
constexpr Bitmask (Underlying a)
 
Information
constexpr bool isSet (const EnumType &a) const
 Checks whether an enum value is set in the bitmask. More...
 
Operators
constexpr Bitmask operator| (const EnumType &a) const
 Create a new bitmask that also sets a particular enum value. More...
 
constexpr void operator|= (const EnumType &a)
 Set a particular enum value in this bitmask. More...
 
constexpr bool operator& (const EnumType &a) const
 Check whether a particular enum value is set.
 
constexpr bool operator[] (const EnumType &a) const
 Check whether a particular enum value is set.
 

Data Fields

Public state
Underlying value
 

Static Public Attributes

static constexpr Underlying maximum
 

Detailed Description

template<typename EnumType>
struct Scine::Molassembler::Temple::Bitmask< EnumType >

Template Parameters
EnumTypeEnum on which the bitmask should act. Requires the enum to have strictly incrementing unsigned representation.

Member Function Documentation

template<typename EnumType >
constexpr bool Scine::Molassembler::Temple::Bitmask< EnumType >::isSet ( const EnumType &  a) const
inline

Checks whether an enum value is set in the bitmask.

Complexity \(\Theta(1)\)

template<typename EnumType >
constexpr Bitmask Scine::Molassembler::Temple::Bitmask< EnumType >::operator| ( const EnumType &  a) const
inline

Create a new bitmask that also sets a particular enum value.

Complexity \(\Theta(1)\)

template<typename EnumType >
constexpr void Scine::Molassembler::Temple::Bitmask< EnumType >::operator|= ( const EnumType &  a)
inline

Set a particular enum value in this bitmask.

Complexity \(\Theta(1)\)

Field Documentation

template<typename EnumType >
constexpr Underlying Scine::Molassembler::Temple::Bitmask< EnumType >::maximum
static
Initial value:
= Temple::Math::floor(
Temple::Math::log(
static_cast<double>(std::numeric_limits<Underlying>::max()),
2.0
)
)

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