renaming for name shadowing

This commit is contained in:
Robin Müller 2020-12-25 00:37:24 +01:00
parent ccbbef7778
commit 3486a04741
2 changed files with 9 additions and 9 deletions

View File

@ -11,7 +11,7 @@ PoolDataSetBase::~PoolDataSetBase() {}
ReturnValue_t PoolDataSetBase::registerVariable( ReturnValue_t PoolDataSetBase::registerVariable(
PoolVariableIF *variable) { PoolVariableIF *variable) {
if (state != States::DATA_SET_UNINITIALISED) { if (state != States::STATE_SET_UNINITIALISED) {
sif::error << "DataSet::registerVariable: " sif::error << "DataSet::registerVariable: "
"Call made in wrong position." << std::endl; "Call made in wrong position." << std::endl;
return DataSetIF::DATA_SET_UNINITIALISED; return DataSetIF::DATA_SET_UNINITIALISED;
@ -33,7 +33,7 @@ ReturnValue_t PoolDataSetBase::registerVariable(
ReturnValue_t PoolDataSetBase::read(uint32_t lockTimeout) { ReturnValue_t PoolDataSetBase::read(uint32_t lockTimeout) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
if (state == States::DATA_SET_UNINITIALISED) { if (state == States::STATE_SET_UNINITIALISED) {
lockDataPool(lockTimeout); lockDataPool(lockTimeout);
for (uint16_t count = 0; count < fillCount; count++) { for (uint16_t count = 0; count < fillCount; count++) {
result = readVariable(count); result = readVariable(count);
@ -41,7 +41,7 @@ ReturnValue_t PoolDataSetBase::read(uint32_t lockTimeout) {
break; break;
} }
} }
state = States::DATA_SET_WAS_READ; state = States::STATE_SET_WAS_READ;
unlockDataPool(); unlockDataPool();
} }
else { else {
@ -80,7 +80,7 @@ ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) {
} }
ReturnValue_t PoolDataSetBase::commit(uint32_t lockTimeout) { ReturnValue_t PoolDataSetBase::commit(uint32_t lockTimeout) {
if (state == States::DATA_SET_WAS_READ) { if (state == States::STATE_SET_WAS_READ) {
handleAlreadyReadDatasetCommit(lockTimeout); handleAlreadyReadDatasetCommit(lockTimeout);
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -99,7 +99,7 @@ void PoolDataSetBase::handleAlreadyReadDatasetCommit(uint32_t lockTimeout) {
registeredVariables[count]->commitWithoutLock(); registeredVariables[count]->commitWithoutLock();
} }
} }
state = States::DATA_SET_UNINITIALISED; state = States::STATE_SET_UNINITIALISED;
unlockDataPool(); unlockDataPool();
} }
@ -121,7 +121,7 @@ ReturnValue_t PoolDataSetBase::handleUnreadDatasetCommit(uint32_t lockTimeout) {
} }
} }
} }
state = States::DATA_SET_UNINITIALISED; state = States::STATE_SET_UNINITIALISED;
unlockDataPool(); unlockDataPool();
return result; return result;
} }

View File

@ -124,14 +124,14 @@ protected:
* States of the seet. * States of the seet.
*/ */
enum class States { enum class States {
DATA_SET_UNINITIALISED, //!< DATA_SET_UNINITIALISED STATE_SET_UNINITIALISED, //!< DATA_SET_UNINITIALISED
DATA_SET_WAS_READ //!< DATA_SET_WAS_READ STATE_SET_WAS_READ //!< DATA_SET_WAS_READ
}; };
/** /**
* @brief state manages the internal state of the data set, * @brief state manages the internal state of the data set,
* which is important e.g. for the behavior on destruction. * which is important e.g. for the behavior on destruction.
*/ */
States state = States::DATA_SET_UNINITIALISED; States state = States::STATE_SET_UNINITIALISED;
/** /**
* @brief This array represents all pool variables registered in this set. * @brief This array represents all pool variables registered in this set.