Belle II Software development
simpleBitfield< T > Class Template Reference

helper class for setting up a bitfield that can be used to store several flags in one variable TODO: move this from this header (possibly to some helperStuff header) and make some tests! More...

#include <SpacePoint2TrueHitConnectorModule.h>

Public Member Functions

 simpleBitfield ()
 default constructor
 
 simpleBitfield (const simpleBitfield< T > &__otherBitfield)=delete
 not needed
 
simpleBitfield< T > & operator= (simpleBitfield< T > &)=delete
 not needed
 
const T hasStatus (T __statusBits) const
 check if a certain status has been set to the bitfield
 
const T getStatus () const
 get the status of the bitfield
 
void setStatus (T __statusBits)
 set the status of the bitfield (CAUTION: overwrites any previously defined status!)
 
void addStatus (T __statusBits)
 add a status to the bitfield (if it has not already been added)
 
void removeStatus (T __statusBits)
 remove a status from the bitfield
 
void clear ()
 reset bitfield
 

Private Attributes

__bits
 member holding the bits that are maniuplated
 

Detailed Description

template<typename T>
class Belle2::simpleBitfield< T >

helper class for setting up a bitfield that can be used to store several flags in one variable TODO: move this from this header (possibly to some helperStuff header) and make some tests!

Definition at line 429 of file SpacePoint2TrueHitConnectorModule.h.

Constructor & Destructor Documentation

◆ simpleBitfield()

simpleBitfield ( )
inline

default constructor

Definition at line 432 of file SpacePoint2TrueHitConnectorModule.h.

Member Function Documentation

◆ addStatus()

void addStatus ( __statusBits)
inline

add a status to the bitfield (if it has not already been added)

Definition at line 444 of file SpacePoint2TrueHitConnectorModule.h.

444{ __bits |= __statusBits; }
T __bits
member holding the bits that are maniuplated

◆ clear()

void clear ( )
inline

reset bitfield

Definition at line 448 of file SpacePoint2TrueHitConnectorModule.h.

448{ __bits = T(); }

◆ getStatus()

const T getStatus ( ) const
inline

get the status of the bitfield

Definition at line 440 of file SpacePoint2TrueHitConnectorModule.h.

440{ return __bits; }

◆ hasStatus()

const T hasStatus ( __statusBits) const
inline

check if a certain status has been set to the bitfield

Definition at line 438 of file SpacePoint2TrueHitConnectorModule.h.

438{ return (__bits & __statusBits) == __statusBits; }

◆ removeStatus()

void removeStatus ( __statusBits)
inline

remove a status from the bitfield

Definition at line 446 of file SpacePoint2TrueHitConnectorModule.h.

446{ __bits &= __statusBits; }

◆ setStatus()

void setStatus ( __statusBits)
inline

set the status of the bitfield (CAUTION: overwrites any previously defined status!)

Definition at line 442 of file SpacePoint2TrueHitConnectorModule.h.

442{ __bits = __statusBits; }

Member Data Documentation

◆ __bits

T __bits
private

member holding the bits that are maniuplated

Definition at line 451 of file SpacePoint2TrueHitConnectorModule.h.


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