Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes

DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType > Class Template Reference

The multilist, representing an abstract data type that generally holds lists. More...

#include <DS_Multilist.h>

List of all members.

Public Member Functions

 Multilist ()
 ~Multilist ()
 Multilist (const Multilist &source)
Multilistoperator= (const Multilist &source)
_DataType & operator[] (const _IndexType position) const
void Push (const _DataType &d, const char *file=__FILE__, unsigned int line=__LINE__)
void Push (const _DataType &d, const _KeyType &key, const char *file=__FILE__, unsigned int line=__LINE__)
_DataType & Pop (const char *file=__FILE__, unsigned int line=__LINE__)
 Gets or removes and gets an element from the list, according to the same rules as Push(). Ordered list is LIFO for the purposes of Pop and Peek.
_DataType & Peek (void) const
void PushOpposite (const _DataType &d, const char *file=__FILE__, unsigned int line=__LINE__)
 Same as Push(), except FIFO and LIFO are reversed. Ordered list still inserts in order.
void PushOpposite (const _DataType &d, const _KeyType &key, const char *file=__FILE__, unsigned int line=__LINE__)
_DataType & PopOpposite (const char *file=__FILE__, unsigned int line=__LINE__)
 Same as Pop() and Peek(), except FIFO and LIFO are reversed.
_DataType & PeekOpposite (void) const
void InsertAtIndex (const _DataType &d, _IndexType index, const char *file=__FILE__, unsigned int line=__LINE__)
 Stack,Queue: Inserts at index indicated, elements are shifted. Ordered list: Inserts, position is ignored.
void RemoveAtIndex (_IndexType position, const char *file=__FILE__, unsigned int line=__LINE__)
 Unordered list, removes at index indicated, swaps last element with that element. Otherwise, array is shifted left to overwrite removed element.
bool RemoveAtKey (_KeyType key, bool assertIfDoesNotExist, const char *file=__FILE__, unsigned int line=__LINE__)
 Find the index of key, and remove at that index.
_IndexType GetIndexOf (_KeyType key) const
 Finds the index of key. Return -1 if the key is not found.
_IndexType GetInsertionIndex (_KeyType key) const
 Returns where in the list we should insert the item, to preserve list order. Returns -1 if the item is already in the list.
_DataType GetPtr (_KeyType key) const
 Finds the index of key. Return 0 if the key is not found. Useful if _DataType is always non-zero pointers.
void ForEach (void(*func)(_DataType &item, const char *file, unsigned int line), const char *file, unsigned int line)
 Iterate over the list, calling the function pointer on each element.
void ForEach (void(*func)(_DataType &item))
bool IsEmpty (void) const
 Returns if the list is empty.
_IndexType GetSize (void) const
 Returns the number of elements used in the list.
void Clear (bool deallocateSmallBlocks=true, const char *file=__FILE__, unsigned int line=__LINE__)
 Empties the list. The list is not deallocated if it is small, unless deallocateSmallBlocks is true.
void ClearPointers (bool deallocateSmallBlocks=true, const char *file=__FILE__, unsigned int line=__LINE__)
 Empties the list, first calling RakNet::OP_Delete on all items.
void ClearPointer (_KeyType key, const char *file=__FILE__, unsigned int line=__LINE__)
 Empty one item from the list, first calling RakNet::OP_Delete on that item.
void ReverseList (void)
 Reverses the elements in the list, and flips the sort order returned by GetSortOrder() if IsSorted() returns true at the time the function is called.
void Reallocate (_IndexType size, const char *file=__FILE__, unsigned int line=__LINE__)
 Reallocates the list to a larger size. If size is smaller than the value returned by GetSize(), the call does nothing.
void Sort (bool force)
 Sorts the list unless it is an ordered list, in which it does nothing as the list is assumed to already be sorted.
void TagSorted (void)
 Sets the list to be remembered as sorted.
void SetSortOrder (bool ascending)
 Defaults to ascending.
bool GetSortOrder (void) const
 Returns true if ascending.
bool IsSorted (void) const
 Returns true if the list is currently believed to be in a sorted state.
MultilistType GetMultilistType (void) const
 Returns what type of list this is.
void SetMultilistType (MultilistType newType)
 Changes what type of list this is.

Static Public Member Functions

static void FindIntersection (Multilist &source1, Multilist &source2, Multilist &intersection, Multilist &uniqueToSource1, Multilist &uniqueToSource2)
 Returns the intersection of two lists. Intersection is items common to both lists.

Protected Types

enum  { ML_UNSORTED, ML_SORTED_ASCENDING, ML_SORTED_DESCENDING }

Protected Member Functions

void ReallocateIfNeeded (const char *file, unsigned int line)
void DeallocateIfNeeded (const char *file, unsigned int line)
void ReallocToSize (_IndexType newAllocationSize, const char *file, unsigned int line)
void ReverseListInternal (void)
void InsertInOrderedList (const _DataType &d, const _KeyType &key)
_IndexType GetIndexFromKeyInSortedList (const _KeyType &key, bool *objectExists) const
void InsertShiftArrayRight (const _DataType &d, _IndexType index)
void DeleteShiftArrayLeft (_IndexType index)
void QSortAscending (_IndexType left, _IndexType right)
void QSortDescending (_IndexType left, _IndexType right)
void CopySource (const Multilist &source)

Protected Attributes

_DataType * data
 An array of user values.
_IndexType dataSize
 Number of elements in the list.
_IndexType allocationSize
 Size of array.
_IndexType queueHead
 Array index for the head of the queue.
_IndexType queueTail
 Array index for the tail of the queue.
_IndexType preallocationSize
enum
DataStructures::Multilist:: { ... }  
sortState
bool ascendingSort
MultilistType variableMultilistType

Detailed Description

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
class DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >

The multilist, representing an abstract data type that generally holds lists.

Parameters:
[in] _MultilistType What type of list this is,
See also:
MultilistType
Parameters:
[in] _DataType What type of data this list holds.
[in] _KeyType If a function takes a key to sort on, what type of key this is. The comparison operator between _DataType and _KeyType must be defined
[in] _IndexType What variable type to use for indices

Definition at line 91 of file DS_Multilist.h.


Member Enumeration Documentation

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
anonymous enum [protected]
Enumerator:
ML_UNSORTED 
ML_SORTED_ASCENDING 
ML_SORTED_DESCENDING 

Definition at line 241 of file DS_Multilist.h.


Constructor & Destructor Documentation

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Multilist (  ) 

Definition at line 255 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::~Multilist (  ) 

Definition at line 276 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Multilist ( const Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  source  ) 

Definition at line 283 of file DS_Multilist.h.

Here is the call graph for this function:


Member Function Documentation

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Clear ( bool  deallocateSmallBlocks = true,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Empties the list. The list is not deallocated if it is small, unless deallocateSmallBlocks is true.

Definition at line 773 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType, class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ClearPointer ( _KeyType  key,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Empty one item from the list, first calling RakNet::OP_Delete on that item.

Definition at line 804 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ClearPointers ( bool  deallocateSmallBlocks = true,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Empties the list, first calling RakNet::OP_Delete on all items.

The list is not deallocated if it is small, unless deallocateSmallBlocks is true

Definition at line 795 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::CopySource ( const Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  source  )  [protected]

Definition at line 297 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::DeallocateIfNeeded ( const char *  file,
unsigned int  line 
) [protected]

Definition at line 1158 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::DeleteShiftArrayLeft ( _IndexType  index  )  [protected]

Definition at line 1303 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::FindIntersection ( Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  source1,
Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  source2,
Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  intersection,
Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  uniqueToSource1,
Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  uniqueToSource2 
) [static]

Returns the intersection of two lists. Intersection is items common to both lists.

Definition at line 1088 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ForEach ( void(*)(_DataType &item, const char *file, unsigned int line)  func,
const char *  file,
unsigned int  line 
)

Iterate over the list, calling the function pointer on each element.

Definition at line 745 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ForEach ( void(*)(_DataType &item)  func  ) 

Definition at line 753 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType , class _KeyType, class _IndexType >
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetIndexFromKeyInSortedList ( const _KeyType &  key,
bool *  objectExists 
) const [protected]

Definition at line 1235 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType, class _IndexType >
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetIndexOf ( _KeyType  key  )  const

Finds the index of key. Return -1 if the key is not found.

Definition at line 668 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType, class _IndexType >
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetInsertionIndex ( _KeyType  key  )  const

Returns where in the list we should insert the item, to preserve list order. Returns -1 if the item is already in the list.

Definition at line 702 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
MultilistType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetMultilistType ( void   )  const

Returns what type of list this is.

Definition at line 984 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType, class _IndexType >
_DataType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetPtr ( _KeyType  key  )  const

Finds the index of key. Return 0 if the key is not found. Useful if _DataType is always non-zero pointers.

Definition at line 736 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetSize ( void   )  const

Returns the number of elements used in the list.

Definition at line 767 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
bool DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::GetSortOrder ( void   )  const

Returns true if ascending.

Definition at line 972 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::InsertAtIndex ( const _DataType &  d,
_IndexType  index,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Stack,Queue: Inserts at index indicated, elements are shifted. Ordered list: Inserts, position is ignored.

Definition at line 534 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType, class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::InsertInOrderedList ( const _DataType &  d,
const _KeyType &  key 
) [protected]

Definition at line 1206 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::InsertShiftArrayRight ( const _DataType &  d,
_IndexType  index 
) [protected]

Definition at line 1287 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
bool DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::IsEmpty ( void   )  const

Returns if the list is empty.

Definition at line 761 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
bool DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::IsSorted ( void   )  const

Returns true if the list is currently believed to be in a sorted state.

Doesn't actually check for sortedness, just if Sort() was recently called, or MultilistType is ML_ORDERED_LIST

Definition at line 978 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
Multilist< _MultilistType, _DataType, _KeyType, _IndexType > & DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::operator= ( const Multilist< _MultilistType, _DataType, _KeyType, _IndexType > &  source  ) 

Definition at line 289 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
_DataType & DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::operator[] ( const _IndexType  position  )  const

Definition at line 322 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
_DataType & DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Peek ( void   )  const

Definition at line 414 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
_DataType & DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::PeekOpposite ( void   )  const

Definition at line 513 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
_DataType & DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Pop ( const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Gets or removes and gets an element from the list, according to the same rules as Push(). Ordered list is LIFO for the purposes of Pop and Peek.

Definition at line 389 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
_DataType & DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::PopOpposite ( const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Same as Pop() and Peek(), except FIFO and LIFO are reversed.

Definition at line 481 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType, class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Push ( const _DataType &  d,
const _KeyType &  key,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Definition at line 344 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Push ( const _DataType &  d,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Unordered list, stack is LIFO QUEUE is FIFO Ordered list is inserted in order

Definition at line 338 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType, class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::PushOpposite ( const _DataType &  d,
const _KeyType &  key,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Definition at line 435 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType, class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::PushOpposite ( const _DataType &  d,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Same as Push(), except FIFO and LIFO are reversed. Ordered list still inserts in order.

Definition at line 429 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::QSortAscending ( _IndexType  left,
_IndexType  right 
) [protected]

Definition at line 863 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::QSortDescending ( _IndexType  left,
_IndexType  right 
) [protected]

Definition at line 911 of file DS_Multilist.h.

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Reallocate ( _IndexType  size,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Reallocates the list to a larger size. If size is smaller than the value returned by GetSize(), the call does nothing.

Definition at line 825 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ReallocateIfNeeded ( const char *  file,
unsigned int  line 
) [protected]

Definition at line 1136 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ReallocToSize ( _IndexType  newAllocationSize,
const char *  file,
unsigned int  line 
) [protected]

Definition at line 1173 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType>
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::RemoveAtIndex ( _IndexType  position,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Unordered list, removes at index indicated, swaps last element with that element. Otherwise, array is shifted left to overwrite removed element.

Index[0] returns the same as Pop() for a queue. Same as PopOpposite() for the list and ordered list

Definition at line 601 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType, class _IndexType >
bool DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::RemoveAtKey ( _KeyType  key,
bool  assertIfDoesNotExist,
const char *  file = __FILE__,
unsigned int  line = __LINE__ 
)

Find the index of key, and remove at that index.

Definition at line 655 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ReverseList ( void   ) 

Reverses the elements in the list, and flips the sort order returned by GetSortOrder() if IsSorted() returns true at the time the function is called.

Definition at line 816 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ReverseListInternal ( void   )  [protected]

Definition at line 1193 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::SetMultilistType ( MultilistType  newType  ) 

Changes what type of list this is.

Precondition:
Template must be defined with ML_VARIABLE_DURING_RUNTIME for this to do anything
Parameters:
[in] mlType Any value of the enum MultilistType, except ML_VARIABLE_DURING_RUNTIME

Definition at line 992 of file DS_Multilist.h.

Here is the call graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::SetSortOrder ( bool  ascending  ) 

Defaults to ascending.

Used by Sort(), and by ML_ORDERED_LIST

Definition at line 959 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::Sort ( bool  force  ) 

Sorts the list unless it is an ordered list, in which it does nothing as the list is assumed to already be sorted.

However, if force is true, it will also resort the ordered list, useful if the comparison operator between _KeyType and _DataType would now return different results Once the list is sorted, further operations to lookup by key will be log2(n) until the list is modified

Definition at line 837 of file DS_Multilist.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<const MultilistType _MultilistType, class _DataType , class _KeyType , class _IndexType >
void DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::TagSorted ( void   ) 

Sets the list to be remembered as sorted.

Optimization if the source is sorted already

Definition at line 854 of file DS_Multilist.h.

Here is the caller graph for this function:


Member Data Documentation

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::allocationSize [protected]

Size of array.

Definition at line 229 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
bool DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::ascendingSort [protected]

Definition at line 248 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
_DataType* DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::data [protected]

An array of user values.

Definition at line 223 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::dataSize [protected]

Number of elements in the list.

Definition at line 226 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::preallocationSize [protected]

How many bytes the user chose to preallocate Won't automatically deallocate below this

Definition at line 239 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::queueHead [protected]

Array index for the head of the queue.

Definition at line 232 of file DS_Multilist.h.

template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
_IndexType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::queueTail [protected]

Array index for the tail of the queue.

Definition at line 235 of file DS_Multilist.h.

enum { ... } DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::sortState [protected]
template<const MultilistType _MultilistType, class _DataType, class _KeyType = _DataType, class _IndexType = DefaultIndexType>
MultilistType DataStructures::Multilist< _MultilistType, _DataType, _KeyType, _IndexType >::variableMultilistType [protected]

Definition at line 251 of file DS_Multilist.h.


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