Bitcoin
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
leveldb::SkipList< Key, Comparator > Class Template Reference

#include <skiplist.h>

Classes

class  Iterator
 
struct  Node
 

Public Member Functions

 SkipList (Comparator cmp, Arena *arena)
 
void Insert (const Key &key)
 
bool Contains (const Key &key) const
 

Private Types

enum  { kMaxHeight = 12 }
 

Private Member Functions

int GetMaxHeight () const
 
NodeNewNode (const Key &key, int height)
 
int RandomHeight ()
 
bool Equal (const Key &a, const Key &b) const
 
bool KeyIsAfterNode (const Key &key, Node *n) const
 
NodeFindGreaterOrEqual (const Key &key, Node **prev) const
 
NodeFindLessThan (const Key &key) const
 
NodeFindLast () const
 
 SkipList (const SkipList &)
 
void operator= (const SkipList &)
 

Private Attributes

Comparator const compare_
 
Arena *const arena_
 
Node *const head_
 
port::AtomicPointer max_height_
 
Random rnd_
 

Member Enumeration Documentation

◆ anonymous enum

template<typename Key, class Comparator>
anonymous enum
private
Enumerator
kMaxHeight 

Constructor & Destructor Documentation

◆ SkipList() [1/2]

template<typename Key , class Comparator>
leveldb::SkipList< Key, Comparator >::SkipList ( Comparator  cmp,
Arena arena 
)
explicit

◆ SkipList() [2/2]

template<typename Key, class Comparator>
leveldb::SkipList< Key, Comparator >::SkipList ( const SkipList< Key, Comparator > &  )
private

Member Function Documentation

◆ Contains()

template<typename Key, class Comparator >
bool leveldb::SkipList< Key, Comparator >::Contains ( const Key key) const

◆ Equal()

template<typename Key, class Comparator>
bool leveldb::SkipList< Key, Comparator >::Equal ( const Key a,
const Key b 
) const
inlineprivate

◆ FindGreaterOrEqual()

template<typename Key, class Comparator >
SkipList< Key, Comparator >::Node * leveldb::SkipList< Key, Comparator >::FindGreaterOrEqual ( const Key key,
Node **  prev 
) const
private

◆ FindLast()

template<typename Key , class Comparator >
SkipList< Key, Comparator >::Node * leveldb::SkipList< Key, Comparator >::FindLast ( ) const
private

◆ FindLessThan()

template<typename Key, class Comparator >
SkipList< Key, Comparator >::Node * leveldb::SkipList< Key, Comparator >::FindLessThan ( const Key key) const
private

◆ GetMaxHeight()

template<typename Key, class Comparator>
int leveldb::SkipList< Key, Comparator >::GetMaxHeight ( ) const
inlineprivate

◆ Insert()

template<typename Key, class Comparator >
void leveldb::SkipList< Key, Comparator >::Insert ( const Key key)

◆ KeyIsAfterNode()

template<typename Key, class Comparator >
bool leveldb::SkipList< Key, Comparator >::KeyIsAfterNode ( const Key key,
Node n 
) const
private

◆ NewNode()

template<typename Key, class Comparator >
SkipList< Key, Comparator >::Node * leveldb::SkipList< Key, Comparator >::NewNode ( const Key key,
int  height 
)
private

◆ operator=()

template<typename Key, class Comparator>
void leveldb::SkipList< Key, Comparator >::operator= ( const SkipList< Key, Comparator > &  )
private

◆ RandomHeight()

template<typename Key , class Comparator >
int leveldb::SkipList< Key, Comparator >::RandomHeight ( )
private

Member Data Documentation

◆ arena_

template<typename Key, class Comparator>
Arena* const leveldb::SkipList< Key, Comparator >::arena_
private

◆ compare_

template<typename Key, class Comparator>
Comparator const leveldb::SkipList< Key, Comparator >::compare_
private

◆ head_

template<typename Key, class Comparator>
Node* const leveldb::SkipList< Key, Comparator >::head_
private

◆ max_height_

template<typename Key, class Comparator>
port::AtomicPointer leveldb::SkipList< Key, Comparator >::max_height_
private

◆ rnd_

template<typename Key, class Comparator>
Random leveldb::SkipList< Key, Comparator >::rnd_
private

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