Struct mdbx::buffer_pair_spec
template <typename ALLOCATOR, typename CAPACITY_POLICY>
ClassList > mdbx > buffer_pair_spec
A pair of buffer instances for a key and a value, with the same allocator and capacity policy; the buffer counterpart ofpair .
#include <mdbx.h++>
Public Types
| Type | Name |
|---|---|
| typedef typename buffer_type::allocator_traits | allocator_traits The allocator_type traits. |
| typedef typename buffer_type::allocator_type | allocator_type The allocator type of the buffers. |
| typedef buffer< ALLOCATOR, CAPACITY_POLICY > | buffer_type The type of the key/value buffers. |
| typedef CAPACITY_POLICY | reservation_policy The capacity policy type, see default_capacity_policy . |
| typedef ::std::pair< buffer_type, buffer_type > | stl_pair An alias for std::pair< buffer_type , buffer_type > . |
Public Attributes
| Type | Name |
|---|---|
| buffer_type | key The key buffer. |
| buffer_type | value The value buffer. |
Public Functions
| Type | Name |
|---|---|
| constexpr | buffer_pair_spec () noexcept Constructs an empty pair. |
| constexpr | buffer_pair_spec (const allocator_type & alloc) noexcept Constructs an empty pair with the given allocator. |
| buffer_pair_spec (const buffer_type & key, const buffer_type & value, const allocator_type & alloc=allocator_type()) Constructs the pair from the given key and value buffers. |
|
| buffer_pair_spec (const buffer_type & key, const buffer_type & value, bool make_reference, const allocator_type & alloc=allocator_type()) Constructs the pair from the given key and value buffers. |
|
| buffer_pair_spec (const stl_pair & pair, const allocator_type & alloc=allocator_type()) Constructs the pair from a std::pair of buffers. |
|
| buffer_pair_spec (const stl_pair & pair, bool make_reference, const allocator_type & alloc=allocator_type()) Constructs the pair from a std::pair of buffers. |
|
| buffer_pair_spec (const slice & key, const slice & value, const allocator_type & alloc=allocator_type()) Constructs the pair from the given key and value slices. |
|
| buffer_pair_spec (const slice & key, const slice & value, bool make_reference, const allocator_type & alloc=allocator_type()) Constructs the pair from the given key and value slices. |
|
| buffer_pair_spec (const pair & pair, const allocator_type & alloc=allocator_type()) Constructs the pair from the given key-value pair of slices. |
|
| buffer_pair_spec (const pair & pair, bool make_reference, const allocator_type & alloc=allocator_type()) Constructs the pair from the given key-value pair of slices. |
|
| buffer_pair_spec (const txn & transaction, const slice & key, const slice & value, const allocator_type & alloc=allocator_type()) Constructs the pair owning copies of dirty data of the given transaction. |
|
| buffer_pair_spec (const txn & transaction, const pair & pair, const allocator_type & alloc=allocator_type()) Constructs the pair owning copies of dirty data of the given transaction. |
|
| buffer_pair_spec (buffer_type && key, buffer_type && value) Constructs the pair by moving the given buffers. |
|
| buffer_pair_spec (const buffer_pair_spec &) = default Copy constructor. |
|
| buffer_pair_spec (buffer_pair_spec && pair) Move constructor. |
|
| bool | is_freestanding () noexcept const Checks whether data chunk stored inside the buffers both, otherwise at least one of buffers just refers to data located outside. |
| bool | is_reference () noexcept const Checks whether one of the buffers just refers to data located outside the buffer, rather than stores it. |
| void | make_freestanding () Makes buffers owning the data. |
| operator pair () noexcept const Converts to a pair of slices referencing the same data. |
|
| buffer_pair_spec & | operator= (const buffer_pair_spec &) = default Copy assignment operator. |
| buffer_pair_spec & | operator= (buffer_pair_spec && src) Move assignment operator. |
| buffer_pair_spec & | operator= (const pair & src) Assigns from a pair of slices, copying the content. |
| buffer_pair_spec & | operator= (pair && src) Move-assigns from a pair of slices. |
| buffer_pair_spec & | operator= (const stl_pair & src) Assigns from a std::pair of slices, copying the content. |
| buffer_pair_spec & | operator= (stl_pair && src) Move-assigns from a std::pair of slices. |
Public Types Documentation
typedef allocator_traits
The allocator_type traits.
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = typename buffer_type::allocator_traits;
typedef allocator_type
The allocator type of the buffers.
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename buffer_type::allocator_type;
typedef buffer_type
The type of the key/value buffers.
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::buffer_type = buffer<ALLOCATOR, CAPACITY_POLICY>;
typedef reservation_policy
The capacity policy type, see default_capacity_policy .
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY;
typedef stl_pair
An alias for std::pair< buffer_type , buffer_type > .
using mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::stl_pair = ::std::pair<buffer_type, buffer_type>;
Public Attributes Documentation
variable key
The key buffer.
buffer_type mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::key;
variable value
The value buffer.
buffer_type mdbx::buffer_pair_spec< ALLOCATOR, CAPACITY_POLICY >::value;
Public Functions Documentation
function buffer_pair_spec [1/15]
Constructs an empty pair.
constexpr mdbx::buffer_pair_spec::buffer_pair_spec () noexcept
function buffer_pair_spec [2/15]
Constructs an empty pair with the given allocator.
inline constexpr mdbx::buffer_pair_spec::buffer_pair_spec (
const allocator_type & alloc
) noexcept
Parameters:
allocThe allocator for both buffers.
function buffer_pair_spec [3/15]
Constructs the pair from the given key and value buffers.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const buffer_type & key,
const buffer_type & value,
const allocator_type & alloc=allocator_type ()
)
Parameters:
keyThe key buffer.valueThe value buffer.allocThe allocator for both buffers.
function buffer_pair_spec [4/15]
Constructs the pair from the given key and value buffers.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const buffer_type & key,
const buffer_type & value,
bool make_reference,
const allocator_type & alloc=allocator_type ()
)
Parameters:
keyThe key buffer.valueThe value buffer.make_referenceMake the buffers references instead of copies.allocThe allocator for both buffers.
function buffer_pair_spec [5/15]
Constructs the pair from a std::pair of buffers.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const stl_pair & pair,
const allocator_type & alloc=allocator_type ()
)
Parameters:
pairThe sourcestd::pair.allocThe allocator for both buffers.
function buffer_pair_spec [6/15]
Constructs the pair from a std::pair of buffers.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const stl_pair & pair,
bool make_reference,
const allocator_type & alloc=allocator_type ()
)
Parameters:
pairThe sourcestd::pair.make_referenceMake the buffers references instead of copies.allocThe allocator for both buffers.
function buffer_pair_spec [7/15]
Constructs the pair from the given key and value slices.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const slice & key,
const slice & value,
const allocator_type & alloc=allocator_type ()
)
Parameters:
keyThe key slice.valueThe value slice.allocThe allocator for both buffers.
function buffer_pair_spec [8/15]
Constructs the pair from the given key and value slices.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const slice & key,
const slice & value,
bool make_reference,
const allocator_type & alloc=allocator_type ()
)
Parameters:
keyThe key slice.valueThe value slice.make_referenceMake the buffers references instead of copies.allocThe allocator for both buffers.
function buffer_pair_spec [9/15]
Constructs the pair from the given key-value pair of slices.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const pair & pair,
const allocator_type & alloc=allocator_type ()
)
Parameters:
pairThe source pair.allocThe allocator for both buffers.
function buffer_pair_spec [10/15]
Constructs the pair from the given key-value pair of slices.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const pair & pair,
bool make_reference,
const allocator_type & alloc=allocator_type ()
)
Parameters:
pairThe source pair.make_referenceMake the buffers references instead of copies.allocThe allocator for both buffers.
function buffer_pair_spec [11/15]
Constructs the pair owning copies of dirty data of the given transaction.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const txn & transaction,
const slice & key,
const slice & value,
const allocator_type & alloc=allocator_type ()
)
Parameters:
transactionThe transaction to check the data dirtiness against.keyThe key slice.valueThe value slice.allocThe allocator for both buffers.
function buffer_pair_spec [12/15]
Constructs the pair owning copies of dirty data of the given transaction.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
const txn & transaction,
const pair & pair,
const allocator_type & alloc=allocator_type ()
)
Parameters:
transactionThe transaction to check the data dirtiness against.pairThe source pair.allocThe allocator for both buffers.
function buffer_pair_spec [13/15]
Constructs the pair by moving the given buffers.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
buffer_type && key,
buffer_type && value
)
Parameters:
keyThe key buffer to be moved from.valueThe value buffer to be moved from.
function buffer_pair_spec [14/15]
Copy constructor.
mdbx::buffer_pair_spec::buffer_pair_spec (
const buffer_pair_spec &
) = default
function buffer_pair_spec [15/15]
Move constructor.
inline mdbx::buffer_pair_spec::buffer_pair_spec (
buffer_pair_spec && pair
)
Parameters:
pairThe source pair to be moved from.
function is_freestanding
Checks whether data chunk stored inside the buffers both, otherwise at least one of buffers just refers to data located outside.
inline bool mdbx::buffer_pair_spec::is_freestanding () noexcept const
Returns:
true if both buffers own their data.
function is_reference
Checks whether one of the buffers just refers to data located outside the buffer, rather than stores it.
inline bool mdbx::buffer_pair_spec::is_reference () noexcept const
Returns:
true if at least one buffer refers to external data.
function make_freestanding
Makes buffers owning the data.
inline void mdbx::buffer_pair_spec::make_freestanding ()
If buffer refers to an external data, then makes it the owner of clone by allocating storage and copying the data.
function operator pair
Converts to a pair of slices referencing the same data.
inline mdbx::buffer_pair_spec::operator pair () noexcept const
Returns:
The pair of slices.
function operator=
Copy assignment operator.
buffer_pair_spec & mdbx::buffer_pair_spec::operator= (
const buffer_pair_spec &
) = default
Returns:
A reference to this instance.
function operator=
Move assignment operator.
inline buffer_pair_spec & mdbx::buffer_pair_spec::operator= (
buffer_pair_spec && src
)
Parameters:
srcThe source pair to be moved from.
Returns:
A reference to this instance.
function operator=
Assigns from a pair of slices, copying the content.
inline buffer_pair_spec & mdbx::buffer_pair_spec::operator= (
const pair & src
)
Parameters:
srcThe source pair.
Returns:
A reference to this instance.
function operator=
Move-assigns from a pair of slices.
inline buffer_pair_spec & mdbx::buffer_pair_spec::operator= (
pair && src
)
Parameters:
srcThe source pair to be moved from.
Returns:
A reference to this instance.
function operator=
Assigns from a std::pair of slices, copying the content.
inline buffer_pair_spec & mdbx::buffer_pair_spec::operator= (
const stl_pair & src
)
Parameters:
srcThe sourcestd::pair.
Returns:
A reference to this instance.
function operator=
Move-assigns from a std::pair of slices.
inline buffer_pair_spec & mdbx::buffer_pair_spec::operator= (
stl_pair && src
)
Parameters:
srcThe sourcestd::pairto be moved from.
Returns:
A reference to this instance.
The documentation for this class was generated from the following file mdbx.h++