#ifndef STORAGE_LEVELDB_DB_SKIPLIST_H_
#define STORAGE_LEVELDB_DB_SKIPLIST_H_
#include <atomic>
#include <cassert>
#include <cstdlib>
#include "util/arena.h"
#include "util/random.h"
namespace leveldb {
template <typename Key, class Comparator>
class SkipList { … };
template <typename Key, class Comparator>
struct SkipList<Key, Comparator>::Node { … };
template <typename Key, class Comparator>
typename SkipList<Key, Comparator>::Node* SkipList<Key, Comparator>::NewNode(
const Key& key, int height) { … }
template <typename Key, class Comparator>
inline SkipList<Key, Comparator>::Iterator::Iterator(const SkipList* list) { … }
template <typename Key, class Comparator>
inline bool SkipList<Key, Comparator>::Iterator::Valid() const { … }
template <typename Key, class Comparator>
inline const Key& SkipList<Key, Comparator>::Iterator::key() const { … }
template <typename Key, class Comparator>
inline void SkipList<Key, Comparator>::Iterator::Next() { … }
template <typename Key, class Comparator>
inline void SkipList<Key, Comparator>::Iterator::Prev() { … }
template <typename Key, class Comparator>
inline void SkipList<Key, Comparator>::Iterator::Seek(const Key& target) { … }
template <typename Key, class Comparator>
inline void SkipList<Key, Comparator>::Iterator::SeekToFirst() { … }
template <typename Key, class Comparator>
inline void SkipList<Key, Comparator>::Iterator::SeekToLast() { … }
template <typename Key, class Comparator>
int SkipList<Key, Comparator>::RandomHeight() { … }
template <typename Key, class Comparator>
bool SkipList<Key, Comparator>::KeyIsAfterNode(const Key& key, Node* n) const { … }
template <typename Key, class Comparator>
typename SkipList<Key, Comparator>::Node*
SkipList<Key, Comparator>::FindGreaterOrEqual(const Key& key,
Node** prev) const { … }
template <typename Key, class Comparator>
typename SkipList<Key, Comparator>::Node*
SkipList<Key, Comparator>::FindLessThan(const Key& key) const { … }
template <typename Key, class Comparator>
typename SkipList<Key, Comparator>::Node* SkipList<Key, Comparator>::FindLast()
const { … }
template <typename Key, class Comparator>
SkipList<Key, Comparator>::SkipList(Comparator cmp, Arena* arena)
: … { … }
template <typename Key, class Comparator>
void SkipList<Key, Comparator>::Insert(const Key& key) { … }
template <typename Key, class Comparator>
bool SkipList<Key, Comparator>::Contains(const Key& key) const { … }
}
#endif