42 std::cout<<
"bit number is greater than total size. Don't do that!\n";
47 bitNumber = bitNumber-1;
53 int bitOffset = bitNumber %
size;
54 if(bitNumber == 64 || bitNumber == 128){chunkNumber += 1;}
60 tmp = tmp << bitOffset;
89 int bitOffset = bitNumber %
size;
90 if(bitNumber == 64 || bitNumber == 128){chunkNumber += 1;}
99 return ((
_buffer[chunkNumber] & tmp) != 0);
105 if (nBits == 0)
return;
107 bool negShift = (nBits < 0);
109 if (negShift) nBits = -nBits;
112 int value_size =
sizeof(transferBits)*8;
120 transferBits = (0x1 << nBits) - 1;
123 transferBits2 = (0x1 << nBits) - 1;
130 transferBits <<= (value_size - nBits);
131 transferBits2 <<= (value_size - nBits);
138 transferBits = (0x1 << nBits) - 1;
139 transferBits <<= (value_size - nBits);
141 transferBits2 = (0x1 << nBits) - 1;
142 transferBits2 <<= (value_size - nBits);
155 transferBits >>= (value_size - nBits);
158 transferBits2 >>= (value_size - nBits);
199 for (
int j = size;
j > 0;
j--){
void CopyFromBuffer(PhiMemoryImage::value_ptr rhs, int offset)
functions///
void SetBit(int station, int bitNumber, bool value=true)
static const int STATIONS
bool GetBit(int station, int bitNumber) const
std::vector< std::vector< double > > tmp
PhiMemoryImage()
constructors///
PhiMemoryImage::value_type _buffer[PhiMemoryImage::TOTAL_UNITS]
unsigned long int value_type
PhiMemoryImage::value_type * value_ptr
static const int TOTAL_UNITS