Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::db::LevelDB Class Reference

#include <LevelDB.h>

Inheritance diagram for dev::db::LevelDB:
dev::db::DatabaseFace

Public Member Functions

 LevelDB (boost::filesystem::path const &_path, leveldb::ReadOptions _readOptions=defaultReadOptions(), leveldb::WriteOptions _writeOptions=defaultWriteOptions(), leveldb::Options _dbOptions=defaultDBOptions())
 
std::string lookup (Slice _key) const override
 
bool exists (Slice _key) const override
 
void insert (Slice _key, Slice _value) override
 
void kill (Slice _key) override
 
std::unique_ptr< WriteBatchFacecreateWriteBatch () const override
 
void commit (std::unique_ptr< WriteBatchFace > _batch) override
 
void forEach (std::function< bool(Slice, Slice)> _f) const override
 
- Public Member Functions inherited from dev::db::DatabaseFace
virtual ~DatabaseFace ()=default
 

Static Public Member Functions

static leveldb::ReadOptions defaultReadOptions ()
 
static leveldb::WriteOptions defaultWriteOptions ()
 
static leveldb::Options defaultDBOptions ()
 

Detailed Description

Definition at line 30 of file LevelDB.h.

Constructor & Destructor Documentation

◆ LevelDB()

dev::db::LevelDB::LevelDB ( boost::filesystem::path const &  _path,
leveldb::ReadOptions  _readOptions = defaultReadOptions(),
leveldb::WriteOptions  _writeOptions = defaultWriteOptions(),
leveldb::Options  _dbOptions = defaultDBOptions() 
)
explicit

Definition at line 103 of file LevelDB.cpp.

Member Function Documentation

◆ commit()

void dev::db::LevelDB::commit ( std::unique_ptr< WriteBatchFace _batch)
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 159 of file LevelDB.cpp.

◆ createWriteBatch()

std::unique_ptr< WriteBatchFace > dev::db::LevelDB::createWriteBatch ( ) const
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 154 of file LevelDB.cpp.

◆ defaultDBOptions()

leveldb::Options dev::db::LevelDB::defaultDBOptions ( )
static

Definition at line 95 of file LevelDB.cpp.

◆ defaultReadOptions()

leveldb::ReadOptions dev::db::LevelDB::defaultReadOptions ( )
static

Definition at line 85 of file LevelDB.cpp.

◆ defaultWriteOptions()

leveldb::WriteOptions dev::db::LevelDB::defaultWriteOptions ( )
static

Definition at line 90 of file LevelDB.cpp.

◆ exists()

bool dev::db::LevelDB::exists ( Slice  _key) const
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 127 of file LevelDB.cpp.

◆ forEach()

void dev::db::LevelDB::forEach ( std::function< bool(Slice, Slice)>  _f) const
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 175 of file LevelDB.cpp.

◆ insert()

void dev::db::LevelDB::insert ( Slice  _key,
Slice  _value 
)
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 139 of file LevelDB.cpp.

◆ kill()

void dev::db::LevelDB::kill ( Slice  _key)
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 147 of file LevelDB.cpp.

◆ lookup()

std::string dev::db::LevelDB::lookup ( Slice  _key) const
overridevirtual

Implements dev::db::DatabaseFace.

Definition at line 115 of file LevelDB.cpp.


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