Public Member Functions | Public Attributes

XTmpContainer< size_type, node_type > Class Template Reference

Internal temporary container for cutting and splicing nodes. More...

#include <CSCompositeSkipList.h>

List of all members.

Public Member Functions

node_type * Alloc (unsigned int level)
 Allocate a dummy node. O(1)
void Free (node_type *item)
 Delete a node. O(1)
 XTmpContainer (double probability, unsigned int maxLevel)
 Constructor O(1)
 ~XTmpContainer ()
 Destructor O(n)
size_type size () const
 Returns the size of the list. O(1)
bool empty () const
 Returns true if the list's size is 0. O(1)

Public Attributes

unsigned int maxLevel
 Maximum number of levels possible for forward pointers.
unsigned int level
 The maximum number of levels for forward pointers currently in use on any given node.
node_type * head
 Start node.
node_type * tail
 End node.
double probability
 Probability to go to the next level.
size_type items
 Number of items in the list.

Detailed Description

template<class size_type, class node_type>
class XTmpContainer< size_type, node_type >

Internal temporary container for cutting and splicing nodes.

You should not be seeing this. Close your eyes!

Template Parameters:
size_typeType for unsigned variables relating te sizes.
node_typeType for internal nodes that contain elements.

Constructor & Destructor Documentation

template<class size_type , class node_type >
XTmpContainer< size_type, node_type >::XTmpContainer ( double  probability,
unsigned int  maxLevel 
) [inline]

Constructor O(1)

Parameters:
probabilityProbability for number of levels in a new node.
maxLevelMaxmimum number of levels for this list.
template<class size_type , class node_type >
XTmpContainer< size_type, node_type >::~XTmpContainer ( ) [inline]

Destructor O(n)

Clears list.


Member Function Documentation

template<class size_type , class node_type >
node_type* XTmpContainer< size_type, node_type >::Alloc ( unsigned int  level) [inline]

Allocate a dummy node. O(1)

Parameters:
levelNumber of levels for this node.
Returns:
The allocated node.
template<class size_type , class node_type >
void XTmpContainer< size_type, node_type >::Free ( node_type *  item) [inline]

Delete a node. O(1)

Parameters:
itemNode to delete.
template<class size_type , class node_type >
size_type XTmpContainer< size_type, node_type >::size ( ) const [inline]

Returns the size of the list. O(1)

Returns:
size of the list.
template<class size_type , class node_type >
bool XTmpContainer< size_type, node_type >::empty ( ) const [inline]

Returns true if the list's size is 0. O(1)

Returns:
true if the list's size is 0, false otherwise.

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs