MarlinMT  0.1.0
marlinmt::book::Flag_t Class Reference

Flag type for flags in marlinmt::book. More...

#include <Flags.h>

Public Member Functions

constexpr Flag_t (unsigned long long val)
 constructor flag from number. More...
 
 Flag_t (const std::bitset< AmtFlags > &val)
 Construct flag from bitset. More...
 
Flag_t operator~ () const
 bitwise not for Flags More...
 
Flag_t operator & (const Flag_t &f) const
 logical AND on tow set of Flags. More...
 
Flag_t operator| (const Flag_t &f) const
 logical OR on tow set of Flags. More...
 
 operator bool () const
 cast to bool. More...
 
 operator const std::bitset< AmtFlags > & () const
 cast to bitset. More...
 
bool operator== (const Flag_t &f) const
 check for equality. More...
 
bool operator!= (const Flag_t &f) const
 check for inequality. More...
 
bool contains (const Flag_t &f) const
 check if the flags is a subset of the other. More...
 
 operator unsigned long long () const
 
 Flag_t ()=default
 
 Flag_t (const Flag_t &)=default
 
Flag_toperator= (const Flag_t &flag)
 
 Flag_t (Flag_t &&) noexcept=default
 
Flag_toperator= (Flag_t &&flag) noexcept
 
 ~Flag_t ()=default
 

Private Attributes

std::bitset< AmtFlags_val {0}
 flags saved as bits More...
 
const unsigned long long _initValue {0}
 

Static Private Attributes

static constexpr std::size_t AmtFlags = 8
 

Friends

constexpr unsigned long long Flags::value (const Flag_t &)
 

Detailed Description

Flag type for flags in marlinmt::book.

Definition at line 15 of file Flags.h.

Constructor & Destructor Documentation

◆ Flag_t() [1/5]

constexpr marlinmt::book::Flag_t::Flag_t ( unsigned long long  val)
inlineexplicit

constructor flag from number.

Definition at line 22 of file Flags.h.

◆ Flag_t() [2/5]

marlinmt::book::Flag_t::Flag_t ( const std::bitset< AmtFlags > &  val)
inlineexplicit

Construct flag from bitset.

Definition at line 28 of file Flags.h.

◆ Flag_t() [3/5]

marlinmt::book::Flag_t::Flag_t ( )
default

◆ Flag_t() [4/5]

marlinmt::book::Flag_t::Flag_t ( const Flag_t )
default

◆ Flag_t() [5/5]

marlinmt::book::Flag_t::Flag_t ( Flag_t &&  )
defaultnoexcept

◆ ~Flag_t()

marlinmt::book::Flag_t::~Flag_t ( )
default

Member Function Documentation

◆ contains()

bool marlinmt::book::Flag_t::contains ( const Flag_t f) const
inline

check if the flags is a subset of the other.

Parameters
flagwhich is may/mayn't the subset
Returns
true if f is a subset of this

Definition at line 77 of file Flags.h.

References _val.

Referenced by marlinmt::BookStoreManager::bookHist().

◆ operator &()

Flag_t marlinmt::book::Flag_t::operator& ( const Flag_t f) const
inline

logical AND on tow set of Flags.

Definition at line 40 of file Flags.h.

References _val.

◆ operator bool()

marlinmt::book::Flag_t::operator bool ( ) const
inlineexplicit

cast to bool.

Returns
true if any flag is set.

Definition at line 55 of file Flags.h.

◆ operator const std::bitset< AmtFlags > &()

marlinmt::book::Flag_t::operator const std::bitset< AmtFlags > & ( ) const
inlineexplicit

cast to bitset.

Definition at line 60 of file Flags.h.

◆ operator unsigned long long()

marlinmt::book::Flag_t::operator unsigned long long ( ) const
inlineexplicit

Definition at line 81 of file Flags.h.

◆ operator!=()

bool marlinmt::book::Flag_t::operator!= ( const Flag_t f) const
inline

check for inequality.

Definition at line 70 of file Flags.h.

References _val.

◆ operator=() [1/2]

Flag_t& marlinmt::book::Flag_t::operator= ( const Flag_t flag)
inline

Definition at line 84 of file Flags.h.

References _val.

◆ operator=() [2/2]

Flag_t& marlinmt::book::Flag_t::operator= ( Flag_t &&  flag)
inlinenoexcept

Definition at line 89 of file Flags.h.

References _val.

◆ operator==()

bool marlinmt::book::Flag_t::operator== ( const Flag_t f) const
inline

check for equality.

Definition at line 65 of file Flags.h.

References _val.

◆ operator|()

Flag_t marlinmt::book::Flag_t::operator| ( const Flag_t f) const
inline

logical OR on tow set of Flags.

Definition at line 47 of file Flags.h.

References _val.

◆ operator~()

Flag_t marlinmt::book::Flag_t::operator~ ( ) const
inline

bitwise not for Flags

Definition at line 33 of file Flags.h.

Friends And Related Function Documentation

◆ Flags::value

constexpr unsigned long long Flags::value ( const Flag_t )
friend

Member Data Documentation

◆ _initValue

const unsigned long long marlinmt::book::Flag_t::_initValue {0}
private

Definition at line 98 of file Flags.h.

Referenced by marlinmt::book::Flags::value().

◆ _val

std::bitset< AmtFlags > marlinmt::book::Flag_t::_val {0}
private

flags saved as bits

Definition at line 97 of file Flags.h.

Referenced by contains(), operator &(), operator!=(), operator=(), operator==(), and operator|().

◆ AmtFlags

constexpr std::size_t marlinmt::book::Flag_t::AmtFlags = 8
staticprivate

Definition at line 16 of file Flags.h.


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