![]() |
MDBX Containers
|
Classes | |
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 | 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 | 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_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. | |
PathComponents | split_path (const std::string &path) |
Splits a path into its root and components. | |
std::string | utf8_to_ansi (const std::string &utf8) noexcept |
Converts a UTF-8 string to an ANSI string (Windows-specific). | |
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. | |
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) |
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) |
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) |
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) |
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||std::is_same< T, float >::value, MDBX_val >::type | serialize_key (const T &key) |
Serializes a 32-bit integral or float key. | |
template<typename T> | |
std::enable_if< 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) |
Serializes a 64-bit integral or 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) |
Serializes any other trivially copyable key type. | |
template<size_t N> | |
MDBX_val | serialize_key (const std::bitset< N > &data) |
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) |
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) |
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), MDBX_val >::type | serialize_value (const T &container) |
Serializes containers (vector, deque, list, 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 &value) |
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) |
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) |
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) |
Serializes a container of strings. | |
template<typename T> | |
std::enable_if<!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, 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<!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. |
void mdbxc::create_directories | ( | const std::string & | path | ) |
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 261 of file path_utils.hpp.
std::enable_if<!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, 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<!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 | ) |
std::string mdbxc::get_exec_dir | ( | ) |
Retrieves the directory of the executable file.
Definition at line 75 of file path_utils.hpp.
std::string mdbxc::get_file_name | ( | const std::string & | file_path | ) |
Extracts the file name from a full file path.
file_path | The full file path as a string. |
Definition at line 133 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 62 of file path_utils.hpp.
|
inline |
Checks whether the given path is absolute (cross-platform).
path | File or directory path. |
Definition at line 43 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 | ) |
std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key | ) |
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 | ) |
std::enable_if< std::is_integral< T >::value &&(sizeof(T)<=2), MDBX_val >::type mdbxc::serialize_key | ( | const T & | key | ) |
std::enable_if< std::is_same< T, int32_t >::value||std::is_same< T, uint32_t >::value||std::is_same< T, float >::value, MDBX_val >::type mdbxc::serialize_key | ( | const T & | key | ) |
std::enable_if< 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 | ) |
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 | ) |
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), MDBX_val >::type mdbxc::serialize_value | ( | const T & | container | ) |
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 | ) |
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 | ) |
std::enable_if< std::is_same< T, std::string >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value | ) |
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 & | value | ) |
std::enable_if< has_to_bytes< T >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value | ) |
std::enable_if<!has_to_bytes< T >::value &&std::is_trivially_copyable< T >::value, MDBX_val >::type mdbxc::serialize_value | ( | const T & | value | ) |
PathComponents mdbxc::split_path | ( | const std::string & | path | ) |
Splits a path into its root and components.
path | The path to split. |
Definition at line 200 of file path_utils.hpp.
|
noexcept |
Converts a UTF-8 string to an ANSI string (Windows-specific).
utf8 | The UTF-8 encoded string. |
Definition at line 243 of file path_utils.hpp.