leveldb
Public Member Functions | Public Attributes | Private Attributes | List of all members
leveldb::SkipList< Key, Comparator >::Node Struct Reference

#include <skiplist.h>

Public Member Functions

 Node (const Key &k)
 
NodeNext (int n)
 
void SetNext (int n, Node *x)
 
NodeNoBarrier_Next (int n)
 
void NoBarrier_SetNext (int n, Node *x)
 

Public Attributes

Key const key
 

Private Attributes

port::AtomicPointer next_ [1]
 

Detailed Description

template<typename Key, class Comparator>
struct leveldb::SkipList< Key, Comparator >::Node

Definition at line 147 of file skiplist.h.

Constructor & Destructor Documentation

§ Node()

template<typename Key, class Comparator>
leveldb::SkipList< Key, Comparator >::Node::Node ( const Key k)
inlineexplicit

Definition at line 148 of file skiplist.h.

148 : key(k) { }

Member Function Documentation

§ Next()

template<typename Key, class Comparator>
Node* leveldb::SkipList< Key, Comparator >::Node::Next ( int  n)
inline

Definition at line 154 of file skiplist.h.

154  {
155  assert(n >= 0);
156  // Use an 'acquire load' so that we observe a fully initialized
157  // version of the returned Node.
158  return reinterpret_cast<Node*>(next_[n].Acquire_Load());
159  }
port::AtomicPointer next_[1]
Definition: skiplist.h:179
Node(const Key &k)
Definition: skiplist.h:148
Here is the caller graph for this function:

§ NoBarrier_Next()

template<typename Key, class Comparator>
Node* leveldb::SkipList< Key, Comparator >::Node::NoBarrier_Next ( int  n)
inline

Definition at line 168 of file skiplist.h.

168  {
169  assert(n >= 0);
170  return reinterpret_cast<Node*>(next_[n].NoBarrier_Load());
171  }
port::AtomicPointer next_[1]
Definition: skiplist.h:179
Node(const Key &k)
Definition: skiplist.h:148

§ NoBarrier_SetNext()

template<typename Key, class Comparator>
void leveldb::SkipList< Key, Comparator >::Node::NoBarrier_SetNext ( int  n,
Node x 
)
inline

Definition at line 172 of file skiplist.h.

172  {
173  assert(n >= 0);
174  next_[n].NoBarrier_Store(x);
175  }
port::AtomicPointer next_[1]
Definition: skiplist.h:179

§ SetNext()

template<typename Key, class Comparator>
void leveldb::SkipList< Key, Comparator >::Node::SetNext ( int  n,
Node x 
)
inline

Definition at line 160 of file skiplist.h.

160  {
161  assert(n >= 0);
162  // Use a 'release store' so that anybody who reads through this
163  // pointer observes a fully initialized version of the inserted node.
164  next_[n].Release_Store(x);
165  }
port::AtomicPointer next_[1]
Definition: skiplist.h:179

Member Data Documentation

§ key

template<typename Key, class Comparator>
Key const leveldb::SkipList< Key, Comparator >::Node::key

Definition at line 150 of file skiplist.h.

§ next_

template<typename Key, class Comparator>
port::AtomicPointer leveldb::SkipList< Key, Comparator >::Node::next_[1]
private

Definition at line 179 of file skiplist.h.


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