Created
December 27, 2020 21:15
-
-
Save yhirose/466445794e3fc6dafa5d6534a8b3226d to your computer and use it in GitHub Desktop.
RocksDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <rocksdb/db.h> | |
class RocksDB { | |
public: | |
~RocksDB() { delete db_; } | |
rocksdb::Status open(const rocksdb::Options& options, std::string_view path) { | |
assert(!db_); | |
return rocksdb::DB::Open(options, std::string(path), &db_); | |
} | |
rocksdb::DB& db() { return *db_; } | |
private: | |
rocksdb::DB* db_ = nullptr; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment