Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-28 07:03:43

0001 
0002 #include <TObject.h>
0003 
0004 #ifndef _BIT_MASK_
0005 #define _BIT_MASK_
0006 
0007 class BitMask: public TObject {
0008  public:
0009  BitMask(ULong64_t mask = 0): m_Mask(mask) {};
0010   ~BitMask() {};
0011 
0012   // FIXME: no range check?;
0013   bool CheckBit(unsigned id)     const { return (m_Mask >> id) & 0x1; };
0014   bool CheckBits(ULong64_t mask) const { return (m_Mask & mask); };
0015 
0016   void SetMask(ULong64_t mask) { m_Mask  = mask; }; 
0017   void AddBits(ULong64_t mask) { m_Mask |= mask; }; 
0018 
0019  private:
0020   ULong64_t m_Mask;
0021 
0022 #ifndef DISABLE_ROOT_IO
0023   ClassDef(BitMask,1);
0024 #endif
0025 };
0026 
0027 #endif