XBinder  Version 2.6.x
Functions
rtxDynBitSet.h File Reference

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...
 

Detailed Description

Implementation of a dynamic bit set similar to the Java BitSet class.

Definition in file rtxDynBitSet.h.

Function Documentation

◆ rtxDynBitSetClearBit()

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.

Parameters
pbitsetPointer to bit set structure.
idxIndex of bit to be clear.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynBitSetCopy()

EXTERNRT int rtxDynBitSetCopy ( OSCTXT pctxt,
const OSRTDynBitSet *  pSrcBitSet,
OSRTDynBitSet *  pDestBitSet 
)

This function creates a deep copy of the given bit set.

Parameters
pctxtPointer to a context structure.
pSrcBitSetPointer to bit set structure to be copied.
pDestBitSetPointer to bit set structure to recieve copied data.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynBitSetFree()

EXTERNRT void rtxDynBitSetFree ( OSCTXT pctxt,
OSRTDynBitSet *  pbitset 
)

This function frees dynamic memory held by the bit set.

Parameters
pctxtPointer to a context structure.
pbitsetPointer to bit set structure to be freed.

◆ rtxDynBitSetInit()

EXTERNRT int rtxDynBitSetInit ( OSCTXT pctxt,
OSRTDynBitSet *  pbitset,
OSUINT16  segNBytes 
)

This function initializes a dynamic bit set structure.

Memory is allocated for the initial segment.

Parameters
pctxtPointer to a context structure.
pbitsetPointer to bit set structure to be initialized.
segNBytesNumber of bytes per segment expansion. If zero, the default value is used.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynBitSetInsertBit()

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.

Parameters
pctxtPointer to a context structure.
pbitsetPointer to bit set structure.
idxIndex of position where bit is to be inserted.
valueBoolean value of the bit.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynBitSetSetBit()

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.

Parameters
pctxtPointer to a context structure.
pbitsetPointer to bit set structure.
idxIndex of bit to be set.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynBitSetSetBitToValue()

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.

Parameters
pctxtPointer to a context structure.
pbitsetPointer to bit set structure.
idxIndex of bit to be set.
valueBoolean value to which bit is to be set.
Returns
Status of operation: zero if success or a negative error code if failure.

◆ rtxDynBitSetTestBit()

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.

Parameters
pbitsetPointer to bit set structure.
idxIndex of bit to be tested.
Returns
Boolean result: true if bit set; false if clear.