From a115bf1186d075ea8c6b98c03ba847f22d41251b Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 4 Jun 2020 14:43:33 +0200 Subject: [PATCH] store access improvements --- storagemanager/LocalPool.h | 10 +++++----- storagemanager/PoolManager.h | 3 ++- storagemanager/PoolManager.tpp | 1 - storagemanager/StorageManagerIF.h | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/storagemanager/LocalPool.h b/storagemanager/LocalPool.h index 2d61dea51..bb94a3be2 100644 --- a/storagemanager/LocalPool.h +++ b/storagemanager/LocalPool.h @@ -24,7 +24,6 @@ * The local pool is NOT thread-safe. * @author Bastian Baetz */ - template class LocalPool: public SystemObject, public StorageManagerIF { public: @@ -48,9 +47,10 @@ public: * number of elements for each pool is determined. * The position of these values correspond to those in * element_sizes. - * @param registered Register the pool in object manager or not. Default is false (local pool). - * @param spillsToHigherPools - * A variable to determine whether higher n pools are used if the store is full. + * @param registered Register the pool in object manager or not. + * Default is false (local pool). + * @param spillsToHigherPools A variable to determine whether + * higher n pools are used if the store is full. */ LocalPool(object_id_t setObjectId, const uint16_t element_sizes[NUMBER_OF_POOLS], @@ -117,7 +117,7 @@ private: /** * @brief store represents the actual memory pool. * @details It is an array of pointers to memory, which was allocated with - * a \c new call on construction. + * a @c new call on construction. */ uint8_t* store[NUMBER_OF_POOLS]; /** diff --git a/storagemanager/PoolManager.h b/storagemanager/PoolManager.h index c74e95c0e..7c2e8a719 100644 --- a/storagemanager/PoolManager.h +++ b/storagemanager/PoolManager.h @@ -12,7 +12,7 @@ * with a lock. * @author Bastian Baetz */ -template +template class PoolManager : public LocalPool { public: PoolManager(object_id_t setObjectId, @@ -27,6 +27,7 @@ public: ReturnValue_t deleteData(store_address_t) override; ReturnValue_t deleteData(uint8_t* buffer, size_t size, store_address_t* storeId = nullptr) override; + protected: ReturnValue_t reserveSpace(const uint32_t size, store_address_t* address, bool ignoreFault) override; diff --git a/storagemanager/PoolManager.tpp b/storagemanager/PoolManager.tpp index 9fb11776b..a35b810c9 100644 --- a/storagemanager/PoolManager.tpp +++ b/storagemanager/PoolManager.tpp @@ -48,4 +48,3 @@ inline ReturnValue_t PoolManager::deleteData(uint8_t* buffer, } #endif - diff --git a/storagemanager/StorageManagerIF.h b/storagemanager/StorageManagerIF.h index d5ac5818e..f8aee8198 100644 --- a/storagemanager/StorageManagerIF.h +++ b/storagemanager/StorageManagerIF.h @@ -11,7 +11,6 @@ using AccessorPair = std::pair; using ConstAccessorPair = std::pair; - /** * @brief This class provides an interface for intermediate data storage. * @details The Storage manager classes shall be used to store larger chunks of @@ -80,6 +79,7 @@ public: virtual ReturnValue_t deleteData(uint8_t* buffer, size_t size, store_address_t* storeId = nullptr) = 0; + /** * @brief Access the data by supplying a store ID. * @details @@ -100,6 +100,7 @@ public: virtual ReturnValue_t getData(store_address_t storeId, ConstStorageAccessor& constAccessor) = 0; + /** * @brief getData returns an address to data and the size of the data * for a given packet_id.