documented iStorage, hosted docs and added readme link

This commit is contained in:
Blue 2023-04-11 12:11:27 -03:00
parent af0e48a684
commit 66df0da5f6
Signed by: blue
GPG key ID: 9B203B252A63EE38
4 changed files with 236 additions and 24 deletions

View file

@ -114,7 +114,7 @@ private:
* Defines that the database is going to have the following storage.
* The LMDBAL::Base must be closed
*
* \param[in] name - storage name
* \param[in] _name - storage name
* \returns storage pointer. LMDBAL::Base keeps the ownership of the added storage, you don't need to destoroy it
*
* \tparam K - key type of the storage
@ -124,14 +124,14 @@ private:
* \exception LMDBAL::StorageDuplicate thrown if somebody tries to add storage with repeating name
*/
template <class K, class V>
LMDBAL::Storage<K, V>* LMDBAL::Base::addStorage(const std::string& p_name) {
LMDBAL::Storage<K, V>* LMDBAL::Base::addStorage(const std::string& _name) {
if (opened) {
throw Opened(name, "add storage " + p_name);
throw Opened(name, "add storage " + _name);
}
Storage<K, V>* storage = new Storage<K, V>(p_name, this);
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(p_name, (iStorage*)storage));
Storage<K, V>* storage = new Storage<K, V>(_name, this);
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(_name, (iStorage*)storage));
if (!pair.second)
throw StorageDuplicate(name, p_name);
throw StorageDuplicate(name, _name);
return storage;
}
@ -142,7 +142,7 @@ LMDBAL::Storage<K, V>* LMDBAL::Base::addStorage(const std::string& p_name) {
* Defines that the database is going to have the following cache.
* The LMDBAL::Base must be closed
*
* \param[in] name - cache name
* \param[in] _name - cache name
* \returns cache pointer. LMDBAL::Base keeps the ownership of the added cache, you don't need to destoroy it
*
* \tparam K - key type of the cache
@ -152,14 +152,14 @@ LMDBAL::Storage<K, V>* LMDBAL::Base::addStorage(const std::string& p_name) {
* \exception LMDBAL::StorageDuplicate thrown if somebody tries to add cache with repeating name
*/
template<class K, class V>
LMDBAL::Cache<K, V> * LMDBAL::Base::addCache(const std::string& p_name) {
LMDBAL::Cache<K, V> * LMDBAL::Base::addCache(const std::string& _name) {
if (opened) {
throw Opened(name, "add cache " + p_name);
throw Opened(name, "add cache " + _name);
}
Cache<K, V>* cache = new Cache<K, V>(p_name, this);
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(p_name, (iStorage*)cache));
Cache<K, V>* cache = new Cache<K, V>(_name, this);
std::pair<Storages::const_iterator, bool> pair = storages.insert(std::make_pair(_name, (iStorage*)cache));
if (!pair.second)
throw StorageDuplicate(name, p_name);
throw StorageDuplicate(name, _name);
return cache;
}
@ -173,7 +173,7 @@ LMDBAL::Cache<K, V> * LMDBAL::Base::addCache(const std::string& p_name) {
* this method with template parameters <std::string, std::string>
* on the same name of the previously added storage, or calling it on cache - the behaviour is undefined
*
* \param[in] name - storage name
* \param[in] _name - storage name
* \returns storage pointer. LMDBAL::Base keeps the ownership of the added storage, you don't need to destoroy it
*
* \tparam K - key type of the storage
@ -182,8 +182,8 @@ LMDBAL::Cache<K, V> * LMDBAL::Base::addCache(const std::string& p_name) {
* \exception std::out_of_range thrown if storage with the given name was not found
*/
template <class K, class V>
LMDBAL::Storage<K, V>* LMDBAL::Base::getStorage(const std::string& p_name) {
return static_cast<Storage<K, V>*>(storages.at(p_name));
LMDBAL::Storage<K, V>* LMDBAL::Base::getStorage(const std::string& _name) {
return static_cast<Storage<K, V>*>(storages.at(_name));
}
/**
@ -195,7 +195,7 @@ LMDBAL::Storage<K, V>* LMDBAL::Base::getStorage(const std::string& p_name) {
* this method with template parameters <std::string, std::string>
* on the same name of the previously added cache, or calling it on storage - the behaviour is undefined
*
* \param[in] name - cache name
* \param[in] _name - cache name
* \returns cache pointer. LMDBAL::Base keeps the ownership of the added cache, you don't need to destoroy it
*
* \tparam K - key type of the cache
@ -204,8 +204,8 @@ LMDBAL::Storage<K, V>* LMDBAL::Base::getStorage(const std::string& p_name) {
* \exception std::out_of_range thrown if cache with the given name was not found
*/
template <class K, class V>
LMDBAL::Cache<K, V>* LMDBAL::Base::getCache(const std::string& p_name) {
return static_cast<Cache<K, V>*>(storages.at(p_name));
LMDBAL::Cache<K, V>* LMDBAL::Base::getCache(const std::string& _name) {
return static_cast<Cache<K, V>*>(storages.at(_name));
}
#endif //LMDBAL_BASE_H