This commit is contained in:
Blue 2023-04-12 12:36:33 -03:00
parent 66df0da5f6
commit 2b4763b575
Signed by: blue
GPG key ID: 9B203B252A63EE38
9 changed files with 141 additions and 49 deletions

View file

@ -46,7 +46,7 @@ class Storage;
template <class K, class V>
class Cache;
typedef MDB_txn* TransactionID;
typedef MDB_txn* TransactionID; /**<I'm going to use transaction pointers as transaction IDs*/
class Base {
friend class iStorage;
@ -81,8 +81,8 @@ public:
LMDBAL::Cache<K, V>* getCache(const std::string& name);
private:
typedef std::map<std::string, LMDBAL::iStorage*> Storages;
typedef std::set<TransactionID> Transactions;
typedef std::map<std::string, LMDBAL::iStorage*> Storages; /**<Storage and Cache pointers are saved in the std::map*/
typedef std::set<TransactionID> Transactions; /**<Piblic transaction IDs are saved in the std::set*/
TransactionID beginReadOnlyTransaction(const std::string& storageName) const;
TransactionID beginTransaction(const std::string& storageName) const;
@ -95,14 +95,14 @@ private:
void abortPrivateTransaction(TransactionID id, const std::string& storageName) const;
private:
std::string name;
bool opened;
uint16_t size;
MDB_env* environment;
Storages storages;
Transactions* transactions;
std::string name; /**<\brief Name of this database*/
bool opened; /**<\brief State of this database*/
uint16_t size; /**<\brief lmdb map size in MiB*/
MDB_env* environment; /**<\brief lmdb environment handle*/
Storages storages; /**<\brief Registered storages and caches*/
Transactions* transactions; /**<\brief Active public transactions*/
inline static const std::string emptyName = "";
inline static const std::string emptyName = ""; /**<\brief Empty string for general fallback purposes*/
};
}