Class mdbx::cache_entry
ClassList > mdbx > cache_entry
Cache entry for the transparent read-your-writes caching, see txn::get_cached() andmdbx_cache_get() .More...
#include <mdbx.h++>
Inherits the following classes: MDBX_cache_entry_t
Public Attributes inherited from MDBX_cache_entry_t
| Type | Name |
|---|---|
| uint64_t | last_confirmed_txnid |
| uint32_t | length |
| size_t | offset |
| uint64_t | trunk_txnid |
Public Functions
| Type | Name |
|---|---|
| cache_entry () noexcept Constructs the entry and initializes it to the "no cached info" state. |
|
| cache_entry (const cache_entry &) noexcept Copy constructor. |
|
| cache_entry (cache_entry && other) noexcept Move constructor: copies the source entry and resets it. |
|
| constexpr | cache_entry (const MDBX_cache_entry_t & ce) noexcept Constructs the entry as a copy of the given C API structure. |
| uint64_t | last_confirmed () noexcept const Returns the recent transaction/MVCC-snapshot ID wherein the entry was checked and confirmed. |
| bool | notfound () noexcept const Returns true if the entry caches the "key not found" state. |
| cache_entry & | operator= (const cache_entry &) noexcept Copy assignment operator. |
| cache_entry & | operator= (const MDBX_cache_entry_t & ce) noexcept Assigns the given C API structure to this entry. |
| void | reset () noexcept Initializes the cache entry to the "no cached info" state. |
| uint64_t | transaction_id () noexcept const Returns the transaction/MVCC-snapshot ID of the internal structure that holds the cached data. |
Detailed Description
A value type wrapping MDBX_cache_entry_t. Each entry is associated with a key and holds a lightweight "version stamp" plus the offset of the cached value inside the memory-mapped database file, so subsequent lookups stop as soon as they reach an unmodified page.
An entry must be initialized (reset()) before the first use. Entries may be placed in shared memory and used by multiple processes, though libmdbx does not provide such interaction management yet.
Public Functions Documentation
function cache_entry [1/4]
Constructs the entry and initializes it to the "no cached info" state.
inline mdbx::cache_entry::cache_entry () noexcept
function cache_entry [2/4]
Copy constructor.
mdbx::cache_entry::cache_entry (
const cache_entry &
) noexcept
function cache_entry [3/4]
Move constructor: copies the source entry and resets it.
inline mdbx::cache_entry::cache_entry (
cache_entry && other
) noexcept
Parameters:
otherThe source entry to be moved from.
function cache_entry [4/4]
Constructs the entry as a copy of the given C API structure.
inline constexpr mdbx::cache_entry::cache_entry (
const MDBX_cache_entry_t & ce
) noexcept
Parameters:
ceThe source MDBX_cache_entry_t instance.
function last_confirmed
Returns the recent transaction/MVCC-snapshot ID wherein the entry was checked and confirmed.
inline uint64_t mdbx::cache_entry::last_confirmed () noexcept const
Returns:
The transaction ID of the last confirmation.
function notfound
Returns true if the entry caches the "key not found" state.
inline bool mdbx::cache_entry::notfound () noexcept const
Returns:
true if the entry caches the "not found" state.
function operator=
Copy assignment operator.
cache_entry & mdbx::cache_entry::operator= (
const cache_entry &
) noexcept
Returns:
A reference to this instance.
function operator=
Assigns the given C API structure to this entry.
inline cache_entry & mdbx::cache_entry::operator= (
const MDBX_cache_entry_t & ce
) noexcept
Parameters:
ceThe source MDBX_cache_entry_t instance.
Returns:
A reference to this instance.
function reset
Initializes the cache entry to the "no cached info" state.
inline void mdbx::cache_entry::reset () noexcept
function transaction_id
Returns the transaction/MVCC-snapshot ID of the internal structure that holds the cached data.
inline uint64_t mdbx::cache_entry::transaction_id () noexcept const
Returns:
The transaction ID of the internal structure.
Friends Documentation
friend operator!=
inline bool mdbx::cache_entry::operator!= (
const cache_entry & a,
const cache_entry & b
) noexcept
friend operator==
inline bool mdbx::cache_entry::operator== (
const cache_entry & a,
const cache_entry & b
) noexcept
The documentation for this class was generated from the following file mdbx.h++