LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 89 of file BitMask.h.

Member Typedef Documentation

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

Definition at line 90 of file BitMask.h.

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

This type.

Definition at line 91 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 96 of file BitMask.h.

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

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 111 of file BitMask.h.

111 { 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 118 of file BitMask.h.

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

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

Definition at line 120 of file BitMask.h.

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

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

Definition at line 124 of file BitMask.h.

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

125  { return bits <= other.bits; }
Storage_t bits
The bits representing this flag (only one is set)
Definition: BitMask.h:93
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.

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

Definition at line 122 of file BitMask.h.

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

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

Definition at line 126 of file BitMask.h.

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

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

Member Data Documentation


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