libmdbx  0.11.6.39 (2022-04-13T11:05:50+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > Class Template Reference

The chunk of data stored inside the buffer or located outside it. More...

#include <mdbx.h++>

Public Types

enum  : size_t { max_length = MDBX_MAXDATASIZE, max_capacity = (max_length / 3u * 4u + 1023u) & ~size_t(1023), extra_inplace_storage = reservation_policy::extra_inplace_storage, pettiness_threshold = reservation_policy::pettiness_threshold }
 
using allocator_type = typename ::std::allocator_traits< ALLOCATOR >::template rebind_alloc< uint64_t >
 
using allocator_traits = ::std::allocator_traits< allocator_type >
 
using reservation_policy = CAPACITY_POLICY
 

Public Member Functions

MDBX_CXX20_CONSTEXPR allocator_type get_allocator () const
 Returns the associated allocator. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR bool is_freestanding () const noexcept
 Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR bool is_reference () const noexcept
 Checks whether the buffer just refers to data located outside the buffer, rather than stores it. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t capacity () const noexcept
 Returns the number of bytes that can be held in currently allocated storage. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t headroom () const noexcept
 Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t tailroom () const noexcept
 Returns the number of bytes that available in currently allocated storage after the currently data end. More...
 
const MDBX_CXX11_CONSTEXPR bytebyte_ptr () const noexcept
 Returns casted to const pointer to byte an address of data. More...
 
const MDBX_CXX11_CONSTEXPR byteend_byte_ptr () const noexcept
 Returns casted to const pointer to byte an end of data. More...
 
MDBX_CXX11_CONSTEXPR bytebyte_ptr () noexcept
 Returns casted to pointer to byte an address of data. More...
 
MDBX_CXX11_CONSTEXPR byteend_byte_ptr () noexcept
 Returns casted to pointer to byte an end of data. More...
 
const MDBX_CXX11_CONSTEXPR char * char_ptr () const noexcept
 Returns casted to const pointer to char an address of data. More...
 
const MDBX_CXX11_CONSTEXPR char * end_char_ptr () const noexcept
 Returns casted to const pointer to char an end of data. More...
 
MDBX_CXX11_CONSTEXPR char * char_ptr () noexcept
 Returns casted to pointer to char an address of data. More...
 
MDBX_CXX11_CONSTEXPR char * end_char_ptr () noexcept
 Returns casted to pointer to char an end of data. More...
 
const MDBX_CXX11_CONSTEXPR void * data () const noexcept
 Return a const pointer to the beginning of the referenced data. More...
 
const MDBX_CXX11_CONSTEXPR void * end () const noexcept
 Return a const pointer to the end of the referenced data. More...
 
MDBX_CXX11_CONSTEXPR void * data () noexcept
 Return a pointer to the beginning of the referenced data. More...
 
MDBX_CXX11_CONSTEXPR void * end () noexcept
 Return a pointer to the end of the referenced data. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t length () const noexcept
 Returns the number of bytes. More...
 
MDBX_CXX14_CONSTEXPR bufferset_length (size_t bytes)
 Set length of data. More...
 
MDBX_CXX14_CONSTEXPR bufferset_end (const void *ptr)
 Sets the length by specifying the end of the data. More...
 
void make_freestanding ()
 Makes buffer owning the data. More...
 
MDBX_CXX20_CONSTEXPR buffer () noexcept=default
 
MDBX_CXX20_CONSTEXPR buffer (const allocator_type &allocator) noexcept
 
 buffer (const struct slice &src, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer (const buffer &src, bool make_reference, const allocator_type &allocator=allocator_type())
 
 buffer (const void *ptr, size_t bytes, bool make_reference, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T , class A >
 buffer (const ::std::basic_string< CHAR, T, A > &)=delete
 
template<class CHAR , class T , class A >
 buffer (const ::std::basic_string< CHAR, T, A > &&)=delete
 
 buffer (const char *c_str, bool make_reference, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T >
 buffer (const ::std::basic_string_view< CHAR, T > &view, bool make_reference, const allocator_type &allocator=allocator_type())
 
MDBX_CXX20_CONSTEXPR buffer (const struct slice &src, const allocator_type &allocator=allocator_type())
 
MDBX_CXX20_CONSTEXPR buffer (const buffer &src, const allocator_type &allocator=allocator_type())
 
MDBX_CXX20_CONSTEXPR buffer (const void *ptr, size_t bytes, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T , class A >
MDBX_CXX20_CONSTEXPR buffer (const ::std::basic_string< CHAR, T, A > &str, const allocator_type &allocator=allocator_type())
 
MDBX_CXX20_CONSTEXPR buffer (const char *c_str, const allocator_type &allocator=allocator_type())
 
template<class CHAR , class T >
MDBX_CXX20_CONSTEXPR buffer (const ::std::basic_string_view< CHAR, T > &view, const allocator_type &allocator=allocator_type())
 
 buffer (size_t head_room, size_t tail_room, const allocator_type &allocator=allocator_type())
 
 buffer (size_t capacity, const allocator_type &allocator=allocator_type())
 
 buffer (size_t head_room, const struct slice &src, size_t tail_room, const allocator_type &allocator=allocator_type())
 
 buffer (size_t head_room, const buffer &src, size_t tail_room, const allocator_type &allocator=allocator_type())
 
 buffer (const ::mdbx::txn &txn, const struct slice &src, const allocator_type &allocator=allocator_type())
 
 buffer (buffer &&src) noexcept(move_assign_alloc::is_nothrow())
 
MDBX_CXX11_CONSTEXPR const struct sliceslice () const noexcept
 
MDBX_CXX11_CONSTEXPR operator const struct slice & () const noexcept
 
void reserve (size_t wanna_headroom, size_t wanna_tailroom)
 Reserves storage space. More...
 
void reserve_headroom (size_t wanna_headroom)
 Reserves space before the payload. More...
 
void reserve_tailroom (size_t wanna_tailroom)
 Reserves space after the payload. More...
 
bufferassign_reference (const void *ptr, size_t bytes)
 
bufferassign_freestanding (const void *ptr, size_t bytes)
 
MDBX_CXX20_CONSTEXPR void swap (buffer &other) noexcept(swap_alloc::is_nothrow())
 
bufferassign (const buffer &src, bool make_reference=false)
 
bufferassign (const void *ptr, size_t bytes, bool make_reference=false)
 
bufferassign (const struct slice &src, bool make_reference=false)
 
bufferassign (const ::MDBX_val &src, bool make_reference=false)
 
bufferassign (struct slice &&src, bool make_reference=false)
 
bufferassign (::MDBX_val &&src, bool make_reference=false)
 
bufferassign (const void *begin, const void *end, bool make_reference=false)
 
template<class CHAR , class T , class A >
bufferassign (const ::std::basic_string< CHAR, T, A > &str, bool make_reference=false)
 
bufferassign (const char *c_str, bool make_reference=false)
 
bufferoperator= (const buffer &src)
 
bufferoperator= (buffer &&src) noexcept(move_assign_alloc::is_nothrow())
 
bufferoperator= (const struct slice &src)
 
bufferoperator= (struct slice &&src)
 
template<class CHAR , class T >
bufferoperator= (const ::std::basic_string_view< CHAR, T > &view) noexcept
 
template<class CHAR = char, class T = ::std::char_traits<CHAR>>
::std::basic_string_view< CHAR, T > string_view () const noexcept
 Return a string_view that references the data of this buffer. More...
 
template<class CHAR , class T >
 operator::std::basic_string_view () const noexcept
 Return a string_view that references the data of this buffer. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR bool empty () const noexcept
 Checks whether the string is empty. More...
 
MDBX_CXX11_CONSTEXPR bool is_null () const noexcept
 Checks whether the data pointer of the buffer is nullptr. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t size () const noexcept
 Returns the number of bytes. More...
 
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t hash_value () const noexcept
 Returns the hash value of the data. More...
 
template<class CHAR = char, class T = ::std::char_traits<CHAR>, class A = legacy_allocator>
MDBX_CXX20_CONSTEXPR ::std::basic_string< CHAR, T, A > as_string (const A &allocator=A()) const
 
template<class CHAR , class T , class A >
MDBX_CXX20_CONSTEXPR operator::std::basic_string () const
 
MDBX_NOTHROW_PURE_FUNCTION bool starts_with (const struct slice &prefix) const noexcept
 Checks if the data starts with the given prefix. More...
 
MDBX_NOTHROW_PURE_FUNCTION bool ends_with (const struct slice &suffix) const noexcept
 Checks if the data ends with the given suffix. More...
 
void clear () noexcept
 Clears the contents and storage. More...
 
void shrink_to_fit ()
 Reduces memory usage by freeing unused storage space. More...
 
void remove_prefix (size_t n) noexcept
 Drops the first "n" bytes from the data chunk. More...
 
void remove_suffix (size_t n) noexcept
 Drops the last "n" bytes from the data chunk. More...
 
void safe_remove_prefix (size_t n)
 Drops the first "n" bytes from the data chunk. More...
 
void safe_remove_suffix (size_t n)
 Drops the last "n" bytes from the data chunk. More...
 
MDBX_CXX11_CONSTEXPR byte operator[] (size_t n) const noexcept
 Accesses the specified byte of data chunk. More...
 
MDBX_CXX11_CONSTEXPR byteoperator[] (size_t n) noexcept
 Accesses the specified byte of data chunk. More...
 
MDBX_CXX14_CONSTEXPR byte at (size_t n) const
 Accesses the specified byte of data chunk with bounds checking. More...
 
MDBX_CXX14_CONSTEXPR byteat (size_t n)
 Accesses the specified byte of data chunk with bounds checking. More...
 
MDBX_CXX14_CONSTEXPR struct slice head (size_t n) const noexcept
 Returns the first "n" bytes of the data chunk. More...
 
MDBX_CXX14_CONSTEXPR struct slice tail (size_t n) const noexcept
 Returns the last "n" bytes of the data chunk. More...
 
MDBX_CXX14_CONSTEXPR struct slice middle (size_t from, size_t n) const noexcept
 Returns the middle "n" bytes of the data chunk. More...
 
MDBX_CXX14_CONSTEXPR struct slice safe_head (size_t n) const
 Returns the first "n" bytes of the data chunk. More...
 
MDBX_CXX14_CONSTEXPR struct slice safe_tail (size_t n) const
 Returns the last "n" bytes of the data chunk. More...
 
MDBX_CXX14_CONSTEXPR struct slice safe_middle (size_t from, size_t n) const
 Returns the middle "n" bytes of the data chunk. More...
 
bufferappend (const void *src, size_t bytes)
 
bufferappend (const struct slice &chunk)
 
bufferadd_header (const void *src, size_t bytes)
 
bufferadd_header (const struct slice &chunk)
 
template<MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER) >
bufferappend_producer (PRODUCER &producer)
 
template<MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER) >
bufferappend_producer (const PRODUCER &producer)
 
bufferappend_hex (const struct slice &data, bool uppercase=false, unsigned wrap_width=0)
 
bufferappend_base58 (const struct slice &data, unsigned wrap_width=0)
 
bufferappend_base64 (const struct slice &data, unsigned wrap_width=0)
 
bufferappend_decoded_hex (const struct slice &data, bool ignore_spaces=false)
 
bufferappend_decoded_base58 (const struct slice &data, bool ignore_spaces=false)
 
bufferappend_decoded_base64 (const struct slice &data, bool ignore_spaces=false)
 
template<class ALLOCATOR , typename CAPACITY_POLICY >
 buffer (const txn &txn, const struct slice &src, const allocator_type &allocator)
 

Static Public Member Functions

template<typename POD >
static buffer wrap (const POD &pod, bool make_reference=false, const allocator_type &allocator=allocator_type())
 
static buffer clone (const buffer &src, const allocator_type &allocator=allocator_type())
 
template<size_t SIZE>
static buffer key_from (const char(&text)[SIZE], bool make_reference=true)
 
template<class CHAR , class T >
static buffer key_from (const ::std::basic_string_view< CHAR, T > &src, bool make_reference=false)
 
static buffer key_from (const char *src, bool make_reference=false)
 
template<class CHAR , class T , class A >
static buffer key_from (const ::std::basic_string< CHAR, T, A > &src, bool make_reference=false)
 
static buffer key_from (const silo &&src) noexcept
 
static buffer key_from (const double ieee754_64bit)
 
static buffer key_from (const double *ieee754_64bit)
 
static buffer key_from (const uint64_t unsigned_int64)
 
static buffer key_from (const int64_t signed_int64)
 
static buffer key_from_jsonInteger (const int64_t json_integer)
 
static buffer key_from (const float ieee754_32bit)
 
static buffer key_from (const float *ieee754_32bit)
 
static buffer key_from (const uint32_t unsigned_int32)
 
static buffer key_from (const int32_t signed_int32)
 

Friends

class txn
 

Detailed Description

template<class ALLOCATOR, typename CAPACITY_POLICY>
class mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >

The chunk of data stored inside the buffer or located outside it.

Member Typedef Documentation

◆ allocator_traits

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = ::std::allocator_traits<allocator_type>

◆ allocator_type

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename ::std::allocator_traits< ALLOCATOR>::template rebind_alloc<uint64_t>

◆ reservation_policy

template<class ALLOCATOR , typename CAPACITY_POLICY >
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY

Member Enumeration Documentation

◆ anonymous enum

template<class ALLOCATOR , typename CAPACITY_POLICY >
anonymous enum : size_t
Enumerator
max_length 
max_capacity 
extra_inplace_storage 
pettiness_threshold 

Constructor & Destructor Documentation

◆ buffer() [1/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( )
defaultnoexcept

◆ buffer() [2/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const allocator_type allocator)
inlinenoexcept

◆ buffer() [3/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const struct slice src,
bool  make_reference,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [4/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const buffer< ALLOCATOR, CAPACITY_POLICY > &  src,
bool  make_reference,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [5/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const void *  ptr,
size_t  bytes,
bool  make_reference,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [6/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string< CHAR, T, A > &  )
delete

◆ buffer() [7/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string< CHAR, T, A > &&  )
delete

◆ buffer() [8/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const char *  c_str,
bool  make_reference,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [9/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string_view< CHAR, T > &  view,
bool  make_reference,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [10/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const struct slice src,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [11/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const buffer< ALLOCATOR, CAPACITY_POLICY > &  src,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [12/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const void *  ptr,
size_t  bytes,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [13/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string< CHAR, T, A > &  str,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [14/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const char *  c_str,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [15/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::std::basic_string_view< CHAR, T > &  view,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [16/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t  head_room,
size_t  tail_room,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [17/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t  capacity,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [18/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t  head_room,
const struct slice src,
size_t  tail_room,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [19/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( size_t  head_room,
const buffer< ALLOCATOR, CAPACITY_POLICY > &  src,
size_t  tail_room,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [20/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const ::mdbx::txn txn,
const struct slice src,
const allocator_type allocator = allocator_type() 
)
inline

◆ buffer() [21/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( buffer< ALLOCATOR, CAPACITY_POLICY > &&  src)
inlinenoexcept

◆ buffer() [22/22]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class ALLOCATOR , typename CAPACITY_POLICY >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer ( const txn txn,
const struct slice src,
const allocator_type allocator 
)
inline

Member Function Documentation

◆ add_header() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::add_header ( const struct slice chunk)
inline

◆ add_header() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::add_header ( const void *  src,
size_t  bytes 
)
inline

◆ append() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append ( const struct slice chunk)
inline

◆ append() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append ( const void *  src,
size_t  bytes 
)
inline

◆ append_base58()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_base58 ( const struct slice data,
unsigned  wrap_width = 0 
)
inline

◆ append_base64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_base64 ( const struct slice data,
unsigned  wrap_width = 0 
)
inline

◆ append_decoded_base58()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_decoded_base58 ( const struct slice data,
bool  ignore_spaces = false 
)
inline

◆ append_decoded_base64()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_decoded_base64 ( const struct slice data,
bool  ignore_spaces = false 
)
inline

◆ append_decoded_hex()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_decoded_hex ( const struct slice data,
bool  ignore_spaces = false 
)
inline

◆ append_hex()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_hex ( const struct slice data,
bool  uppercase = false,
unsigned  wrap_width = 0 
)
inline

◆ append_producer() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER) >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_producer ( const PRODUCER &  producer)
inline

◆ append_producer() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER) >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::append_producer ( PRODUCER &  producer)
inline

◆ as_string()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR = char, class T = ::std::char_traits<CHAR>, class A = legacy_allocator>
MDBX_CXX20_CONSTEXPR ::std::basic_string<CHAR, T, A> mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::as_string ( const A &  allocator = A()) const
inline

◆ assign() [1/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( ::MDBX_val &&  src,
bool  make_reference = false 
)
inline

◆ assign() [2/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const ::MDBX_val src,
bool  make_reference = false 
)
inline

◆ assign() [3/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const ::std::basic_string< CHAR, T, A > &  str,
bool  make_reference = false 
)
inline

◆ assign() [4/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const buffer< ALLOCATOR, CAPACITY_POLICY > &  src,
bool  make_reference = false 
)
inline

◆ assign() [5/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const char *  c_str,
bool  make_reference = false 
)
inline

◆ assign() [6/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const struct slice src,
bool  make_reference = false 
)
inline

◆ assign() [7/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const void *  begin,
const void *  end,
bool  make_reference = false 
)
inline

◆ assign() [8/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( const void *  ptr,
size_t  bytes,
bool  make_reference = false 
)
inline

◆ assign() [9/9]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign ( struct slice &&  src,
bool  make_reference = false 
)
inline

◆ assign_freestanding()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign_freestanding ( const void *  ptr,
size_t  bytes 
)
inline

◆ assign_reference()

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::assign_reference ( const void *  ptr,
size_t  bytes 
)
inline

◆ at() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR byte& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::at ( size_t  n)
inline

Accesses the specified byte of data chunk with bounds checking.

Exceptions
std::out_of_rangeif n >= size()

◆ at() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR byte mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::at ( size_t  n) const
inline

Accesses the specified byte of data chunk with bounds checking.

Exceptions
std::out_of_rangeif n >= size()

◆ byte_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const MDBX_CXX11_CONSTEXPR byte* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::byte_ptr ( ) const
inlinenoexcept

Returns casted to const pointer to byte an address of data.

◆ byte_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR byte* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::byte_ptr ( )
inlinenoexcept

Returns casted to pointer to byte an address of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ capacity()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::capacity ( ) const
inlinenoexcept

Returns the number of bytes that can be held in currently allocated storage.

◆ char_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const MDBX_CXX11_CONSTEXPR char* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::char_ptr ( ) const
inlinenoexcept

Returns casted to const pointer to char an address of data.

◆ char_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR char* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::char_ptr ( )
inlinenoexcept

Returns casted to pointer to char an address of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ clear()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::clear ( )
inlinenoexcept

Clears the contents and storage.

◆ clone()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::clone ( const buffer< ALLOCATOR, CAPACITY_POLICY > &  src,
const allocator_type allocator = allocator_type() 
)
inlinestatic

◆ data() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const MDBX_CXX11_CONSTEXPR void* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::data ( ) const
inlinenoexcept

Return a const pointer to the beginning of the referenced data.

◆ data() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR void* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::data ( )
inlinenoexcept

Return a pointer to the beginning of the referenced data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ empty()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::empty ( ) const
inlinenoexcept

Checks whether the string is empty.

◆ end() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const MDBX_CXX11_CONSTEXPR void* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end ( ) const
inlinenoexcept

Return a const pointer to the end of the referenced data.

◆ end() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR void* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end ( )
inlinenoexcept

Return a pointer to the end of the referenced data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ end_byte_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const MDBX_CXX11_CONSTEXPR byte* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_byte_ptr ( ) const
inlinenoexcept

Returns casted to const pointer to byte an end of data.

◆ end_byte_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR byte* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_byte_ptr ( )
inlinenoexcept

Returns casted to pointer to byte an end of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ end_char_ptr() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
const MDBX_CXX11_CONSTEXPR char* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_char_ptr ( ) const
inlinenoexcept

Returns casted to const pointer to char an end of data.

◆ end_char_ptr() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR char* mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::end_char_ptr ( )
inlinenoexcept

Returns casted to pointer to char an end of data.

Precondition
REQUIRES: The buffer should store data chunk, but not referenced to an external one.

◆ ends_with()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::ends_with ( const struct slice suffix) const
inlinenoexcept

Checks if the data ends with the given suffix.

◆ get_allocator()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR allocator_type mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::get_allocator ( ) const
inline

Returns the associated allocator.

◆ hash_value()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::hash_value ( ) const
inlinenoexcept

Returns the hash value of the data.

Attention
Function implementation and returned hash values may changed version to version, and in future the t1ha3 will be used here. Therefore values obtained from this function shouldn't be persisted anywhere.

◆ head()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::head ( size_t  n) const
inlinenoexcept

Returns the first "n" bytes of the data chunk.

Precondition
REQUIRES: n <= size()

◆ headroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::headroom ( ) const
inlinenoexcept

Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data.

◆ is_freestanding()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::is_freestanding ( ) const
inlinenoexcept

Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer.

◆ is_null()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::is_null ( ) const
inlinenoexcept

Checks whether the data pointer of the buffer is nullptr.

◆ is_reference()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::is_reference ( ) const
inlinenoexcept

Checks whether the buffer just refers to data located outside the buffer, rather than stores it.

◆ key_from() [1/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const ::std::basic_string< CHAR, T, A > &  src,
bool  make_reference = false 
)
inlinestatic

◆ key_from() [2/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const ::std::basic_string_view< CHAR, T > &  src,
bool  make_reference = false 
)
inlinestatic

◆ key_from() [3/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const char *  src,
bool  make_reference = false 
)
inlinestatic

◆ key_from() [4/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<size_t SIZE>
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const char(&)  text[SIZE],
bool  make_reference = true 
)
inlinestatic

◆ key_from() [5/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const double *  ieee754_64bit)
inlinestatic

◆ key_from() [6/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const double  ieee754_64bit)
inlinestatic

◆ key_from() [7/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const float *  ieee754_32bit)
inlinestatic

◆ key_from() [8/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const float  ieee754_32bit)
inlinestatic

◆ key_from() [9/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const int32_t  signed_int32)
inlinestatic

◆ key_from() [10/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const int64_t  signed_int64)
inlinestatic

◆ key_from() [11/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const silo &&  src)
inlinestaticnoexcept

◆ key_from() [12/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const uint32_t  unsigned_int32)
inlinestatic

◆ key_from() [13/13]

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from ( const uint64_t  unsigned_int64)
inlinestatic

◆ key_from_jsonInteger()

template<class ALLOCATOR , typename CAPACITY_POLICY >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::key_from_jsonInteger ( const int64_t  json_integer)
inlinestatic

◆ length()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::length ( ) const
inlinenoexcept

Returns the number of bytes.

◆ make_freestanding()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::make_freestanding ( )
inline

Makes buffer owning the data.

If buffer refers to an external data, then makes it the owner of clone by allocating storage and copying the data.

◆ middle()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::middle ( size_t  from,
size_t  n 
) const
inlinenoexcept

Returns the middle "n" bytes of the data chunk.

Precondition
REQUIRES: from + n <= size()

◆ operator const struct slice &()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator const struct slice & ( ) const
inlinenoexcept

◆ operator::std::basic_string()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T , class A >
MDBX_CXX20_CONSTEXPR mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator::std::basic_string ( ) const
inlineexplicit

◆ operator::std::basic_string_view()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator::std::basic_string_view ( ) const
inlinenoexcept

Return a string_view that references the data of this buffer.

◆ operator=() [1/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( buffer< ALLOCATOR, CAPACITY_POLICY > &&  src)
inlinenoexcept

◆ operator=() [2/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR , class T >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( const ::std::basic_string_view< CHAR, T > &  view)
inlinenoexcept

◆ operator=() [3/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( const buffer< ALLOCATOR, CAPACITY_POLICY > &  src)
inline

◆ operator=() [4/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( const struct slice src)
inline

◆ operator=() [5/5]

template<class ALLOCATOR , typename CAPACITY_POLICY >
buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator= ( struct slice &&  src)
inline

◆ operator[]() [1/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR byte mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator[] ( size_t  n) const
inlinenoexcept

Accesses the specified byte of data chunk.

Precondition
REQUIRES: n < size()

◆ operator[]() [2/2]

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR byte& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::operator[] ( size_t  n)
inlinenoexcept

Accesses the specified byte of data chunk.

Precondition
REQUIRES: n < size()

◆ remove_prefix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::remove_prefix ( size_t  n)
inlinenoexcept

Drops the first "n" bytes from the data chunk.

Precondition
REQUIRES: n <= size()

◆ remove_suffix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::remove_suffix ( size_t  n)
inlinenoexcept

Drops the last "n" bytes from the data chunk.

Precondition
REQUIRES: n <= size()

◆ reserve()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reserve ( size_t  wanna_headroom,
size_t  wanna_tailroom 
)
inline

Reserves storage space.

◆ reserve_headroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reserve_headroom ( size_t  wanna_headroom)
inline

Reserves space before the payload.

◆ reserve_tailroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reserve_tailroom ( size_t  wanna_tailroom)
inline

Reserves space after the payload.

◆ safe_head()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_head ( size_t  n) const
inline

Returns the first "n" bytes of the data chunk.

Exceptions
std::out_of_rangeif n >= size()

◆ safe_middle()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_middle ( size_t  from,
size_t  n 
) const
inline

Returns the middle "n" bytes of the data chunk.

Exceptions
std::out_of_rangeif from + n >= size()

◆ safe_remove_prefix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_remove_prefix ( size_t  n)
inline

Drops the first "n" bytes from the data chunk.

Exceptions
std::out_of_rangeif n > size()

◆ safe_remove_suffix()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_remove_suffix ( size_t  n)
inline

Drops the last "n" bytes from the data chunk.

Exceptions
std::out_of_rangeif n > size()

◆ safe_tail()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::safe_tail ( size_t  n) const
inline

Returns the last "n" bytes of the data chunk.

Exceptions
std::out_of_rangeif n >= size()

◆ set_end()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::set_end ( const void *  ptr)
inline

Sets the length by specifying the end of the data.

◆ set_length()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR buffer& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::set_length ( size_t  bytes)
inline

Set length of data.

◆ shrink_to_fit()

template<class ALLOCATOR , typename CAPACITY_POLICY >
void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::shrink_to_fit ( )
inline

Reduces memory usage by freeing unused storage space.

◆ size()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::size ( ) const
inlinenoexcept

Returns the number of bytes.

◆ slice()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX11_CONSTEXPR const struct slice& mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::slice ( ) const
inlinenoexcept

◆ starts_with()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION bool mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::starts_with ( const struct slice prefix) const
inlinenoexcept

Checks if the data starts with the given prefix.

◆ string_view()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<class CHAR = char, class T = ::std::char_traits<CHAR>>
::std::basic_string_view<CHAR, T> mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::string_view ( ) const
inlinenoexcept

Return a string_view that references the data of this buffer.

◆ swap()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX20_CONSTEXPR void mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::swap ( buffer< ALLOCATOR, CAPACITY_POLICY > &  other)
inlinenoexcept

◆ tail()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_CXX14_CONSTEXPR struct slice mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::tail ( size_t  n) const
inlinenoexcept

Returns the last "n" bytes of the data chunk.

Precondition
REQUIRES: n <= size()

◆ tailroom()

template<class ALLOCATOR , typename CAPACITY_POLICY >
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX20_CONSTEXPR size_t mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::tailroom ( ) const
inlinenoexcept

Returns the number of bytes that available in currently allocated storage after the currently data end.

◆ wrap()

template<class ALLOCATOR , typename CAPACITY_POLICY >
template<typename POD >
static buffer mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::wrap ( const POD &  pod,
bool  make_reference = false,
const allocator_type allocator = allocator_type() 
)
inlinestatic

Friends And Related Function Documentation

◆ txn

template<class ALLOCATOR , typename CAPACITY_POLICY >
friend class txn
friend

The documentation for this class was generated from the following file: