BITSET_UNOWNED Class Reference

Base bit set class for case where actual array is "owned" by something other than the class. More...

#include <mi32/bitset.h>

Inheritance diagram for BITSET_UNOWNED:
Inheritance graph
[legend]

List of all members.

Classes

class  ITERATOR
 Iterator to step forward through all selected items in a BITSET. More...

Public Member Functions

 BITSET_UNOWNED (UINT8 *set, UINT32 NumEntries)
 BITSET_UNOWNED ()
virtual ~BITSET_UNOWNED ()
virtual ERRVALUE Assign (UINT8 *set, UINT32 NumEntries)
ITERATOR Begin (bool value=true) const
void Clear (UINT32 posn)
void ClearAll ()
void ClearRange (UINT32 min, UINT32 max)
void CopyBit (UINT32 DestPosn, UINT32 SourcePosn)
INT32 CountValues (bool value=true) const
ITERATOR End () const
bool GetBit (UINT32 posn) const
UINT32 GetNumEntries () const
bool GetRange (UINT32 StartPosn, UINT32 MaxEnd, UINT32 &EndPosn) const
bool HasEntries () const
bool HasMultiple (bool value) const
bool HasValue (bool value) const
void Invert (UINT32 posn)
void InvertAll ()
void InvertRange (UINT32 min, UINT32 max)
bool IsEqual (const BITSET_UNOWNED &rhs) const
 operator const UINT8 * () const
 operator UINT8 * ()
BITSET_UNOWNEDoperator&= (const BITSET_UNOWNED &rhs)
BITSET_UNOWNEDoperator^= (const BITSET_UNOWNED &rhs)
BITSET_UNOWNEDoperator|= (const BITSET_UNOWNED &rhs)
void Set (UINT32 posn)
void SetAll ()
void SetBit (UINT32 posn, bool value)
void SetRange (UINT32 min, UINT32 max)

Protected Attributes

UINT8m_Array
UINT32 m_ArraySize
UINT32 m_NumEntries

Detailed Description

Base bit set class for case where actual array is "owned" by something other than the class.


Constructor & Destructor Documentation

BITSET_UNOWNED::BITSET_UNOWNED (  ) 

Default constructor.

BITSET_UNOWNED::BITSET_UNOWNED ( UINT8 set,
UINT32  NumEntries 
)

Constructor to convert old bit-array's into BITSET_UNOWNEDs.

Parameters:
set Old bit array set
NumEntries Number of items in old bit array, not size in bytes
virtual BITSET_UNOWNED::~BITSET_UNOWNED (  )  [virtual]

Destructor.


Member Function Documentation

virtual ERRVALUE BITSET_UNOWNED::Assign ( UINT8 set,
UINT32  NumEntries 
) [virtual]

Assign from old type bit arrays.

Parameters:
set Pointer to old bit-array
NumEntries Number of items in old bit array

Reimplemented in BITSET, and BITSET_SHARED.

ITERATOR BITSET_UNOWNED::Begin ( bool  value = true  )  const [inline]

Initialize iterator with first set or unset item in the bit set.

Returns iterator to first set entry, otherwise the last+1 item if no matching item.

Parameters:
value Value to iterate through
void BITSET_UNOWNED::Clear ( UINT32  posn  )  [inline]

Clear value at specified position.

void BITSET_UNOWNED::ClearAll (  )  [inline]

Clear bit array with false.

Makes all the entries in the bit set 'false'.

void BITSET_UNOWNED::ClearRange ( UINT32  min,
UINT32  max 
)

Set range of entries to "false".

void BITSET_UNOWNED::CopyBit ( UINT32  DestPosn,
UINT32  SourcePosn 
)

Transfer value from source to dest entry.

Replaces putbit(set, DestPosn, getbit(set, SourcePosn)).

Parameters:
DestPosn where setting goes to
SourcePosn where setting comes from
INT32 BITSET_UNOWNED::CountValues ( bool  value = true  )  const

Count the values in the set.

Iterates through the set, so should not be used in time-critical code.

ITERATOR BITSET_UNOWNED::End (  )  const [inline]

Initialize iterator with last+1 item in the bit set.

Returns iterator to last+1 item

bool BITSET_UNOWNED::GetBit ( UINT32  posn  )  const [inline]

Retrieve value at the requested position, true or false.

Returns 'false' if the position given is outside the range of the BITSET

Parameters:
posn position where value is retrieved from
UINT32 BITSET_UNOWNED::GetNumEntries (  )  const [inline]

Return the number of valid entries.

bool BITSET_UNOWNED::GetRange ( UINT32  StartPosn,
UINT32  MaxEnd,
UINT32 EndPosn 
) const

Get a range of entries that are set continuously in the bitset.

Returns:
'True' if a true range, 'false' if a false range
Parameters:
StartPosn Staring position
MaxEnd Maximum ending position
EndPosn Ending position (inclusive) RETURNED
bool BITSET_UNOWNED::HasEntries (  )  const [inline]

Does bit set have any entries?

bool BITSET_UNOWNED::HasMultiple ( bool  value  )  const

Determine if has multiple entries with specified value.

bool BITSET_UNOWNED::HasValue ( bool  value  )  const [inline]

Determine if has at least one entry with specified value;.

void BITSET_UNOWNED::Invert ( UINT32  posn  )  [inline]

Invert value at specified position.

Parameters:
posn Position to be inverted
void BITSET_UNOWNED::InvertAll (  ) 

Invert all entries in bit set.

void BITSET_UNOWNED::InvertRange ( UINT32  min,
UINT32  max 
)

Set range of entries to inverse.

bool BITSET_UNOWNED::IsEqual ( const BITSET_UNOWNED rhs  )  const

Determine if 'this' and 'rhs' are equal.

If the number of entries is different, and the range where entries are shared are the same, will check the extended entries to see if all of its entries are false, if so, will return 'true'. This is equivalent to this code snippet:

 UINT32 MaxEntries = MAX(GetNumEntries(), rhs.GetNumEntries());
 for (UINT32 q = 0;(q < MaxEntries);++q) {
   if (GetBit(q) != rhs.GetBit(q)) return (false);
   }
 return (true);
Returns:
'True' if 'this' and 'rhs' have the same bits set, 'false' if not.
BITSET_UNOWNED::operator const UINT8 * (  )  const [inline]

Conversion to old bit-array style for legacy code.

BITSET_UNOWNED::operator UINT8 * (  )  [inline]

Conversion to old bit-array style for legacy code.

BITSET_UNOWNED& BITSET_UNOWNED::operator&= ( const BITSET_UNOWNED rhs  ) 

Bitwise AND.

If the bit sets are not the same size the set will be unaltered.

BITSET_UNOWNED& BITSET_UNOWNED::operator^= ( const BITSET_UNOWNED rhs  ) 

Bitwise XOR.

If the bit sets are not the same size the set will be unaltered.

BITSET_UNOWNED& BITSET_UNOWNED::operator|= ( const BITSET_UNOWNED rhs  ) 

Bitwise OR.

If the bit sets are not the same size the set will be unaltered.

void BITSET_UNOWNED::Set ( UINT32  posn  )  [inline]

Set a value at the requested position to "true".

Does nothing if the position given is outside range.

Parameters:
posn Position to set
void BITSET_UNOWNED::SetAll (  ) 

Set all entries to true, opposite of ClearAll().

Turn all bit positions to true.

void BITSET_UNOWNED::SetBit ( UINT32  posn,
bool  value 
) [inline]

Set a value at the requested position, true or false.

Does nothing if the position given is outside range.

Parameters:
posn Position where value is set
value Value to be set at position
void BITSET_UNOWNED::SetRange ( UINT32  min,
UINT32  max 
)

Set range of entries to "true".


Member Data Documentation

Placed here so that ITERATOR class can have access to them.

Memory containing the bit array

Array size in bytes.

Actual number of bits used.


The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:33:14 2012 for TNTsdk 2012 by  doxygen 1.6.1