38 auto const& it = m_db.find(_key.
toString());
44 bool MemoryDB::exists(
Slice _key)
const 47 return m_db.count(_key.
toString()) != 0;
62 std::unique_ptr<WriteBatchFace> MemoryDB::createWriteBatch()
const 71 BOOST_THROW_EXCEPTION(DatabaseError() <<
errinfo_comment(
"Cannot commit null batch"));
77 BOOST_THROW_EXCEPTION(
78 DatabaseError() <<
errinfo_comment(
"Invalid batch type passed to MemoryDB::commit"));
80 auto const& batch = batchPtr->writeBatch();
84 m_db[e.first] = e.second;
92 void MemoryDB::forEach(std::function<
bool(
Slice,
Slice)> _f)
const 95 for (
auto const& e : m_db)
void kill(Slice _key) override
std::lock_guard< std::mutex > Guard
std::string lookup(Slice _key) const override
boost::error_info< struct tag_comment, std::string > errinfo_comment
std::string toString() const
AddressHash commit(AccountMap const &_cache, SecureTrieDB< Address, DB > &_state)
void insert(Slice _key, Slice _value) override
vector_ref< char const > Slice