Belle II Software release-09-00-00
ByteStore Class Reference
Inheritance diagram for ByteStore:
Collaboration diagram for ByteStore:

Public Member Functions

def setbit (self, pos)
 
def unsetbit (self, pos)
 
def invertbit (self, pos)
 
def setbyte (self, pos, value)
 
def setbyteslice (self, start, end, value)
 

Static Private Attributes

tuple __slots__ = ()
 

Detailed Description

Adding mutating methods to ConstByteStore

Used internally - not part of public interface.

Definition at line 221 of file bitstring.py.

Member Function Documentation

◆ invertbit()

def invertbit (   self,
  pos 
)

Definition at line 238 of file bitstring.py.

238 def invertbit(self, pos):
239 assert 0 <= pos < self.bitlength
240 byte, bit = divmod(self.offset + pos, 8)
241 self._rawarray[byte] ^= (128 >> bit)
242

◆ setbit()

def setbit (   self,
  pos 
)

Definition at line 228 of file bitstring.py.

228 def setbit(self, pos):
229 assert 0 <= pos < self.bitlength
230 byte, bit = divmod(self.offset + pos, 8)
231 self._rawarray[byte] |= (128 >> bit)
232

◆ setbyte()

def setbyte (   self,
  pos,
  value 
)

Definition at line 243 of file bitstring.py.

243 def setbyte(self, pos, value):
244 self._rawarray[pos] = value
245

◆ setbyteslice()

def setbyteslice (   self,
  start,
  end,
  value 
)

Definition at line 246 of file bitstring.py.

246 def setbyteslice(self, start, end, value):
247 self._rawarray[start:end] = value
248
249

◆ unsetbit()

def unsetbit (   self,
  pos 
)

Definition at line 233 of file bitstring.py.

233 def unsetbit(self, pos):
234 assert 0 <= pos < self.bitlength
235 byte, bit = divmod(self.offset + pos, 8)
236 self._rawarray[byte] &= ~(128 >> bit)
237

Member Data Documentation

◆ __slots__

tuple __slots__ = ()
staticprivate

Definition at line 226 of file bitstring.py.


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