Pure virtual base class for internal containers to the multilist. More...
#include <CSCompositeSkipList.h>
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. |
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)
T | type of objects to store in container. |
NT | Internal node type that holds objects of type T. |
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.
node | The node to insert. |
Implemented in XIndexedSkipList< X, CT >.
virtual void XList< T, NT >::insert | ( | NT * | ref, |
NT * | node | ||
) | [pure virtual] |
Inserts a node after the ref node in the current internal container.
ref | The node after which to insert. |
node | The node to insert. |
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.
node | The node to remove from the container. |
Implemented in XIndexedSkipList< X, CT >.
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.
data | Shared 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 >.