leveldb
Public Member Functions | Private Attributes | List of all members
leveldb::Constructor Class Referenceabstract
Inheritance diagram for leveldb::Constructor:
Inheritance graph
[legend]

Public Member Functions

 Constructor (const Comparator *cmp)
 
virtual ~Constructor ()
 
void Add (const std::string &key, const Slice &value)
 
void Finish (const Options &options, std::vector< std::string > *keys, KVMap *kvmap)
 
virtual Status FinishImpl (const Options &options, const KVMap &data)=0
 
virtual IteratorNewIterator () const =0
 
virtual const KVMapdata ()
 
virtual DBdb () const
 

Private Attributes

KVMap data_
 

Detailed Description

Definition at line 141 of file table_test.cc.

Constructor & Destructor Documentation

§ Constructor()

leveldb::Constructor::Constructor ( const Comparator cmp)
inlineexplicit

Definition at line 143 of file table_test.cc.

143 : data_(STLLessThan(cmp)) { }

§ ~Constructor()

virtual leveldb::Constructor::~Constructor ( )
inlinevirtual

Definition at line 144 of file table_test.cc.

144 { }

Member Function Documentation

§ Add()

void leveldb::Constructor::Add ( const std::string &  key,
const Slice value 
)
inline

Definition at line 146 of file table_test.cc.

146  {
147  data_[key] = value.ToString();
148  }
Here is the call graph for this function:
Here is the caller graph for this function:

§ data()

virtual const KVMap& leveldb::Constructor::data ( )
inlinevirtual

Definition at line 173 of file table_test.cc.

173 { return data_; }

§ db()

virtual DB* leveldb::Constructor::db ( ) const
inlinevirtual

Reimplemented in leveldb::DBConstructor.

Definition at line 175 of file table_test.cc.

175 { return NULL; } // Overridden in DBConstructor

§ Finish()

void leveldb::Constructor::Finish ( const Options options,
std::vector< std::string > *  keys,
KVMap kvmap 
)
inline

Definition at line 153 of file table_test.cc.

155  {
156  *kvmap = data_;
157  keys->clear();
158  for (KVMap::const_iterator it = data_.begin();
159  it != data_.end();
160  ++it) {
161  keys->push_back(it->first);
162  }
163  data_.clear();
164  Status s = FinishImpl(options, *kvmap);
165  ASSERT_TRUE(s.ok()) << s.ToString();
166  }
#define ASSERT_TRUE(c)
Definition: testharness.h:105
virtual Status FinishImpl(const Options &options, const KVMap &data)=0
Here is the call graph for this function:
Here is the caller graph for this function:

§ FinishImpl()

virtual Status leveldb::Constructor::FinishImpl ( const Options options,
const KVMap data 
)
pure virtual

§ NewIterator()

virtual Iterator* leveldb::Constructor::NewIterator ( ) const
pure virtual

Member Data Documentation

§ data_

KVMap leveldb::Constructor::data_
private

Definition at line 178 of file table_test.cc.


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