leveldb
Public Member Functions | Private Member Functions | Private Attributes | List of all members
leveldb::IteratorWrapper Class Reference

#include <iterator_wrapper.h>

Collaboration diagram for leveldb::IteratorWrapper:
Collaboration graph
[legend]

Public Member Functions

 IteratorWrapper ()
 
 IteratorWrapper (Iterator *iter)
 
 ~IteratorWrapper ()
 
Iteratoriter () const
 
void Set (Iterator *iter)
 
bool Valid () const
 
Slice key () const
 
Slice value () const
 
Status status () const
 
void Next ()
 
void Prev ()
 
void Seek (const Slice &k)
 
void SeekToFirst ()
 
void SeekToLast ()
 

Private Member Functions

void Update ()
 

Private Attributes

Iteratoriter_
 
bool valid_
 
Slice key_
 

Detailed Description

Definition at line 17 of file iterator_wrapper.h.

Constructor & Destructor Documentation

§ IteratorWrapper() [1/2]

leveldb::IteratorWrapper::IteratorWrapper ( )
inline

Definition at line 19 of file iterator_wrapper.h.

19 : iter_(NULL), valid_(false) { }

§ IteratorWrapper() [2/2]

leveldb::IteratorWrapper::IteratorWrapper ( Iterator iter)
inlineexplicit

Definition at line 20 of file iterator_wrapper.h.

20  : iter_(NULL) {
21  Set(iter);
22  }
void Set(Iterator *iter)
Iterator * iter() const
Here is the call graph for this function:

§ ~IteratorWrapper()

leveldb::IteratorWrapper::~IteratorWrapper ( )
inline

Definition at line 23 of file iterator_wrapper.h.

23 { delete iter_; }

Member Function Documentation

§ iter()

Iterator* leveldb::IteratorWrapper::iter ( ) const
inline

Definition at line 24 of file iterator_wrapper.h.

24 { return iter_; }
Here is the caller graph for this function:

§ key()

Slice leveldb::IteratorWrapper::key ( ) const
inline

Definition at line 41 of file iterator_wrapper.h.

41 { assert(Valid()); return key_; }
Here is the call graph for this function:
Here is the caller graph for this function:

§ Next()

void leveldb::IteratorWrapper::Next ( )
inline

Definition at line 45 of file iterator_wrapper.h.

45 { assert(iter_); iter_->Next(); Update(); }
virtual void Next()=0
Here is the call graph for this function:
Here is the caller graph for this function:

§ Prev()

void leveldb::IteratorWrapper::Prev ( )
inline

Definition at line 46 of file iterator_wrapper.h.

46 { assert(iter_); iter_->Prev(); Update(); }
virtual void Prev()=0
Here is the call graph for this function:
Here is the caller graph for this function:

§ Seek()

void leveldb::IteratorWrapper::Seek ( const Slice k)
inline

Definition at line 47 of file iterator_wrapper.h.

47 { assert(iter_); iter_->Seek(k); Update(); }
virtual void Seek(const Slice &target)=0
Here is the call graph for this function:
Here is the caller graph for this function:

§ SeekToFirst()

void leveldb::IteratorWrapper::SeekToFirst ( )
inline

Definition at line 48 of file iterator_wrapper.h.

48 { assert(iter_); iter_->SeekToFirst(); Update(); }
virtual void SeekToFirst()=0
Here is the call graph for this function:
Here is the caller graph for this function:

§ SeekToLast()

void leveldb::IteratorWrapper::SeekToLast ( )
inline

Definition at line 49 of file iterator_wrapper.h.

49 { assert(iter_); iter_->SeekToLast(); Update(); }
virtual void SeekToLast()=0
Here is the call graph for this function:
Here is the caller graph for this function:

§ Set()

void leveldb::IteratorWrapper::Set ( Iterator iter)
inline

Definition at line 28 of file iterator_wrapper.h.

28  {
29  delete iter_;
30  iter_ = iter;
31  if (iter_ == NULL) {
32  valid_ = false;
33  } else {
34  Update();
35  }
36  }
Iterator * iter() const
Here is the call graph for this function:
Here is the caller graph for this function:

§ status()

Status leveldb::IteratorWrapper::status ( ) const
inline

Definition at line 44 of file iterator_wrapper.h.

44 { assert(iter_); return iter_->status(); }
virtual Status status() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

§ Update()

void leveldb::IteratorWrapper::Update ( )
inlineprivate

Definition at line 52 of file iterator_wrapper.h.

52  {
53  valid_ = iter_->Valid();
54  if (valid_) {
55  key_ = iter_->key();
56  }
57  }
virtual Slice key() const =0
virtual bool Valid() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

§ Valid()

bool leveldb::IteratorWrapper::Valid ( ) const
inline

Definition at line 40 of file iterator_wrapper.h.

40 { return valid_; }
Here is the caller graph for this function:

§ value()

Slice leveldb::IteratorWrapper::value ( ) const
inline

Definition at line 42 of file iterator_wrapper.h.

42 { assert(Valid()); return iter_->value(); }
virtual Slice value() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

§ iter_

Iterator* leveldb::IteratorWrapper::iter_
private

Definition at line 59 of file iterator_wrapper.h.

§ key_

Slice leveldb::IteratorWrapper::key_
private

Definition at line 61 of file iterator_wrapper.h.

§ valid_

bool leveldb::IteratorWrapper::valid_
private

Definition at line 60 of file iterator_wrapper.h.


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