![]() |
MDBX Containers
|
Classes | |
| class | AnyValueTable |
| Table storing values of arbitrary type associated with a key. More... | |
| class | BaseTable |
| Base class providing common functionality for MDBX database access. More... | |
| class | Config |
| Parameters used by Connection to create the MDBX environment. More... | |
| class | Connection |
| Manages a single MDBX environment and an optional read-only transaction. More... | |
| struct | has_from_bytes |
Trait to check if a type provides a static from_bytes() method. More... | |
| struct | has_to_bytes |
Trait to check if a type provides a to_bytes() member. More... | |
| struct | has_value_type |
Trait indicating that a container defines value_type. More... | |
| class | KeyMultiValueTable |
| Multi-value table (duplicate keys allowed) persisted in MDBX. More... | |
| class | KeyTable |
| Ordered key->value table persisted in MDBX. More... | |
| class | KeyValueTable |
| Template class for managing key-value pairs in an MDBX database. More... | |
| class | MdbxException |
| Represents a specific exception for MDBX-related errors. More... | |
| struct | PathComponents |
| Structure to hold the root and components of a path. More... | |
| class | SerializeScratch |
Per-call scratch buffer to produce MDBX_val without using thread_local. More... | |
| class | Transaction |
| Manages MDBX transactions with automatic cleanup and error handling. More... | |
| class | TransactionTracker |
| Associates MDBX transactions with threads. More... | |
Enumerations | |
| enum class | TransactionMode { READ_ONLY , WRITABLE } |
| Specifies the access mode of a transaction. More... | |
Functions | |
| bool | is_explicitly_relative (const std::string &s) noexcept |
| Check if path starts with explicit relative prefix. | |
| bool | is_absolute_path (const std::string &path) |
| Checks whether the given path is absolute (cross-platform). | |
| std::string | get_parent_path (const std::string &file_path) |
| Extracts the parent directory from a full file path. | |
| std::string | get_exec_dir () |
| Retrieves the directory of the executable file. | |
| std::string | get_file_name (const std::string &file_path) |
| Extracts the file name from a full file path. | |
| std::string | utf8_to_ansi (const std::string &utf8) noexcept |
| Converts a UTF-8 string to an ANSI string (Windows-specific). | |
| bool | is_path_sep (char c) |
| Check if character is a path separator. | |
| std::string | lexically_normal_compat (const std::string &in) |
| Normalize path removing '. | |
| PathComponents | split_path (const std::string &path) |
| Splits a path into its root and components. | |
| void | create_directories (const std::string &path) |
| Creates directories recursively for the given path. | |
| void | check_mdbx (int rc, const std::string &context) |
| Throws an MdbxException if MDBX return code indicates an error. | |
| uint32_t | sortable_key_from_float (float f) |
| Convert IEEE754 float to monotonic sortable unsigned int key. | |
| uint64_t | sortable_key_from_double (double d) |
| Convert IEEE754 double to monotonic sortable unsigned int key. | |
| template<typename T> | |
| MDBX_db_flags_t | get_mdbx_flags () |
| Returns MDBX flags for a given key type. | |
| template<typename T> | |
| size_t | get_key_size (const T &key) |
| Returns the size in bytes of a given key type. | |
| template<typename T> | |
| std::enable_if<!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a key into MDBX_val for database operations. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a key of type std::string. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a key stored in a byte vector. | |
| template<typename T> | |
| std::enable_if< std::is_integral< T >::value &&(sizeof(T)<=2), MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a small integral key (<=16 bits). | |
| template<typename T> | |
| std::enable_if< std::is_same< T, int32_t >::value||std::is_same< T, uint32_t >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a 32-bit integral key. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, float >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a 32-bit float key. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, int64_t >::value||std::is_same< T, uint64_t >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a 64-bit integral key. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, double >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes a 64-bit double key. | |
| template<typename T> | |
| std::enable_if< std::is_trivially_copyable< T >::value &&!std::is_same< T, std::string >::value &&!(std::is_integral< T >::value &&sizeof(T)<=2)&&!std::is_same< T, int32_t >::value &&!std::is_same< T, uint32_t >::value &&!std::is_same< T, float >::value &&!std::is_same< T, int64_t >::value &&!std::is_same< T, uint64_t >::value &&!std::is_same< T, double >::value, MDBX_val >::type | serialize_key (const T &key, SerializeScratch &sc) |
| Serializes any other trivially copyable key type. | |
| template<size_t N> | |
| MDBX_val | serialize_key (const std::bitset< N > &data, SerializeScratch &sc) |
| Serializes a std::bitset as a key. | |
| template<typename T> | |
| std::enable_if<!has_value_type< T >::value &&!std::is_same< T, std::vector< typenameT::value_type > >::value &&!std::is_trivially_copyable< typenameT::value_type >::value &&!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type | serialize_value (const T &value, SerializeScratch &sc) |
| Serializes a general value into MDBX_val. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type | serialize_value (const T &value, SerializeScratch &sc) |
| Serializes a std::string value. | |
| template<typename T> | |
| std::enable_if< has_value_type< T >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value||std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value), MDBX_val >::type | serialize_value (const T &container, SerializeScratch &sc) |
| Serializes containers (vector, deque, list, set, unordered_set) of trivially copyable elements. | |
| template<typename T> | |
| std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value, MDBX_val >::type | serialize_value (const T &container, SerializeScratch &sc) |
| Serializes a vector of trivially copyable elements. | |
| template<typename T> | |
| std::enable_if< has_to_bytes< T >::value, MDBX_val >::type | serialize_value (const T &value, SerializeScratch &sc) |
Serializes a value using its to_bytes() method. | |
| template<typename T> | |
| std::enable_if<!has_to_bytes< T >::value &&std::is_trivially_copyable< T >::value, MDBX_val >::type | serialize_value (const T &value, SerializeScratch &sc) |
| Serializes any trivially copyable value. | |
| template<typename T> | |
| std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, MDBX_val >::type | serialize_value (const T &container, SerializeScratch &sc) |
| Serializes a container of strings. | |
| template<typename T> | |
| std::enable_if<!has_value_type< T >::value &&!has_from_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, T >::type | deserialize_value (const MDBX_val &val) |
Deserializes a value from MDBX_val into type T. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::string >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a std::string value. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a vector of bytes. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::deque< uint8_t > >::value||std::is_same< T, std::deque< char > >::value||std::is_same< T, std::deque< unsignedchar > >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a deque of bytes. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::list< uint8_t > >::value||std::is_same< T, std::list< char > >::value||std::is_same< T, std::list< unsignedchar > >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a list of bytes. | |
| template<typename T> | |
| std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&!std::is_same< T, std::vector< uint8_t > >::value &&!std::is_same< T, std::vector< char > >::value &&!std::is_same< T, std::vector< unsignedchar > >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a vector of trivially copyable elements. | |
| template<typename T> | |
| std::enable_if<(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a deque or list of trivially copyable elements. | |
| template<typename T> | |
| std::enable_if<(std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a set or unordered_set of trivially copyable elements. | |
| template<typename T> | |
| std::enable_if<!has_from_bytes< T >::value &&std::is_trivially_copyable< T >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a trivially copyable value. | |
| template<typename T> | |
| std::enable_if< has_from_bytes< T >::value, T >::type | deserialize_value (const MDBX_val &val) |
Deserializes a value using its from_bytes() method. | |
| template<typename T> | |
| std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a container of strings. | |
| template<typename T> | |
| std::enable_if< std::is_same< T, std::set< std::string > >::value||std::is_same< T, std::unordered_set< std::string > >::value, T >::type | deserialize_value (const MDBX_val &val) |
| Deserializes a set of strings. | |
|
strong |
Specifies the access mode of a transaction.
Defines whether the transaction is read-only or writable.
| Enumerator | |
|---|---|
| READ_ONLY | Read-only transaction (no write operations allowed). |
| WRITABLE | Writable transaction (allows inserts, updates, deletes). |
Definition at line 14 of file Transaction.hpp.
| void mdbxc::check_mdbx | ( | int | rc, |
| const std::string & | context ) |
Throws an MdbxException if MDBX return code indicates an error.
| rc | Return code from an MDBX function. |
| context | Description of the calling context. |
|
inline |
Creates directories recursively for the given path.
| path | The directory path to create. |
| std::runtime_error | if the directories cannot be created. |
Definition at line 464 of file path_utils.hpp.
| std::enable_if<!has_value_type< T >::value &&!has_from_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< std::is_same< T, std::string >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< std::is_same< T, std::deque< uint8_t > >::value||std::is_same< T, std::deque< char > >::value||std::is_same< T, std::deque< unsignedchar > >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< std::is_same< T, std::list< uint8_t > >::value||std::is_same< T, std::list< char > >::value||std::is_same< T, std::list< unsignedchar > >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&!std::is_same< T, std::vector< uint8_t > >::value &&!std::is_same< T, std::vector< char > >::value &&!std::is_same< T, std::vector< unsignedchar > >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if<(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if<(std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value)&&std::is_trivially_copyable< typenameT::value_type >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if<!has_from_bytes< T >::value &&std::is_trivially_copyable< T >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< has_from_bytes< T >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
| std::enable_if< std::is_same< T, std::set< std::string > >::value||std::is_same< T, std::unordered_set< std::string > >::value, T >::type mdbxc::deserialize_value | ( | const MDBX_val & | val | ) |
|
inline |
Retrieves the directory of the executable file.
Definition at line 96 of file path_utils.hpp.
|
inline |
Extracts the file name from a full file path.
| file_path | The full file path as a string. |
Definition at line 155 of file path_utils.hpp.
| size_t mdbxc::get_key_size | ( | const T & | key | ) |
|
inline |
|
inline |
Extracts the parent directory from a full file path.
| file_path | Path to a file (e.g., "data/testdb"). |
Definition at line 78 of file path_utils.hpp.
|
inline |
Checks whether the given path is absolute (cross-platform).
| path | File or directory path. |
Definition at line 59 of file path_utils.hpp.
|
inlinenoexcept |
Check if path starts with explicit relative prefix.
| s | Path string to inspect. |
Definition at line 51 of file path_utils.hpp.
|
inline |
Check if character is a path separator.
| c | Character to check. |
Definition at line 252 of file path_utils.hpp.
|
inline |
Normalize path removing '.
' and '..' components.
| in | Path to normalize. |
Definition at line 259 of file path_utils.hpp.
|
inline |
| std::enable_if<!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, std::vector< uint8_t > >::value||std::is_same< T, std::vector< char > >::value||std::is_same< T, std::vector< unsignedchar > >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_integral< T >::value &&(sizeof(T)<=2), MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, int32_t >::value||std::is_same< T, uint32_t >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, float >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, int64_t >::value||std::is_same< T, uint64_t >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, double >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_trivially_copyable< T >::value &&!std::is_same< T, std::string >::value &&!(std::is_integral< T >::value &&sizeof(T)<=2)&&!std::is_same< T, int32_t >::value &&!std::is_same< T, uint32_t >::value &&!std::is_same< T, float >::value &&!std::is_same< T, int64_t >::value &&!std::is_same< T, uint64_t >::value &&!std::is_same< T, double >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key, |
| SerializeScratch & | sc ) |
| std::enable_if< has_value_type< T >::value &&std::is_trivially_copyable< typenameT::value_type >::value &&(std::is_same< T, std::deque< typenameT::value_type > >::value||std::is_same< T, std::list< typenameT::value_type > >::value||std::is_same< T, std::set< typenameT::value_type > >::value||std::is_same< T, std::unordered_set< typenameT::value_type > >::value), MDBX_val >::type mdbxc::serialize_value | ( | const T & | container, |
| SerializeScratch & | sc ) |
| std::enable_if< has_value_type< T >::value &&std::is_same< T, std::vector< typenameT::value_type > >::value &&std::is_trivially_copyable< typenameT::value_type >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | container, |
| SerializeScratch & | sc ) |
| std::enable_if< has_value_type< T >::value &&std::is_same< typenameT::value_type, std::string >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | container, |
| SerializeScratch & | sc ) |
| std::enable_if<!has_value_type< T >::value &&!std::is_same< T, std::vector< typenameT::value_type > >::value &&!std::is_trivially_copyable< typenameT::value_type >::value &&!has_to_bytes< T >::value &&!std::is_same< T, std::string >::value &&!std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value, |
| SerializeScratch & | sc ) |
| std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value, |
| SerializeScratch & | sc ) |
| std::enable_if< has_to_bytes< T >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value, |
| SerializeScratch & | sc ) |
| std::enable_if<!has_to_bytes< T >::value &&std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value, |
| SerializeScratch & | sc ) |
|
inline |
|
inline |
|
inline |
Splits a path into its root and components.
| path | The path to split. |
Definition at line 421 of file path_utils.hpp.
|
inlinenoexcept |
Converts a UTF-8 string to an ANSI string (Windows-specific).
| utf8 | The UTF-8 encoded string. |
Definition at line 173 of file path_utils.hpp.