XBinder
Version 2.9.x
|
Implementation of a dynamic bit set similar to the Java BitSet class. More...
#include "rtxsrc/rtxBitString.h"
Go to the source code of this file.
Functions | |
EXTERNRT int | rtxDynBitSetInit (OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT16 segNBytes) |
This function initializes a dynamic bit set structure. More... | |
EXTERNRT void | rtxDynBitSetFree (OSCTXT *pctxt, OSRTDynBitSet *pbitset) |
This function frees dynamic memory held by the bit set. More... | |
EXTERNRT int | rtxDynBitSetCopy (OSCTXT *pctxt, const OSRTDynBitSet *pSrcBitSet, OSRTDynBitSet *pDestBitSet) |
This function creates a deep copy of the given bit set. More... | |
EXTERNRT int | rtxDynBitSetSetBit (OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT32 idx) |
This function sets the bit at the given index. More... | |
EXTERNRT int | rtxDynBitSetClearBit (OSRTDynBitSet *pbitset, OSUINT32 idx) |
This function clears the bit at the given index. More... | |
EXTERNRT OSBOOL | rtxDynBitSetTestBit (const OSRTDynBitSet *pbitset, OSUINT32 idx) |
This function tests the bit at the given index. More... | |
EXTERNRT int | rtxDynBitSetSetBitToValue (OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT32 idx, OSBOOL value) |
This function sets the bit at the given index to the give value. More... | |
EXTERNRT int | rtxDynBitSetInsertBit (OSCTXT *pctxt, OSRTDynBitSet *pbitset, OSUINT32 idx, OSBOOL value) |
This function inserts a bit with the given value at the given index. More... | |
Implementation of a dynamic bit set similar to the Java BitSet class.
Definition in file rtxDynBitSet.h.
EXTERNRT int rtxDynBitSetClearBit | ( | OSRTDynBitSet * | pbitset, |
OSUINT32 | idx | ||
) |
This function clears the bit at the given index.
The bit set will be not be expanded if the given index is outside the currently allocated range. The bit will be assumed to already be clear since it is undefined.
pbitset | Pointer to bit set structure. |
idx | Index of bit to be clear. |
EXTERNRT int rtxDynBitSetCopy | ( | OSCTXT * | pctxt, |
const OSRTDynBitSet * | pSrcBitSet, | ||
OSRTDynBitSet * | pDestBitSet | ||
) |
This function creates a deep copy of the given bit set.
pctxt | Pointer to a context structure. |
pSrcBitSet | Pointer to bit set structure to be copied. |
pDestBitSet | Pointer to bit set structure to recieve copied data. |
EXTERNRT void rtxDynBitSetFree | ( | OSCTXT * | pctxt, |
OSRTDynBitSet * | pbitset | ||
) |
This function frees dynamic memory held by the bit set.
pctxt | Pointer to a context structure. |
pbitset | Pointer to bit set structure to be freed. |
EXTERNRT int rtxDynBitSetInit | ( | OSCTXT * | pctxt, |
OSRTDynBitSet * | pbitset, | ||
OSUINT16 | segNBytes | ||
) |
This function initializes a dynamic bit set structure.
Memory is allocated for the initial segment.
pctxt | Pointer to a context structure. |
pbitset | Pointer to bit set structure to be initialized. |
segNBytes | Number of bytes per segment expansion. If zero, the default value is used. |
EXTERNRT int rtxDynBitSetInsertBit | ( | OSCTXT * | pctxt, |
OSRTDynBitSet * | pbitset, | ||
OSUINT32 | idx, | ||
OSBOOL | value | ||
) |
This function inserts a bit with the given value at the given index.
All other bits are shifted to the right one position. If the maximum set bit number is at the end of the allocated range, the set is expanded.
pctxt | Pointer to a context structure. |
pbitset | Pointer to bit set structure. |
idx | Index of position where bit is to be inserted. |
value | Boolean value of the bit. |
EXTERNRT int rtxDynBitSetSetBit | ( | OSCTXT * | pctxt, |
OSRTDynBitSet * | pbitset, | ||
OSUINT32 | idx | ||
) |
This function sets the bit at the given index.
The bit set will be expanded if the given index is outside the currently allocated range.
pctxt | Pointer to a context structure. |
pbitset | Pointer to bit set structure. |
idx | Index of bit to be set. |
EXTERNRT int rtxDynBitSetSetBitToValue | ( | OSCTXT * | pctxt, |
OSRTDynBitSet * | pbitset, | ||
OSUINT32 | idx, | ||
OSBOOL | value | ||
) |
This function sets the bit at the given index to the give value.
The bit set will be expanded if the given index is outside the currently allocated range.
pctxt | Pointer to a context structure. |
pbitset | Pointer to bit set structure. |
idx | Index of bit to be set. |
value | Boolean value to which bit is to be set. |
EXTERNRT OSBOOL rtxDynBitSetTestBit | ( | const OSRTDynBitSet * | pbitset, |
OSUINT32 | idx | ||
) |
This function tests the bit at the given index.
If the index is outside the range of the currently allocated set, the bit is assumed to be clear; otherwise, the state of the bit in the set is tested.
pbitset | Pointer to bit set structure. |
idx | Index of bit to be tested. |