0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-06-02 18:18:56 +02:00

ircd::db: Add txn ctor claiming a rocksdb::WriteBatch.

This commit is contained in:
Jason Volk 2018-03-22 20:48:23 -07:00
parent d40b18633f
commit 2671f4eb90
2 changed files with 10 additions and 2 deletions

View file

@ -21,7 +21,7 @@ namespace ircd::db
std::string debug(const txn &);
}
class ircd::db::txn
struct ircd::db::txn
{
database *d {nullptr};
std::unique_ptr<rocksdb::WriteBatch> wb;
@ -59,6 +59,7 @@ class ircd::db::txn
txn() = default;
txn(database &);
txn(database &, const opts &);
txn(database &, std::unique_ptr<rocksdb::WriteBatch> &&);
~txn() noexcept;
};

View file

@ -2425,7 +2425,7 @@ noexcept
//
ircd::db::txn::txn(database &d)
:txn{d, {}}
:txn{d, opts{}}
{
}
@ -2439,6 +2439,13 @@ ircd::db::txn::txn(database &d,
{
}
ircd::db::txn::txn(database &d,
std::unique_ptr<rocksdb::WriteBatch> &&wb)
:d{&d}
,wb{std::move(wb)}
{
}
ircd::db::txn::~txn()
noexcept
{