LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::flags::Flag_t< Storage > Struct Template Reference

Type identifying a flag. Operations are implemented as free functions. More...

#include "BitMask.h"

Public Types

using Storage_t = Storage
 
using This_t = Flag_t< Storage >
 This type. More...
 

Public Member Functions

constexpr Flag_t (Index_t flagIndex)
 Constructs from the flag index. More...
 
constexpr Index_t index () const
 Returns the index of the (first) bit set. More...
 
constexpr Flag_t copy () const
 Returns a copy of this object. More...
 
Comparison operators for flags
constexpr bool operator== (This_t other) const
 
constexpr bool operator!= (This_t other) const
 
constexpr bool operator< (This_t other) const
 
constexpr bool operator> (This_t other) const
 
constexpr bool operator<= (This_t other) const
 
constexpr bool operator>= (This_t other) const
 

Public Attributes

Storage_t bits
 The bits representing this flag (only one is set) More...
 

Detailed Description

template<typename Storage>
struct util::flags::Flag_t< Storage >

Type identifying a flag. Operations are implemented as free functions.

Definition at line 88 of file BitMask.h.

Member Typedef Documentation

template<typename Storage>
using util::flags::Flag_t< Storage >::Storage_t = Storage

Definition at line 89 of file BitMask.h.

template<typename Storage>
using util::flags::Flag_t< Storage >::This_t = Flag_t<Storage>

This type.

Definition at line 90 of file BitMask.h.

Constructor & Destructor Documentation

template<typename Storage>
constexpr util::flags::Flag_t< Storage >::Flag_t ( Index_t  flagIndex)
inline

Constructs from the flag index.

Definition at line 95 of file BitMask.h.

95 : bits(details::makeBits<Storage_t>(flagIndex)) {}
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92

Member Function Documentation

template<typename Storage>
constexpr Flag_t util::flags::Flag_t< Storage >::copy ( ) const
inline

Returns a copy of this object.

Returns
a copy of this flag

When a flag is declared as constexpr, functions trying to take its address will trigger a link failure (as there is no address for a constexpr). Passing a copy of it should fix the problem.

Definition at line 108 of file BitMask.h.

108 { return *this; }
template<typename Storage>
constexpr Index_t util::flags::Flag_t< Storage >::index ( ) const
template<typename Storage>
constexpr bool util::flags::Flag_t< Storage >::operator!= ( This_t  other) const
inline

Definition at line 114 of file BitMask.h.

References util::flags::Flag_t< Storage >::bits.

114 { return bits != other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92
template<typename Storage>
constexpr bool util::flags::Flag_t< Storage >::operator< ( This_t  other) const
inline

Definition at line 115 of file BitMask.h.

References util::flags::Flag_t< Storage >::bits.

115 { return bits < other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92
template<typename Storage>
constexpr bool util::flags::Flag_t< Storage >::operator<= ( This_t  other) const
inline

Definition at line 117 of file BitMask.h.

References util::flags::Flag_t< Storage >::bits.

117 { return bits <= other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92
template<typename Storage>
constexpr bool util::flags::Flag_t< Storage >::operator== ( This_t  other) const
inline

Definition at line 113 of file BitMask.h.

References util::flags::Flag_t< Storage >::bits.

113 { return bits == other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92
template<typename Storage>
constexpr bool util::flags::Flag_t< Storage >::operator> ( This_t  other) const
inline

Definition at line 116 of file BitMask.h.

References util::flags::Flag_t< Storage >::bits.

116 { return bits > other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92
template<typename Storage>
constexpr bool util::flags::Flag_t< Storage >::operator>= ( This_t  other) const
inline

Definition at line 118 of file BitMask.h.

References util::flags::Flag_t< Storage >::bits.

118 { return bits >= other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:92

Member Data Documentation


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