Cursors refactoring part one
This commit is contained in:
parent
ef86d0adf9
commit
bfb1d007ad
19 changed files with 824 additions and 677 deletions
10
src/base.h
10
src/base.h
|
@ -34,7 +34,7 @@
|
|||
|
||||
namespace LMDBAL {
|
||||
|
||||
class iStorage;
|
||||
class StorageCommon;
|
||||
class Transaction;
|
||||
class WriteTransaction;
|
||||
|
||||
|
@ -51,7 +51,7 @@ typedef MDB_txn* TransactionID; /**<\brief I'm going to
|
|||
typedef uint32_t SizeType; /**<\brief All LMDBAL sizes are uint32_t*/
|
||||
|
||||
class Base {
|
||||
friend class iStorage;
|
||||
friend class StorageCommon;
|
||||
friend class Transaction;
|
||||
friend class WriteTransaction;
|
||||
public:
|
||||
|
@ -84,7 +84,7 @@ public:
|
|||
LMDBAL::Cache<K, V>* getCache(const std::string& storageName);
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, LMDBAL::iStorage*> Storages; /**<\brief Storage and Cache pointers are saved in the std::map*/
|
||||
typedef std::map<std::string, LMDBAL::StorageCommon *> Storages; /**<\brief Storage and Cache pointers are saved in the std::map*/
|
||||
typedef std::map<TransactionID, Transaction*> Transactions; /**<\brief Piblic transaction IDs are saved in the std::set*/
|
||||
|
||||
void commitTransaction(TransactionID id);
|
||||
|
@ -136,7 +136,7 @@ LMDBAL::Storage<K, V>* LMDBAL::Base::addStorage(const std::string& storageName,
|
|||
throw Opened(name, "add storage " + storageName);
|
||||
|
||||
Storage<K, V>* storage = new Storage<K, V>(this, storageName, duplicates);
|
||||
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(storageName, (iStorage*)storage));
|
||||
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(storageName, (StorageCommon *)storage));
|
||||
if (!pair.second)
|
||||
throw StorageDuplicate(name, storageName);
|
||||
|
||||
|
@ -164,7 +164,7 @@ LMDBAL::Cache<K, V> * LMDBAL::Base::addCache(const std::string& storageName) {
|
|||
throw Opened(name, "add cache " + storageName);
|
||||
|
||||
Cache<K, V>* cache = new Cache<K, V>(this, storageName, false);
|
||||
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(storageName, (iStorage*)cache));
|
||||
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(storageName, (StorageCommon *)cache));
|
||||
if (!pair.second)
|
||||
throw StorageDuplicate(name, storageName);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue