Commit 248696d0 authored by Michael Büsch's avatar Michael Büsch

enumerator: Add bitmask support

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 8da29951
......@@ -51,11 +51,21 @@ class MagicEnumerationGenerator(object):
self.__num += 1
return number
@property
def bitmask(self):
mask = self.bitmaskNoInc
self.__num += 1
return mask
@property
def itemNoInc(self):
assert(self.__num is not None)
return self.__num
@property
def bitmaskNoInc(self):
return 1 << self.itemNoInc
def itemAt(self, number):
assert(self.__num is not None)
self.__num = number + 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment