introduced new accessor IF
This commit is contained in:
parent
0109428d47
commit
bb10c25909
@ -106,6 +106,10 @@ MessageQueueId_t ExtendedControllerBase::getCommandQueue() const {
|
|||||||
return commandQueue->getId();
|
return commandQueue->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccessLocalPoolIF* ExtendedControllerBase::getAccessorHandle() {
|
||||||
|
return &localPoolManager;
|
||||||
|
}
|
||||||
|
|
||||||
LocalPoolDataSetBase* ExtendedControllerBase::getDataSetHandle(sid_t sid) {
|
LocalPoolDataSetBase* ExtendedControllerBase::getDataSetHandle(sid_t sid) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "ExtendedControllerBase::getDataSetHandle: No child "
|
sif::warning << "ExtendedControllerBase::getDataSetHandle: No child "
|
||||||
|
@ -33,6 +33,7 @@ public:
|
|||||||
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
||||||
|
|
||||||
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
||||||
|
AccessLocalPoolIF* getAccessorHandle() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LocalDataPoolManager localPoolManager;
|
LocalDataPoolManager localPoolManager;
|
||||||
|
@ -1,17 +1,31 @@
|
|||||||
#ifndef FSFW_DATAPOOLLOCAL_ACCESSLOCALPOOLF_H_
|
#ifndef FSFW_DATAPOOLLOCAL_ACCESSLOCALPOOLF_H_
|
||||||
#define FSFW_DATAPOOLLOCAL_ACCESSLOCALPOOLF_H_
|
#define FSFW_DATAPOOLLOCAL_ACCESSLOCALPOOLF_H_
|
||||||
|
|
||||||
#include <fsfw/datapool/PoolEntry.h>
|
|
||||||
#include <fsfw/datapoollocal/locPoolDefinitions.h>
|
#include <fsfw/datapoollocal/locPoolDefinitions.h>
|
||||||
|
#include <fsfw/datapool/PoolEntry.h>
|
||||||
|
#include <fsfw/datapoollocal/HasLocalDataPoolIF.h>
|
||||||
|
#include <fsfw/ipc/MutexIF.h>
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
class AccessLocalPoolIF {
|
class AccessLocalPoolIF {
|
||||||
public:
|
public:
|
||||||
virtual~ AccessLocalPoolIF() {};
|
virtual ~AccessLocalPoolIF() {};
|
||||||
|
|
||||||
virtual ReturnValue_t fetchPoolEntry(lp_id_t localPoolId, PoolEntry<T> **poolEntry) = 0;
|
virtual ReturnValue_t retrieveLocalPoolMutex(MutexIF* mutex) = 0;
|
||||||
|
virtual object_id_t getCreatorObjectId() const = 0;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//virtual LocalDataPoolManager* getHkManagerHandle() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//template <typename T>
|
||||||
|
//class AccessLocalPoolTypedIF {
|
||||||
|
//public:
|
||||||
|
// virtual ~AccessLocalPoolTypedIF() {};
|
||||||
|
//
|
||||||
|
// virtual ReturnValue_t fetchPoolEntry(lp_id_t localPoolId, PoolEntry<T> **poolEntry) = 0;
|
||||||
|
//};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* FSFW_DATAPOOLLOCAL_ACCESSLOCALPOOLF_H_ */
|
#endif /* FSFW_DATAPOOLLOCAL_ACCESSLOCALPOOLF_H_ */
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef FSFW_DATAPOOLLOCAL_HASLOCALDATAPOOLIF_H_
|
#ifndef FSFW_DATAPOOLLOCAL_HASLOCALDATAPOOLIF_H_
|
||||||
#define FSFW_DATAPOOLLOCAL_HASLOCALDATAPOOLIF_H_
|
#define FSFW_DATAPOOLLOCAL_HASLOCALDATAPOOLIF_H_
|
||||||
|
|
||||||
|
#include "AccessLocalPoolF.h"
|
||||||
#include "ProvidesDataPoolSubscriptionIF.h"
|
#include "ProvidesDataPoolSubscriptionIF.h"
|
||||||
#include "locPoolDefinitions.h"
|
#include "locPoolDefinitions.h"
|
||||||
|
|
||||||
@ -54,8 +55,6 @@ public:
|
|||||||
|
|
||||||
static constexpr uint32_t INVALID_LPID = localpool::INVALID_LPID;
|
static constexpr uint32_t INVALID_LPID = localpool::INVALID_LPID;
|
||||||
|
|
||||||
virtual object_id_t getObjectId() const = 0;
|
|
||||||
|
|
||||||
/** Command queue for housekeeping messages. */
|
/** Command queue for housekeeping messages. */
|
||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
|
||||||
@ -124,6 +123,8 @@ public:
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
virtual ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() = 0;
|
virtual ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() = 0;
|
||||||
|
|
||||||
|
virtual AccessLocalPoolIF* getAccessorHandle() = 0;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -410,7 +410,7 @@ ReturnValue_t LocalDataPoolManager::subscribeForSetUpdateMessages(
|
|||||||
MessageQueueId_t targetQueueId, bool generateSnapshot) {
|
MessageQueueId_t targetQueueId, bool generateSnapshot) {
|
||||||
struct HkReceiver hkReceiver;
|
struct HkReceiver hkReceiver;
|
||||||
hkReceiver.dataType = DataType::DATA_SET;
|
hkReceiver.dataType = DataType::DATA_SET;
|
||||||
hkReceiver.dataId.sid = sid_t(this->getOwner()->getObjectId(), setId);
|
hkReceiver.dataId.sid = sid_t(this->getCreatorObjectId(), setId);
|
||||||
hkReceiver.destinationQueue = targetQueueId;
|
hkReceiver.destinationQueue = targetQueueId;
|
||||||
hkReceiver.objectId = destinationObject;
|
hkReceiver.objectId = destinationObject;
|
||||||
if(generateSnapshot) {
|
if(generateSnapshot) {
|
||||||
@ -822,6 +822,18 @@ void LocalDataPoolManager::clearReceiversList() {
|
|||||||
HkReceivers().swap(hkReceiversMap);
|
HkReceivers().swap(hkReceiversMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t LocalDataPoolManager::retrieveLocalPoolMutex(MutexIF *mutex) {
|
||||||
|
if(this->mutex == nullptr) {
|
||||||
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
|
}
|
||||||
|
mutex = this->mutex;
|
||||||
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
object_id_t LocalDataPoolManager::getCreatorObjectId() const {
|
||||||
|
return owner->getAccessorHandle()->getCreatorObjectId();
|
||||||
|
}
|
||||||
|
|
||||||
void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
||||||
const char* functionName, ReturnValue_t error, const char* errorPrint) {
|
const char* functionName, ReturnValue_t error, const char* errorPrint) {
|
||||||
if(errorPrint == nullptr) {
|
if(errorPrint == nullptr) {
|
||||||
@ -857,7 +869,7 @@ void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::warning << "LocalDataPoolManager::" << functionName
|
sif::warning << "LocalDataPoolManager::" << functionName
|
||||||
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
||||||
<< std::hex << owner->getObjectId() << " | " << errorPrint
|
<< std::hex << this->getCreatorObjectId() << " | " << errorPrint
|
||||||
<< std::dec << std::setfill(' ') << std::endl;
|
<< std::dec << std::setfill(' ') << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
fsfw::printWarning("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
||||||
@ -868,7 +880,7 @@ void LocalDataPoolManager::printWarningOrError(fsfw::OutputTypes outputType,
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "LocalDataPoolManager::" << functionName
|
sif::error << "LocalDataPoolManager::" << functionName
|
||||||
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
<< ": Object ID " << std::setw(8) << std::setfill('0')
|
||||||
<< std::hex << owner->getObjectId() << " | " << errorPrint
|
<< std::hex << this->getCreatorObjectId() << " | " << errorPrint
|
||||||
<< std::dec << std::setfill(' ') << std::endl;
|
<< std::dec << std::setfill(' ') << std::endl;
|
||||||
#else
|
#else
|
||||||
fsfw::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
fsfw::printError("LocalDataPoolManager::%s: Object ID 0x%08x | %s\n",
|
||||||
|
@ -50,10 +50,11 @@ class HousekeepingPacketUpdate;
|
|||||||
* Each pool entry has a valid state too.
|
* Each pool entry has a valid state too.
|
||||||
* @author R. Mueller
|
* @author R. Mueller
|
||||||
*/
|
*/
|
||||||
class LocalDataPoolManager: public ProvidesDataPoolSubscriptionIF {
|
class LocalDataPoolManager: public ProvidesDataPoolSubscriptionIF,
|
||||||
|
public AccessLocalPoolIF {
|
||||||
template<typename T> friend class LocalPoolVariable;
|
template<typename T> friend class LocalPoolVariable;
|
||||||
template<typename T, uint16_t vecSize> friend class LocalPoolVector;
|
template<typename T, uint16_t vecSize> friend class LocalPoolVector;
|
||||||
friend class LocalPoolDataSetBase;
|
//friend class LocalPoolDataSetBase;
|
||||||
friend void (Factory::setStaticFrameworkObjectIds)();
|
friend void (Factory::setStaticFrameworkObjectIds)();
|
||||||
public:
|
public:
|
||||||
static constexpr uint8_t INTERFACE_ID = CLASS_ID::HOUSEKEEPING_MANAGER;
|
static constexpr uint8_t INTERFACE_ID = CLASS_ID::HOUSEKEEPING_MANAGER;
|
||||||
@ -176,6 +177,8 @@ public:
|
|||||||
MessageQueueId_t targetQueueId,
|
MessageQueueId_t targetQueueId,
|
||||||
bool generateSnapshot) override;
|
bool generateSnapshot) override;
|
||||||
|
|
||||||
|
ReturnValue_t retrieveLocalPoolMutex(MutexIF* mutex) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Non-Diagnostics packets usually have a lower minimum sampling frequency
|
* Non-Diagnostics packets usually have a lower minimum sampling frequency
|
||||||
* than diagnostic packets.
|
* than diagnostic packets.
|
||||||
@ -259,6 +262,8 @@ public:
|
|||||||
* the insertion operations allocate dynamically.
|
* the insertion operations allocate dynamically.
|
||||||
*/
|
*/
|
||||||
void clearReceiversList();
|
void clearReceiversList();
|
||||||
|
|
||||||
|
object_id_t getCreatorObjectId() const override;
|
||||||
private:
|
private:
|
||||||
LocalDataPool localPoolMap;
|
LocalDataPool localPoolMap;
|
||||||
//! Every housekeeping data manager has a mutex to protect access
|
//! Every housekeeping data manager has a mutex to protect access
|
||||||
|
@ -23,13 +23,14 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(HasLocalDataPoolIF *hkOwner,
|
|||||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
hkManager = hkOwner->getHkManagerHandle();
|
localPoolAccessor = hkOwner->getAccessorHandle();
|
||||||
|
|
||||||
if(hkManager != nullptr) {
|
if(localPoolAccessor != nullptr) {
|
||||||
mutexIfSingleDataCreator = hkManager->getMutexHandle();
|
localPoolAccessor->retrieveLocalPoolMutex(mutexIfSingleDataCreator);
|
||||||
|
//mutexIfSingleDataCreator = hkManager->getAc();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->sid.objectId = hkOwner->getObjectId();
|
this->sid.objectId = localPoolAccessor->getCreatorObjectId();
|
||||||
this->sid.ownerSetId = setId;
|
this->sid.ownerSetId = setId;
|
||||||
|
|
||||||
// Data creators get a periodic helper for periodic HK data generation.
|
// Data creators get a periodic helper for periodic HK data generation.
|
||||||
@ -42,15 +43,15 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(sid_t sid,
|
|||||||
PoolVariableIF** registeredVariablesArray,
|
PoolVariableIF** registeredVariablesArray,
|
||||||
const size_t maxNumberOfVariables):
|
const size_t maxNumberOfVariables):
|
||||||
PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) {
|
PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) {
|
||||||
HasLocalDataPoolIF* hkOwner = objectManager->get<HasLocalDataPoolIF>(
|
AccessLocalPoolIF* hkOwner = objectManager->get<AccessLocalPoolIF>(
|
||||||
sid.objectId);
|
sid.objectId);
|
||||||
if(hkOwner != nullptr) {
|
if(hkOwner != nullptr) {
|
||||||
hkManager = hkOwner->getHkManagerHandle();
|
ReturnValue_t result = hkOwner->retrieveLocalPoolMutex(mutexIfSingleDataCreator);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hkManager != nullptr) {
|
//if(hkManager != nullptr) {
|
||||||
mutexIfSingleDataCreator = hkManager->getMutexHandle();
|
// mutexIfSingleDataCreator = hkManager->getMutexHandle();
|
||||||
}
|
//}
|
||||||
this->sid = sid;
|
this->sid = sid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,12 +309,9 @@ void LocalPoolDataSetBase::setValidity(bool valid, bool setEntriesRecursively) {
|
|||||||
this->valid = valid;
|
this->valid = valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
object_id_t LocalPoolDataSetBase::getCreatorObjectId(object_id_t objectId) {
|
object_id_t LocalPoolDataSetBase::getCreatorObjectId() {
|
||||||
if(hkManager != nullptr) {
|
if(localPoolAccessor != nullptr) {
|
||||||
HasLocalDataPoolIF* owner = hkManager->getOwner();
|
return localPoolAccessor->getCreatorObjectId();
|
||||||
if(owner != nullptr) {
|
|
||||||
return owner->getObjectId();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return objects::NO_OBJECT;
|
return objects::NO_OBJECT;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ public:
|
|||||||
void setChanged(bool changed) override;
|
void setChanged(bool changed) override;
|
||||||
bool hasChanged() const override;
|
bool hasChanged() const override;
|
||||||
|
|
||||||
object_id_t getCreatorObjectId(object_id_t objectId);
|
object_id_t getCreatorObjectId();
|
||||||
protected:
|
protected:
|
||||||
sid_t sid;
|
sid_t sid;
|
||||||
//! This mutex is used if the data is created by one object only.
|
//! This mutex is used if the data is created by one object only.
|
||||||
@ -217,7 +217,7 @@ protected:
|
|||||||
bool bitGetter(const uint8_t* byte, uint8_t position) const;
|
bool bitGetter(const uint8_t* byte, uint8_t position) const;
|
||||||
|
|
||||||
PeriodicHousekeepingHelper* periodicHelper = nullptr;
|
PeriodicHousekeepingHelper* periodicHelper = nullptr;
|
||||||
LocalDataPoolManager* hkManager = nullptr;
|
AccessLocalPoolIF* localPoolAccessor = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
* @ingroup data_pool
|
* @ingroup data_pool
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class LocalPoolVariable: public LocalPoolObjectBase, public AccessLocalPoolIF<T> {
|
class LocalPoolVariable: public LocalPoolObjectBase {
|
||||||
public:
|
public:
|
||||||
//! Default ctor is forbidden.
|
//! Default ctor is forbidden.
|
||||||
LocalPoolVariable() = delete;
|
LocalPoolVariable() = delete;
|
||||||
|
@ -33,7 +33,7 @@ inline ReturnValue_t LocalPoolVariable<T>::read(
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline ReturnValue_t LocalPoolVariable<T>::readWithoutLock() {
|
inline ReturnValue_t LocalPoolVariable<T>::readWithoutLock() {
|
||||||
if(readWriteMode == pool_rwm_t::VAR_WRITE) {
|
if(readWriteMode == pool_rwm_t::VAR_WRITE) {
|
||||||
object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t targetObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVector",
|
reportReadCommitError("LocalPoolVector",
|
||||||
PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId,
|
PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId,
|
||||||
localPoolId);
|
localPoolId);
|
||||||
@ -43,7 +43,7 @@ inline ReturnValue_t LocalPoolVariable<T>::readWithoutLock() {
|
|||||||
PoolEntry<T>* poolEntry = nullptr;
|
PoolEntry<T>* poolEntry = nullptr;
|
||||||
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
||||||
if(result != RETURN_OK) {
|
if(result != RETURN_OK) {
|
||||||
object_id_t ownerObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t ownerObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVariable", result,
|
reportReadCommitError("LocalPoolVariable", result,
|
||||||
false, ownerObjectId, localPoolId);
|
false, ownerObjectId, localPoolId);
|
||||||
return result;
|
return result;
|
||||||
@ -80,7 +80,7 @@ inline ReturnValue_t LocalPoolVariable<T>::commit(
|
|||||||
template<typename T>
|
template<typename T>
|
||||||
inline ReturnValue_t LocalPoolVariable<T>::commitWithoutLock() {
|
inline ReturnValue_t LocalPoolVariable<T>::commitWithoutLock() {
|
||||||
if(readWriteMode == pool_rwm_t::VAR_READ) {
|
if(readWriteMode == pool_rwm_t::VAR_READ) {
|
||||||
object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t targetObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVector",
|
reportReadCommitError("LocalPoolVector",
|
||||||
PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId,
|
PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId,
|
||||||
localPoolId);
|
localPoolId);
|
||||||
@ -90,7 +90,7 @@ inline ReturnValue_t LocalPoolVariable<T>::commitWithoutLock() {
|
|||||||
PoolEntry<T>* poolEntry = nullptr;
|
PoolEntry<T>* poolEntry = nullptr;
|
||||||
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
||||||
if(result != RETURN_OK) {
|
if(result != RETURN_OK) {
|
||||||
object_id_t ownerObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t ownerObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVariable", result,
|
reportReadCommitError("LocalPoolVariable", result,
|
||||||
false, ownerObjectId, localPoolId);
|
false, ownerObjectId, localPoolId);
|
||||||
return result;
|
return result;
|
||||||
|
@ -32,7 +32,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::read(
|
|||||||
template<typename T, uint16_t vectorSize>
|
template<typename T, uint16_t vectorSize>
|
||||||
inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() {
|
inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() {
|
||||||
if(readWriteMode == pool_rwm_t::VAR_WRITE) {
|
if(readWriteMode == pool_rwm_t::VAR_WRITE) {
|
||||||
object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t targetObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVector",
|
reportReadCommitError("LocalPoolVector",
|
||||||
PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId,
|
PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId,
|
||||||
localPoolId);
|
localPoolId);
|
||||||
@ -44,7 +44,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::readWithoutLock() {
|
|||||||
memset(this->value, 0, vectorSize * sizeof(T));
|
memset(this->value, 0, vectorSize * sizeof(T));
|
||||||
|
|
||||||
if(result != RETURN_OK) {
|
if(result != RETURN_OK) {
|
||||||
object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t targetObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVector", result, true, targetObjectId,
|
reportReadCommitError("LocalPoolVector", result, true, targetObjectId,
|
||||||
localPoolId);
|
localPoolId);
|
||||||
return result;
|
return result;
|
||||||
@ -71,7 +71,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::commit(
|
|||||||
template<typename T, uint16_t vectorSize>
|
template<typename T, uint16_t vectorSize>
|
||||||
inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() {
|
inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() {
|
||||||
if(readWriteMode == pool_rwm_t::VAR_READ) {
|
if(readWriteMode == pool_rwm_t::VAR_READ) {
|
||||||
object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t targetObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVector",
|
reportReadCommitError("LocalPoolVector",
|
||||||
PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId,
|
PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId,
|
||||||
localPoolId);
|
localPoolId);
|
||||||
@ -80,7 +80,7 @@ inline ReturnValue_t LocalPoolVector<T, vectorSize>::commitWithoutLock() {
|
|||||||
PoolEntry<T>* poolEntry = nullptr;
|
PoolEntry<T>* poolEntry = nullptr;
|
||||||
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
ReturnValue_t result = hkManager->fetchPoolEntry(localPoolId, &poolEntry);
|
||||||
if(result != RETURN_OK) {
|
if(result != RETURN_OK) {
|
||||||
object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
|
object_id_t targetObjectId = hkManager->getCreatorObjectId();
|
||||||
reportReadCommitError("LocalPoolVector", result, false, targetObjectId,
|
reportReadCommitError("LocalPoolVector", result, false, targetObjectId,
|
||||||
localPoolId);
|
localPoolId);
|
||||||
return result;
|
return result;
|
||||||
|
@ -1488,6 +1488,10 @@ void DeviceHandlerBase::setNormalDatapoolEntriesInvalid() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccessLocalPoolIF* DeviceHandlerBase::getAccessorHandle() {
|
||||||
|
return &hkManager;
|
||||||
|
}
|
||||||
|
|
||||||
void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType,
|
void DeviceHandlerBase::printWarningOrError(fsfw::OutputTypes errorType,
|
||||||
const char *functionName, ReturnValue_t errorCode,
|
const char *functionName, ReturnValue_t errorCode,
|
||||||
const char *errorPrint) {
|
const char *errorPrint) {
|
||||||
|
@ -517,11 +517,14 @@ protected:
|
|||||||
virtual ReturnValue_t initializeLocalDataPool(LocalDataPool& localDataPoolMap,
|
virtual ReturnValue_t initializeLocalDataPool(LocalDataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) override;
|
LocalDataPoolManager& poolManager) override;
|
||||||
|
|
||||||
|
|
||||||
/** Get the HK manager object handle */
|
/** Get the HK manager object handle */
|
||||||
LocalDataPoolManager* getHkManagerHandle() override;
|
LocalDataPoolManager* getHkManagerHandle() override;
|
||||||
|
|
||||||
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
||||||
|
|
||||||
|
AccessLocalPoolIF* getAccessorHandle() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Hook function for child handlers which is called once per
|
* @brief Hook function for child handlers which is called once per
|
||||||
* performOperation(). Default implementation is empty.
|
* performOperation(). Default implementation is empty.
|
||||||
|
@ -15,7 +15,7 @@ public:
|
|||||||
DeviceHandlerIF::DEFAULT_THERMAL_STATE_POOL_ID,
|
DeviceHandlerIF::DEFAULT_THERMAL_STATE_POOL_ID,
|
||||||
lp_id_t heaterRequestId =
|
lp_id_t heaterRequestId =
|
||||||
DeviceHandlerIF::DEFAULT_THERMAL_HEATING_REQUEST_POOL_ID):
|
DeviceHandlerIF::DEFAULT_THERMAL_HEATING_REQUEST_POOL_ID):
|
||||||
DeviceHandlerThermalSet(hkOwner->getObjectId(), setId,
|
DeviceHandlerThermalSet(hkOwner->getAccessorHandle()->getCreatorObjectId(), setId,
|
||||||
thermalStateId, heaterRequestId) {}
|
thermalStateId, heaterRequestId) {}
|
||||||
|
|
||||||
DeviceHandlerThermalSet(object_id_t deviceHandler, uint32_t setId =
|
DeviceHandlerThermalSet(object_id_t deviceHandler, uint32_t setId =
|
||||||
|
@ -134,6 +134,10 @@ uint32_t InternalErrorReporter::getStoreHits() {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccessLocalPoolIF* InternalErrorReporter::getAccessorHandle() {
|
||||||
|
return &poolManager;
|
||||||
|
}
|
||||||
|
|
||||||
void InternalErrorReporter::incrementStoreHits() {
|
void InternalErrorReporter::incrementStoreHits() {
|
||||||
mutex->lockMutex(timeoutType, timeoutMs);
|
mutex->lockMutex(timeoutType, timeoutMs);
|
||||||
storeHits++;
|
storeHits++;
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
virtual dur_millis_t getPeriodicOperationFrequency() const override;
|
virtual dur_millis_t getPeriodicOperationFrequency() const override;
|
||||||
virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
|
||||||
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
||||||
|
AccessLocalPoolIF* getAccessorHandle() override;
|
||||||
|
|
||||||
virtual ReturnValue_t initialize() override;
|
virtual ReturnValue_t initialize() override;
|
||||||
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
virtual ReturnValue_t initializeAfterTaskCreation() override;
|
||||||
|
Loading…
Reference in New Issue
Block a user