renamed receivers list, functions protected

This commit is contained in:
Robin Müller 2021-03-01 12:26:16 +01:00
parent 458d783211
commit 2b6ccbc17f
2 changed files with 11 additions and 9 deletions

View File

@ -98,7 +98,7 @@ ReturnValue_t LocalDataPoolManager::initializeHousekeepingPoolEntriesOnce() {
ReturnValue_t LocalDataPoolManager::performHkOperation() {
ReturnValue_t status = HasReturnvaluesIF::RETURN_OK;
for(auto& receiver: hkReceiversMap) {
for(auto& receiver: hkReceivers) {
switch(receiver.reportingType) {
case(ReportingType::PERIODIC): {
if(receiver.dataType == DataType::LOCAL_POOL_VARIABLE) {
@ -375,7 +375,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForPeriodicPacket(sid_t sid,
owner->getPeriodicOperationFrequency(), isDiagnostics);
}
hkReceiversMap.push_back(hkReceiver);
hkReceivers.push_back(hkReceiver);
return HasReturnvaluesIF::RETURN_OK;
}
@ -404,7 +404,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForUpdatePacket(sid_t sid,
LocalPoolDataSetAttorney::setDiagnostic(*dataSet, isDiagnostics);
}
hkReceiversMap.push_back(hkReceiver);
hkReceivers.push_back(hkReceiver);
handleHkUpdateResetListInsertion(hkReceiver.dataType, hkReceiver.dataId);
return HasReturnvaluesIF::RETURN_OK;
@ -425,7 +425,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForSetUpdateMessage(
hkReceiver.reportingType = ReportingType::UPDATE_NOTIFICATION;
}
hkReceiversMap.push_back(hkReceiver);
hkReceivers.push_back(hkReceiver);
handleHkUpdateResetListInsertion(hkReceiver.dataType, hkReceiver.dataId);
return HasReturnvaluesIF::RETURN_OK;
@ -446,7 +446,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForVariableUpdateMessage(
hkReceiver.reportingType = ReportingType::UPDATE_NOTIFICATION;
}
hkReceiversMap.push_back(hkReceiver);
hkReceivers.push_back(hkReceiver);
handleHkUpdateResetListInsertion(hkReceiver.dataType, hkReceiver.dataId);
return HasReturnvaluesIF::RETURN_OK;
@ -829,8 +829,8 @@ ReturnValue_t LocalDataPoolManager::generateSetStructurePacket(sid_t sid,
}
void LocalDataPoolManager::clearReceiversList() {
// clear the vector completely and releases allocated memory.
HkReceivers().swap(hkReceiversMap);
/* Clear the vector completely and releases allocated memory. */
HkReceivers().swap(hkReceivers);
}
MutexIF* LocalDataPoolManager::getLocalPoolMutex() {

View File

@ -271,7 +271,9 @@ public:
MutexIF* getMutexHandle();
virtual LocalDataPoolManager* getPoolManagerHandle() override;
private:
protected:
localpool::DataPool localPoolMap;
/** Every housekeeping data manager has a mutex to protect access
to it's data pool. */
@ -307,7 +309,7 @@ private:
/** This vector will contain the list of HK receivers. */
using HkReceivers = std::vector<struct HkReceiver>;
HkReceivers hkReceiversMap;
HkReceivers hkReceivers;
struct HkUpdateResetHelper {
DataType dataType = DataType::DATA_SET;