CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
DTTFBitArray< N >::refToBit Class Reference

#include <DTTFBitArray.h>

Public Member Functions

refToBitflip ()
 
 operator int () const
 
refToBitoperator= (const int val)
 
refToBitoperator= (const refToBit &rtb)
 
int operator~ () const
 
 refToBit ()
 
 refToBit (DTTFBitArray &b, int pos)
 
 ~refToBit ()
 

Private Attributes

int _pos
 
unsigned * _word
 

Friends

class DTTFBitArray
 

Detailed Description

template<int N>
class DTTFBitArray< N >::refToBit

Definition at line 34 of file DTTFBitArray.h.

Constructor & Destructor Documentation

◆ refToBit() [1/2]

template<int N>
DTTFBitArray< N >::refToBit::refToBit ( )
inline

Definition at line 40 of file DTTFBitArray.h.

40 {}

◆ refToBit() [2/2]

template<int N>
DTTFBitArray< N >::refToBit::refToBit ( DTTFBitArray b,
int  pos 
)
inline

◆ ~refToBit()

template<int N>
DTTFBitArray< N >::refToBit::~refToBit ( )
inline

Definition at line 45 of file DTTFBitArray.h.

45 {}

Member Function Documentation

◆ flip()

template<int N>
refToBit& DTTFBitArray< N >::refToBit::flip ( )
inline

Definition at line 69 of file DTTFBitArray.h.

69  {
70  *_word ^= getPosMask(_pos);
71  return *this;
72  }

References DTTFBitArray< N >::refToBit::_pos, DTTFBitArray< N >::refToBit::_word, and DTTFBitArray< N >::getPosMask().

◆ operator int()

template<int N>
DTTFBitArray< N >::refToBit::operator int ( ) const
inline

◆ operator=() [1/2]

template<int N>
refToBit& DTTFBitArray< N >::refToBit::operator= ( const int  val)
inline

Definition at line 47 of file DTTFBitArray.h.

47  {
48  if (val) {
49  *_word |= getPosMask(_pos);
50  } else {
51  *_word &= ~(getPosMask(_pos));
52  }
53  return *this;
54  }

References DTTFBitArray< N >::refToBit::_pos, DTTFBitArray< N >::refToBit::_word, DTTFBitArray< N >::getPosMask(), and heppy_batch::val.

◆ operator=() [2/2]

template<int N>
refToBit& DTTFBitArray< N >::refToBit::operator= ( const refToBit rtb)
inline

Definition at line 56 of file DTTFBitArray.h.

56  {
57  if ((*(rtb._word) & getPosMask(rtb._pos))) {
58  *_word |= getPosMask(_pos);
59  } else {
60  *_word &= ~getPosMask(_pos);
61  }
62  return *this;
63  }

References DTTFBitArray< N >::refToBit::_pos, DTTFBitArray< N >::refToBit::_word, and DTTFBitArray< N >::getPosMask().

◆ operator~()

template<int N>
int DTTFBitArray< N >::refToBit::operator~ ( ) const
inline

Friends And Related Function Documentation

◆ DTTFBitArray

template<int N>
friend class DTTFBitArray
friend

Definition at line 35 of file DTTFBitArray.h.

Member Data Documentation

◆ _pos

template<int N>
int DTTFBitArray< N >::refToBit::_pos
private

◆ _word

template<int N>
unsigned* DTTFBitArray< N >::refToBit::_word
private
DTTFBitArray::getPosMask
static unsigned getPosMask(const int pos)
Definition: DTTFBitArray.h:150
pos
Definition: PixelAliasList.h:18
DTTFBitArray::getPosInWord
static int getPosInWord(const int pos)
Definition: DTTFBitArray.h:144
DTTFBitArray::refToBit::_word
unsigned * _word
Definition: DTTFBitArray.h:75
DTTFBitArray::getWord
unsigned & getWord(const int pos)
Definition: DTTFBitArray.h:134
heppy_batch.val
val
Definition: heppy_batch.py:351
DTTFBitArray::refToBit::_pos
int _pos
Definition: DTTFBitArray.h:76