Public Member Functions

XList< T, NT > Class Template Reference

Pure virtual base class for internal containers to the multilist. More...

#include <CSCompositeSkipList.h>

List of all members.

Public Member Functions

virtual void insert (NT *node)=0
 Insert a node in the current internal container.
virtual void insert (NT *ref, NT *node)=0
 Inserts a node after the ref node in the current internal container.
virtual void erase (NT *node)=0
 Removes a node from the current internal container.
virtual void setData (void *data)=0
 Set shared data. (Never call this)
virtual void clear ()=0
 Clears the entire multilist.

Detailed Description

template<class T, class NT>
class XList< T, NT >

Pure virtual base class for internal containers to the multilist.

This class is to specify requirements of the derived internal containers. insert(), erase() and setData() should only be called by derived classes.

Protected does not work because derived classes need access to the virtual methods. While a class has access to the protected section of its own base class, it does not have access to the protected section of the base class of another class even if the base classes are identical. IOW, different derived classes need access to each other's base class (which is identical), and protected doesn't allow it.

Only clear() can be invoked by external classes.

The following function should also be defined. But because the return type is different in each derived class, it is not explicitly defined here.

iter insert(const T &val)

Template Parameters:
Ttype of objects to store in container.
NTInternal node type that holds objects of type T.

Member Function Documentation

template<class T, class NT>
virtual void XList< T, NT >::insert ( NT *  node) [pure virtual]

Insert a node in the current internal container.

Inserts at the end if it's an indexed container. Inserts where appropriate if it's a sorted container.

Parameters:
nodeThe node to insert.

Implemented in XIndexedSkipList< X, CT >.

template<class T, class NT>
virtual void XList< T, NT >::insert ( NT *  ref,
NT *  node 
) [pure virtual]

Inserts a node after the ref node in the current internal container.

Parameters:
refThe node after which to insert.
nodeThe node to insert.
template<class T, class NT>
virtual void XList< T, NT >::erase ( NT *  node) [pure virtual]

Removes a node from the current internal container.

Note: This does NOT delete the node.

Parameters:
nodeThe node to remove from the container.

Implemented in XIndexedSkipList< X, CT >.

template<class T, class NT>
virtual void XList< T, NT >::setData ( void *  data) [pure virtual]

Set shared data. (Never call this)

This is for internal use only to set the shared data. The multilist constructor should invoke data->InitData() instead. The data parameter is void* to allow different shared types.

Parameters:
dataShared data usually of type XData.

Implemented in XIndexedSkipList< X, CT >, XMultiAutoSkipList< X, CT, Pr >, XMultiAutoAccessSkipList< X, K, CT, A, Pr >, XMultiSkipList< X, CT, Pr >, and XMultiAccessSkipList< X, K, CT, A, Pr >.


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