Bit array manipulation class.
Macros:
Enumerations:
None.
Typedefs:
None.
Struct CapyBitArray :
Struct CapyBitArray's properties:
Size in bits of the array
Data
Struct CapyBitArray's methods:
Destructor
Initialised the array with an array of bytes
Input argument(s):
bytes: the bytes used to initialise
size: the number of bytes in 'bytes'
Output and side effect(s):
'that->data' is freed if necessary and replaced with a copy of 'bytes', and 'that->size' is updated
Get one bit in the array
Input argument(s):
iBit: the index of the bit
Output and side effect(s):
Return the bit at the requested position
Resize the array
Input argument(s):
size: the new size in bits
Output and side effect(s):
Memory is allocated for 'that->data' and 'that->size' is updated. The content of 'that->data' is undefined.
Set a bit in the array
Input argument(s):
iBit: hte index of the bit
bit: the value of the bit
Output and side effect(s):
The bit is updated.
Functions:
Create a CapyBitArray
Output and side effect(s):
Return an empty CapyBitArray
Allocate memory for a new CapyBitArray and create it
Output and side effect(s):
Return an empty CapyBitArray
Exception(s):
May raise CapyExc_MallocFailed.
Free the memory used by a CapyBitArray* and reset '*that' to NULL
Input argument(s):
that: a pointer to the CapyBitArray to free