UNSIGNEDSET Class Reference

Set of unsigned values, stored in compressed form. More...

#include <mi32/unsignedset.h>

List of all members.

Classes

class  ITERATOR32
 Iterator to step forward through UINT32 items in set. More...
class  ITERATOR64
 Iterator to step forward through UINT64 items in set. More...
class  ITERATOR_INTERSECTION32
 Iterator to step through UINT32 items in intersection of two sets. More...
class  ITERATOR_INTERSECTION64
 Iterator to step through UINT64 items in intersection of two sets. More...
class  ITERATOR_RANGE32
 Iterator to step forward through UINT32 ranges of items in set. More...
class  ITERATOR_RANGE64
 Iterator to step forward through UINT64 ranges of items in set. More...

Public Member Functions

 UNSIGNEDSET ()
 ~UNSIGNEDSET ()
ERRVALUE AddRange (INT64 min, INT64 max)
ERRVALUE AddRange (UINT64 min, UINT64 max)
ERRVALUE AddRange (INT32 min, INT32 max)
ERRVALUE AddRange (UINT32 min, UINT32 max)
ERRVALUE AddSingle (INT64 num)
ERRVALUE AddSingle (UINT64 num)
ERRVALUE AddSingle (INT32 num)
ERRVALUE AddSingle (UINT32 num)
ERRVALUE AddSingle (UINT16 num)
ERRVALUE Assign (const BITSET_UNOWNED &bitset)
ERRVALUE Assign (const UNSIGNEDSET &set)
ERRVALUE AttachCompressed (SIMPLE_ARRAY< UINT8 > &Data)
ERRVALUE AttachCompressed (UINT8 *&pData, UINT32 BufSize)
void Clear ()
ERRVALUE Compress ()
bool Contains (INT64 ItemNum) const
bool Contains (UINT64 ItemNum) const
bool Contains (INT32 ItemNum) const
bool Contains (UINT32 ItemNum) const
bool Contains (UINT16 ItemNum) const
UINT64 CountItems () const
ERRVALUE Decompress ()
ERRVALUE DecompressForContains ()
void Exchange (UNSIGNEDSET &other)
ERRVALUE GetBitSet (BITSET &bitset, UINT32 NumEntries) const
const SIMPLE_ARRAY< UINT8 > & GetCompressed ()
UINT64 GetFirstItem () const
UINT64 GetLastItem () const
ERRVALUE Intersect (const UNSIGNEDSET &rhs)
bool IsCompressed () const
bool IsEmpty () const
ERRVALUE LoadCompressed (const SIMPLE_ARRAY< UINT8 > &Data)
ERRVALUE LoadCompressed (const UINT8 *pData, UINT32 BufSize)
ERRVALUE RemoveRange (INT64 min, INT64 max)
ERRVALUE RemoveRange (UINT64 min, UINT64 max)
ERRVALUE RemoveRange (INT32 min, INT32 max)
ERRVALUE RemoveRange (UINT32 min, UINT32 max)
ERRVALUE RemoveSet (const UNSIGNEDSET &set)
ERRVALUE RemoveSingle (INT64 num)
ERRVALUE RemoveSingle (UINT64 num)
ERRVALUE RemoveSingle (INT32 num)
ERRVALUE RemoveSingle (UINT32 num)
ERRVALUE SetContains (UINT64 num, bool inset)
ERRVALUE SetContains (UINT32 num, bool inset)
ERRVALUE ToggleRange (UINT64 min, UINT64 max)
ERRVALUE ToggleRange (UINT32 min, UINT32 max)
int ToggleSingle (UINT64 num)
ERRVALUE Union (const UNSIGNEDSET &rhs)
ERRVALUE UnionExclusive (const UNSIGNEDSET &rhs)

Detailed Description

Set of unsigned values, stored in compressed form.


Constructor & Destructor Documentation

UNSIGNEDSET::UNSIGNEDSET (  ) 

Default constructor.

UNSIGNEDSET::~UNSIGNEDSET (  ) 

Destructor.


Member Function Documentation

ERRVALUE UNSIGNEDSET::AddRange ( INT64  min,
INT64  max 
) [inline]

Add range of 64-bit item numbers to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::AddRange ( UINT64  min,
UINT64  max 
)

Add range of 64-bit item numbers to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::AddRange ( INT32  min,
INT32  max 
) [inline]

Add range of item numbers to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::AddRange ( UINT32  min,
UINT32  max 
)

Add range of item numbers to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::AddSingle ( INT64  num  )  [inline]

Add single 64-bit item number to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
num Item number to add
ERRVALUE UNSIGNEDSET::AddSingle ( UINT64  num  )  [inline]

Add single 64-bit item number to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
num Item number to add
ERRVALUE UNSIGNEDSET::AddSingle ( INT32  num  )  [inline]

Add single item number to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
num Item number to add
ERRVALUE UNSIGNEDSET::AddSingle ( UINT32  num  )  [inline]

Add single item number to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
num Item number to add
ERRVALUE UNSIGNEDSET::AddSingle ( UINT16  num  )  [inline]

Add single item number to set.

To maintain set in "compressed" form, items must be added in ascending order.

Parameters:
num Item number to add
ERRVALUE UNSIGNEDSET::Assign ( const BITSET_UNOWNED bitset  ) 

Assign from BITSET.

Parameters:
bitset Set to assign from
ERRVALUE UNSIGNEDSET::Assign ( const UNSIGNEDSET set  ) 

Assign set from another.

Parameters:
set Set to assign from
ERRVALUE UNSIGNEDSET::AttachCompressed ( SIMPLE_ARRAY< UINT8 > &  Data  ) 

Attach set to compressed data, taking ownership.

Any iterators referencing the set will become invalid.

Parameters:
Data Compressed data array, will be exchanged with existing data.
ERRVALUE UNSIGNEDSET::AttachCompressed ( UINT8 *&  pData,
UINT32  BufSize 
)

Attach set to compressed data, taking ownership.

Any iterators referencing the set will become invalid.

Parameters:
pData Pointer to compressed data, returned as NULL
BufSize Size of data in bytes
void UNSIGNEDSET::Clear (  ) 

Clear the set.

Any iterators referencing the set will become invalid.

ERRVALUE UNSIGNEDSET::Compress (  ) 

Compress this set if not already.

bool UNSIGNEDSET::Contains ( INT64  ItemNum  )  const [inline]

Determine if set contains specified 64-bit item number.

This may be very inefficient for compressed sets, use of iterator is generally faster if multiple items are being tested. If use of iterator is not practical and multiple calls to Contains might be made, using DecompressForContains can improve performance.

bool UNSIGNEDSET::Contains ( UINT64  ItemNum  )  const

Determine if set contains specified 64-bit item number.

This may be very inefficient for compressed sets, use of iterator is generally faster if multiple items are being tested. If use of iterator is not practical and multiple calls to Contains might be made, using DecompressForContains can improve performance.

bool UNSIGNEDSET::Contains ( INT32  ItemNum  )  const [inline]

Determine if set contains specified item number.

This may be very inefficient for compressed sets, use of iterator is generally faster if multiple items are being tested. If use of iterator is not practical and multiple calls to Contains might be made, using DecompressForContains can improve performance.

bool UNSIGNEDSET::Contains ( UINT32  ItemNum  )  const

Determine if set contains specified item number.

This may be very inefficient for compressed sets, use of iterator is generally faster if multiple items are being tested. If use of iterator is not practical and multiple calls to Contains might be made, using DecompressForContains can improve performance.

bool UNSIGNEDSET::Contains ( UINT16  ItemNum  )  const [inline]

Determine if set contains specified item number.

This may be very inefficient for compressed sets, use of iterator is generally faster if multiple items are being tested. If use of iterator is not practical and multiple calls to Contains might be made, using DecompressForContains can improve performance.

UINT64 UNSIGNEDSET::CountItems (  )  const

Count number of items in set.

ERRVALUE UNSIGNEDSET::Decompress (  ) 

Decompress this set if not already.

ERRVALUE UNSIGNEDSET::DecompressForContains (  ) 

Decompress if will make more efficient for multiple calls to Contains().

void UNSIGNEDSET::Exchange ( UNSIGNEDSET other  ) 

Exchange contents of two sets (efficiently).

Any iterators referencing either set will become invalid.

Parameters:
other Set to exchange with
ERRVALUE UNSIGNEDSET::GetBitSet ( BITSET bitset,
UINT32  NumEntries 
) const

Get as BITSET.

Parameters:
bitset Bit set to contain results
NumEntries Number of entries to size bitset to
const SIMPLE_ARRAY<UINT8>& UNSIGNEDSET::GetCompressed (  ) 

Get compressed data array.

Returned array will be empty if set is not compressed.

UINT64 UNSIGNEDSET::GetFirstItem (  )  const [inline]

Get first item in set.

UINT64 UNSIGNEDSET::GetLastItem (  )  const [inline]

Get last item in set.

ERRVALUE UNSIGNEDSET::Intersect ( const UNSIGNEDSET rhs  ) 

Intersect this set with another, resulting in set containing items that exist in BOTH sets.

This set may become decompressed as a result of this operation. Any iterators referencing this set will become invalid.

bool UNSIGNEDSET::IsCompressed (  )  const [inline]

Determine if set is "compressed".

bool UNSIGNEDSET::IsEmpty (  )  const [inline]

Determine if set is empty.

ERRVALUE UNSIGNEDSET::LoadCompressed ( const SIMPLE_ARRAY< UINT8 > &  Data  )  [inline]

Load set from compressed data array.

Any iterators referencing the set will become invalid.

Parameters:
Data Array of compressed data
ERRVALUE UNSIGNEDSET::LoadCompressed ( const UINT8 pData,
UINT32  BufSize 
)

Load set from compressed data.

Any iterators referencing the set will become invalid.

Parameters:
pData Pointer to compressed data
BufSize Size of data in bytes
ERRVALUE UNSIGNEDSET::RemoveRange ( INT64  min,
INT64  max 
) [inline]

Remove range of 64-bit item numbers to set.

Any iterators referencing this set will become invalid.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::RemoveRange ( UINT64  min,
UINT64  max 
)

Remove range of 64-bit item numbers to set.

Any iterators referencing this set will become invalid.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::RemoveRange ( INT32  min,
INT32  max 
) [inline]

Remove range of item numbers to set.

Any iterators referencing this set will become invalid.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::RemoveRange ( UINT32  min,
UINT32  max 
)

Remove range of item numbers to set.

Any iterators referencing this set will become invalid.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::RemoveSet ( const UNSIGNEDSET set  ) 

Remove set of items from this set.

Any iterators referencing this set will become invalid.

Parameters:
set Set of items to remove
ERRVALUE UNSIGNEDSET::RemoveSingle ( INT64  num  )  [inline]

Remove single 64-bit item number to set.

Any iterators referencing this set will become invalid.

Parameters:
num Item number to remove
ERRVALUE UNSIGNEDSET::RemoveSingle ( UINT64  num  )  [inline]

Remove single 64-bit item number to set.

Any iterators referencing this set will become invalid.

Parameters:
num Item number to remove
ERRVALUE UNSIGNEDSET::RemoveSingle ( INT32  num  )  [inline]

Remove single item number to set.

Any iterators referencing this set will become invalid.

Parameters:
num Item number to remove
ERRVALUE UNSIGNEDSET::RemoveSingle ( UINT32  num  )  [inline]

Remove single item number to set.

Any iterators referencing this set will become invalid.

Parameters:
num Item number to remove
ERRVALUE UNSIGNEDSET::SetContains ( UINT64  num,
bool  inset 
)

Set whether set contains specified 64-bit item.

Any iterators referencing this set may become invalid.

Parameters:
num Item number
inset True to add to set, false to remove
ERRVALUE UNSIGNEDSET::SetContains ( UINT32  num,
bool  inset 
)

Set whether set contains specified 32-bit item.

Any iterators referencing this set may become invalid.

Parameters:
num Item number
inset True to add to set, false to remove
ERRVALUE UNSIGNEDSET::ToggleRange ( UINT64  min,
UINT64  max 
)

Toggle range of 64-bit item numbers to set.

Any iterators referencing this set will become invalid.

Parameters:
min Minimum item number
max Maximum item number
ERRVALUE UNSIGNEDSET::ToggleRange ( UINT32  min,
UINT32  max 
)

Toggle range of item numbers to set.

Any iterators referencing this set will become invalid.

Parameters:
min Minimum item number
max Maximum item number
int UNSIGNEDSET::ToggleSingle ( UINT64  num  ) 

Toggle single item number in set.

Any iterators referencing this set will become invalid.

Returns:
1 if item added to set, 0 if removed, < 0 if error
Parameters:
num Item number to toggle
ERRVALUE UNSIGNEDSET::Union ( const UNSIGNEDSET rhs  ) 

Union this set with another, resulting in set containing items that exist in EITHER set.

This set may become decompressed as a result of this operation. Any iterators referencing this set will become invalid.

ERRVALUE UNSIGNEDSET::UnionExclusive ( const UNSIGNEDSET rhs  ) 

Exclusive union of this set with another, resulting in set containint items that exist in EITHER set but not both.

This set may become decompressed as a result of this operation. Any iterators referencing this set will become invalid.


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

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