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

Classes

class  DatabaseFace
 
class  DBFactory
 
struct  DBKindTableEntry
 
class  LevelDB
 
class  MemoryDB
 
class  MemoryDBWriteBatch
 
class  RocksDB
 
class  WriteBatchFace
 

Typedefs

using errinfo_dbStatusCode = boost::error_info< struct tag_dbStatusCode, DatabaseStatus >
 
using errinfo_dbStatusString = boost::error_info< struct tag_dbStatusString, std::string >
 
using Slice = vector_ref< char const >
 

Enumerations

enum  DatabaseStatus {
  DatabaseStatus::Ok, DatabaseStatus::NotFound, DatabaseStatus::Corruption, DatabaseStatus::NotSupported,
  DatabaseStatus::InvalidArgument, DatabaseStatus::IOError, DatabaseStatus::Unknown
}
 
enum  DatabaseKind { DatabaseKind::LevelDB, DatabaseKind::RocksDB, DatabaseKind::MemoryDB }
 

Functions

 DEV_SIMPLE_EXCEPTION (DatabaseError)
 
void setDatabaseKindByName (std::string const &_name)
 
void setDatabaseKind (DatabaseKind _kind)
 
void setDatabasePath (std::string const &_path)
 
bool isDiskDatabase ()
 
DatabaseKind databaseKind ()
 
fs::path databasePath ()
 
po::options_description databaseProgramOptions (unsigned _lineLength)
 

Variables

auto g_kind = DatabaseKind::LevelDB
 
fs::path g_dbPath
 
DBKindTableEntry dbKindsTable []
 

Typedef Documentation

◆ errinfo_dbStatusCode

using dev::db::errinfo_dbStatusCode = typedef boost::error_info<struct tag_dbStatusCode, DatabaseStatus>

Definition at line 86 of file db.h.

◆ errinfo_dbStatusString

using dev::db::errinfo_dbStatusString = typedef boost::error_info<struct tag_dbStatusString, std::string>

Definition at line 87 of file db.h.

◆ Slice

using dev::db::Slice = typedef vector_ref<char const>

Definition at line 26 of file dbfwd.h.

Enumeration Type Documentation

◆ DatabaseKind

enum dev::db::DatabaseKind
strong
Enumerator
LevelDB 
RocksDB 
MemoryDB 

Definition at line 30 of file DBFactory.h.

◆ DatabaseStatus

Enumerator
Ok 
NotFound 
Corruption 
NotSupported 
InvalidArgument 
IOError 
Unknown 

Definition at line 75 of file db.h.

Function Documentation

◆ databaseKind()

DatabaseKind dev::db::databaseKind ( )

Definition at line 92 of file DBFactory.cpp.

◆ databasePath()

boost::filesystem::path dev::db::databasePath ( )

Definition at line 97 of file DBFactory.cpp.

◆ databaseProgramOptions()

boost::program_options::options_description dev::db::databaseProgramOptions ( unsigned  _lineLength = boost::program_options::options_description::m_default_line_length)

Provide a set of program options related to databases

Parameters
_lineLengthThe line length for description text wrapping, the same as in boost::program_options::options_description::options_description().

Definition at line 102 of file DBFactory.cpp.

◆ DEV_SIMPLE_EXCEPTION()

dev::db::DEV_SIMPLE_EXCEPTION ( DatabaseError  )

◆ isDiskDatabase()

bool dev::db::isDiskDatabase ( )

Definition at line 80 of file DBFactory.cpp.

◆ setDatabaseKind()

void dev::db::setDatabaseKind ( DatabaseKind  _kind)

Definition at line 70 of file DBFactory.cpp.

◆ setDatabaseKindByName()

void dev::db::setDatabaseKindByName ( std::string const &  _name)

Definition at line 55 of file DBFactory.cpp.

◆ setDatabasePath()

void dev::db::setDatabasePath ( std::string const &  _path)

Definition at line 75 of file DBFactory.cpp.

Variable Documentation

◆ dbKindsTable

DBKindTableEntry dev::db::dbKindsTable[]
Initial value:
= {
{DatabaseKind::LevelDB, "leveldb"},
{DatabaseKind::RocksDB, "rocksdb"},
{DatabaseKind::MemoryDB, "memorydb"},
}

The table of available DB implementations.

We don't use a map to avoid complex dynamic initialization. This list will never be long, so linear search only to parse command line arguments is not a problem.

Definition at line 49 of file DBFactory.cpp.

◆ g_dbPath

fs::path dev::db::g_dbPath

Definition at line 33 of file DBFactory.cpp.

◆ g_kind

auto dev::db::g_kind = DatabaseKind::LevelDB

Definition at line 32 of file DBFactory.cpp.