#include <splay.h>

Inheritance diagram for SplayNode< V >:
Collaboration diagram for SplayNode< V >:

Public Types

typedef V Value
 
typedef int SPLAYCMP(Value const &a, Value const &b)
 
typedef void SPLAYFREE(Value &)
 
typedef void SPLAYWALKEE(Value const &nodedata, void *state)
 

Public Member Functions

 SplayNode (Value const &)
 
void destroy (SPLAYFREE *=DefaultFree)
 
void walk (SPLAYWALKEE *, void *callerState)
 
SplayNode< V > const * start () const
 
SplayNode< V > const * finish () const
 
SplayNode< V > * remove (const Value data, SPLAYCMP *compare)
 
SplayNode< V > * insert (Value data, SPLAYCMP *compare)
 
template<class FindValue >
SplayNode< V > * splay (const FindValue &data, int(*compare)(FindValue const &a, Value const &b)) const
 
template<class Visitor >
void visit (Visitor &v) const
 recursively visit left nodes, this node, and then right nodes More...
 

Static Public Member Functions

static void DefaultFree (Value &aValue)
 

Public Attributes

Value data
 
SplayNode< V > * left
 
SplayNode< V > * right
 

Detailed Description

template<class V>
class SplayNode< V >

Definition at line 17 of file splay.h.

Member Typedef Documentation

◆ SPLAYCMP

template<class V >
typedef int SplayNode< V >::SPLAYCMP(Value const &a, Value const &b)

Definition at line 21 of file splay.h.

◆ SPLAYFREE

template<class V >
typedef void SplayNode< V >::SPLAYFREE(Value &)

Definition at line 22 of file splay.h.

◆ SPLAYWALKEE

template<class V >
typedef void SplayNode< V >::SPLAYWALKEE(Value const &nodedata, void *state)

Definition at line 23 of file splay.h.

◆ Value

template<class V >
typedef V SplayNode< V >::Value

Definition at line 20 of file splay.h.

Constructor & Destructor Documentation

◆ SplayNode()

template<class V >
SplayNode< V >::SplayNode ( Value const &  someData)

Definition at line 97 of file splay.h.

Member Function Documentation

◆ DefaultFree()

template<class V >
static void SplayNode< V >::DefaultFree ( Value aValue)
inlinestatic

Definition at line 24 of file splay.h.

◆ destroy()

template<class V >
void SplayNode< V >::destroy ( SPLAYFREE free_func = DefaultFree)

Definition at line 134 of file splay.h.

References SplayNode< V >::destroy().

Referenced by SplayNode< V >::destroy(), and main().

◆ finish()

template<class V >
SplayNode< V > const * SplayNode< V >::finish

Definition at line 124 of file splay.h.

References SplayNode< V >::finish().

Referenced by SplayNode< V >::finish().

◆ insert()

template<class V >
SplayNode< V > * SplayNode< V >::insert ( Value  data,
SPLAYCMP compare 
)

Definition at line 174 of file splay.h.

References SplayNode< V >::left, SplayNode< V >::right, and splayLastResult.

Referenced by main().

◆ remove()

template<class V >
SplayNode< V > * SplayNode< V >::remove ( const Value  data,
SPLAYCMP compare 
)

Definition at line 149 of file splay.h.

References SplayNode< V >::left, SplayNode< V >::right, and splayLastResult.

◆ splay()

template<class V >
template<class FindValue >
SplayNode< V > * SplayNode< V >::splay ( const FindValue &  data,
int(*)(FindValue const &a, Value const &b)  compare 
) const

look in the splay for data for where compare(data,candidate) == true. return NULL if not found, a pointer to the sought data if found.

Definition at line 200 of file splay.h.

References SplayNode< V >::data, SplayNode< V >::left, SplayNode< V >::right, and splayLastResult.

◆ start()

template<class V >
SplayNode< V > const * SplayNode< V >::start

Definition at line 114 of file splay.h.

References SplayNode< V >::start().

Referenced by SplayNode< V >::start().

◆ visit()

template<class V >
template<class Visitor >
void SplayNode< V >::visit ( Visitor &  v) const

Definition at line 264 of file splay.h.

References SplayNode< V >::visit().

Referenced by SplayNode< V >::visit().

◆ walk()

template<class V >
void SplayNode< V >::walk ( SPLAYWALKEE walkee,
void *  callerState 
)

Definition at line 101 of file splay.h.

References SplayNode< V >::walk().

Referenced by main(), and SplayNode< V >::walk().

Member Data Documentation

◆ data

◆ left

template<class V >
SplayNode<V>* SplayNode< V >::left
mutable

◆ right

template<class V >
SplayNode<V>* SplayNode< V >::right
mutable

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

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors