some little formatting stuff

This commit is contained in:
Robin Müller 2020-05-07 23:00:09 +02:00
parent c7856da81c
commit 3ebc257968
3 changed files with 20 additions and 22 deletions

View File

@ -1,14 +1,11 @@
#ifndef FRAMEWORK_STORAGEMANAGER_LOCALPOOL_H_
#define FRAMEWORK_STORAGEMANAGER_LOCALPOOL_H_
/**
* @file LocalPool
*
* @date 02.02.2012
* @author Bastian Baetz
*
* @brief This file contains the definition of the LocalPool class.
*/
#ifndef FRAMEWORK_STORAGEMANAGER_LOCALPOOL_H_
#define FRAMEWORK_STORAGEMANAGER_LOCALPOOL_H_
#include <framework/objectmanager/SystemObject.h>
#include <framework/serviceinterface/ServiceInterfaceStream.h>
@ -20,7 +17,7 @@
/**
* @brief The LocalPool class provides an intermediate data storage with
* a fixed pool size policy.
* \details The class implements the StorageManagerIF interface. While the
* @details The class implements the StorageManagerIF interface. While the
* total number of pools is fixed, the element sizes in one pool and
* the number of pool elements per pool are set on construction.
* The full amount of memory is allocated on construction.
@ -31,7 +28,6 @@
* It is possible to store empty packets in the pool.
* The local pool is NOT thread-safe.
*/
template<uint8_t NUMBER_OF_POOLS = 5>
class LocalPool: public SystemObject, public StorageManagerIF {
public:
@ -55,9 +51,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 +114,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];
/**

View File

@ -15,17 +15,17 @@
template <uint8_t NUMBER_OF_POOLS = 5>
class PoolManager : public LocalPool<NUMBER_OF_POOLS> {
public:
PoolManager( object_id_t setObjectId, const uint16_t element_sizes[NUMBER_OF_POOLS],
const uint16_t n_elements[NUMBER_OF_POOLS] );
/**
* @brief In the PoolManager's destructor all allocated memory is freed.
*/
PoolManager(object_id_t setObjectId,
const uint16_t element_sizes[NUMBER_OF_POOLS],
const uint16_t n_elements[NUMBER_OF_POOLS]);
//! @brief In the PoolManager's destructor all allocated memory is freed.
virtual ~PoolManager();
//! @brief LocalPool overrides for thread-safety.
ReturnValue_t deleteData(store_address_t) override;
ReturnValue_t deleteData(uint8_t* buffer, size_t size,
store_address_t* storeId = NULL) override;
ReturnValue_t modifyData(store_address_t packet_id, uint8_t** packet_ptr,
size_t* size) override;
protected:

View File

@ -6,8 +6,9 @@
#include <stddef.h>
/**
* This union defines the type that identifies where a data packet is
* stored in the store. It comprises of a raw part to read it as raw value and
* @brief This union defines the type that identifies where a data packet is
* stored in the store.
* It consists of a raw part to read it as raw value and
* a structured part to use it in pool-like stores.
*/
union store_address_t {
@ -15,9 +16,9 @@ union store_address_t {
* Default Constructor, initializing to INVALID_ADDRESS
*/
store_address_t():raw(0xFFFFFFFF){}
/**
* Constructor to create an address object using the raw address
*
* @param rawAddress
*/
store_address_t(uint32_t rawAddress):raw(rawAddress){}
@ -30,7 +31,8 @@ union store_address_t {
* @param packetIndex
*/
store_address_t(uint16_t poolIndex, uint16_t packetIndex):
pool_index(poolIndex),packet_index(packetIndex){}
pool_index(poolIndex),packet_index(packetIndex) {}
/**
* A structure with two elements to access the store address pool-like.
*/
@ -154,7 +156,6 @@ public:
* Use with care!
*/
virtual void clearStore() = 0;
};
#endif /* STORAGEMANAGERIF_H_ */