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

View File

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