more renaming

This commit is contained in:
Robin Müller 2021-01-19 15:06:21 +01:00
parent b6888a8185
commit ca22ff5d8e
2 changed files with 10 additions and 10 deletions

View File

@ -127,7 +127,7 @@ ReturnValue_t LocalPool::deleteData(store_address_t storeId) {
#endif #endif
ReturnValue_t status = RETURN_OK; ReturnValue_t status = RETURN_OK;
size_type pageSize = getPageSize(storeId.poolIndex); size_type pageSize = getSubpoolElementSize(storeId.poolIndex);
if ((pageSize != 0) and if ((pageSize != 0) and
(storeId.packetIndex < numberOfElements[storeId.poolIndex])) { (storeId.packetIndex < numberOfElements[storeId.poolIndex])) {
uint16_t packetPosition = getRawPosition(storeId); uint16_t packetPosition = getRawPosition(storeId);
@ -217,7 +217,7 @@ void LocalPool::clearStore() {
ReturnValue_t LocalPool::reserveSpace(const size_t size, ReturnValue_t LocalPool::reserveSpace(const size_t size,
store_address_t *storeId, bool ignoreFault) { store_address_t *storeId, bool ignoreFault) {
ReturnValue_t status = getPoolIndex(size, &storeId->poolIndex); ReturnValue_t status = getSubPoolIndex(size, &storeId->poolIndex);
if (status != RETURN_OK) { if (status != RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "LocalPool( " << std::hex << getObjectId() << std::dec sif::error << "LocalPool( " << std::hex << getObjectId() << std::dec
@ -227,7 +227,7 @@ ReturnValue_t LocalPool::reserveSpace(const size_t size,
} }
status = findEmpty(storeId->poolIndex, &storeId->packetIndex); status = findEmpty(storeId->poolIndex, &storeId->packetIndex);
while (status != RETURN_OK && spillsToHigherPools) { while (status != RETURN_OK && spillsToHigherPools) {
status = getPoolIndex(size, &storeId->poolIndex, storeId->poolIndex + 1); status = getSubPoolIndex(size, &storeId->poolIndex, storeId->poolIndex + 1);
if (status != RETURN_OK) { if (status != RETURN_OK) {
//We don't find any fitting pool anymore. //We don't find any fitting pool anymore.
break; break;
@ -263,9 +263,9 @@ void LocalPool::write(store_address_t storeId, const uint8_t *data,
sizeLists[storeId.poolIndex][storeId.packetIndex] = size; sizeLists[storeId.poolIndex][storeId.packetIndex] = size;
} }
LocalPool::size_type LocalPool::getPageSize(max_subpools_t poolIndex) { LocalPool::size_type LocalPool::getSubpoolElementSize(max_subpools_t subpoolIndex) {
if (poolIndex < NUMBER_OF_SUBPOOLS) { if (subpoolIndex < NUMBER_OF_SUBPOOLS) {
return elementSizes[poolIndex]; return elementSizes[subpoolIndex];
} }
else { else {
return 0; return 0;
@ -276,7 +276,7 @@ void LocalPool::setToSpillToHigherPools(bool enable) {
this->spillsToHigherPools = enable; this->spillsToHigherPools = enable;
} }
ReturnValue_t LocalPool::getPoolIndex(size_t packetSize, uint16_t *poolIndex, ReturnValue_t LocalPool::getSubPoolIndex(size_t packetSize, uint16_t *subpoolIndex,
uint16_t startAtIndex) { uint16_t startAtIndex) {
for (uint16_t n = startAtIndex; n < NUMBER_OF_SUBPOOLS; n++) { for (uint16_t n = startAtIndex; n < NUMBER_OF_SUBPOOLS; n++) {
#if FSFW_VERBOSE_PRINTOUT == 2 #if FSFW_VERBOSE_PRINTOUT == 2
@ -286,7 +286,7 @@ ReturnValue_t LocalPool::getPoolIndex(size_t packetSize, uint16_t *poolIndex,
#endif #endif
#endif #endif
if (elementSizes[n] >= packetSize) { if (elementSizes[n] >= packetSize) {
*poolIndex = n; *subpoolIndex = n;
return RETURN_OK; return RETURN_OK;
} }
} }

View File

@ -217,7 +217,7 @@ private:
* @param pool_index The pool in which to look. * @param pool_index The pool in which to look.
* @return Returns the size of an element or 0. * @return Returns the size of an element or 0.
*/ */
size_type getPageSize(max_subpools_t poolIndex); size_type getSubpoolElementSize(max_subpools_t subpoolIndex);
/** /**
* @brief This helper method looks up a fitting pool for a given size. * @brief This helper method looks up a fitting pool for a given size.
@ -228,7 +228,7 @@ private:
* @return - @c RETURN_OK on success, * @return - @c RETURN_OK on success,
* - @c DATA_TOO_LARGE otherwise. * - @c DATA_TOO_LARGE otherwise.
*/ */
ReturnValue_t getPoolIndex(size_t packetSize, uint16_t* poolIndex, ReturnValue_t getSubPoolIndex(size_t packetSize, uint16_t* subpoolIndex,
uint16_t startAtIndex = 0); uint16_t startAtIndex = 0);
/** /**
* @brief This helper method calculates the true array position in store * @brief This helper method calculates the true array position in store