An abstract class for accessing a database of key-value pairs. More...
#include <db.h>
Public Member Functions | |
DB (const string &, Mode mode) | |
virtual void | Close ()=0 |
Closes the database. | |
virtual std::unique_ptr< Cursor > | NewCursor ()=0 |
Returns a cursor to read the database. More... | |
virtual std::unique_ptr< Transaction > | NewTransaction ()=0 |
Returns a transaction to write data to the database. More... | |
Protected Member Functions | |
C10_DISABLE_COPY_AND_ASSIGN (DB) | |
Protected Attributes | |
Mode | mode_ |
|
pure virtual |
Returns a cursor to read the database.
The caller takes the ownership of the pointer.
Implemented in caffe2::db::MiniDB, caffe2::db::LMDB, caffe2::db::BlobsQueueDB, caffe2::db::RocksDB, caffe2::db::ZmqDB, caffe2::db::ProtoDB, and caffe2::db::LevelDB.
|
pure virtual |
Returns a transaction to write data to the database.
The caller takes the ownership of the pointer.
Implemented in caffe2::db::MiniDB, caffe2::db::LMDB, caffe2::db::BlobsQueueDB, caffe2::db::RocksDB, caffe2::db::ZmqDB, caffe2::db::ProtoDB, and caffe2::db::LevelDB.