wasp_general.types package¶
Submodules¶
wasp_general.types.binarray module¶
-
class
wasp_general.types.binarray.WBinArray(value=0, size=None)[source]¶ Bases:
objectThis type represent sequence of bit. Bits are ordered as MSB does (most significant bit has index 0). If size is specified, then array became fixed-length array. All actions beyond the limit will be omitted or exception will be raised.
see also https://en.wikipedia.org/wiki/Bit_numbering
-
concat(array)[source]¶ Return new fixed-length array, that is made by creating new array with length of sum of two arrays (this array and the given one). In newly created array the most significant bit of the given array will have an index lesser then an index of the least significant bit of this array.
Parameters: array – array to concatenate with Returns: WBinArray
-
extend(*array_list)[source]¶ Concatenate this array with the given arrays. This method doesn’t modify current array. Instead, it creates new one, that have all of arrays. (see
WBinArray.concat()method)Parameters: array_list – list of WBinArray Returns: newly created WBinArray
-
static
join(*args)[source]¶ Concatenate all of the given arrays. (see
WBinArray.concat()method)Parameters: args – list of WBinArray Returns: WBinArray
-
rconcat(array)[source]¶ ‘Reverse’ concatenation. Works the same as
WBinArray.concat(), but in newly created array the most significant bit of the given array will have an index greater then an index of the least significant bit of this arrayParameters: array – array to concatenate with Returns: WBinArray
-
resize(size)[source]¶ Resize current array. If size is None, then array became nonfixed-length array. If new size is less then current size and value, then value will be truncated (lesser significant bits will be truncated).
Parameters: size – Returns:
-
wasp_general.types.bytearray module¶
-
class
wasp_general.types.bytearray.WFixedSizeByteArray(size=0, value=None)[source]¶ Bases:
objectThis class represent fixed-length byte-array. Where byte is WBinArray. Bytes are ordered as big-endian. It means that the most significant byte has index 0.
see also https://en.wikipedia.org/wiki/Endianness
-
byte_size= 8¶ Bits in byte. Derived classed can modify this without breaking the code. Derived class can do this, but why?!
-