local pool variable error handling improved

This commit is contained in:
Robin Müller 2021-01-07 20:29:38 +01:00
parent 44a5430555
commit d3fbe4a3b9

View File

@ -33,13 +33,10 @@ 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) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
sif::warning << "LocalPoolVariable: Invalid read write " reportReadCommitError("LocalPoolVector",
"mode for read call." << std::endl; PoolVariableIF::INVALID_READ_WRITE_MODE, true, targetObjectId,
#else localPoolId);
fsfw::printWarning("LocalPoolVariable: Invalid read write "
"mode for read call.\n\r");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
return PoolVariableIF::INVALID_READ_WRITE_MODE; return PoolVariableIF::INVALID_READ_WRITE_MODE;
} }
@ -83,13 +80,10 @@ 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) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 object_id_t targetObjectId = hkManager->getOwner()->getObjectId();
sif::warning << "LocalPoolVariable: Invalid read write " reportReadCommitError("LocalPoolVector",
"mode for commit call." << std::endl; PoolVariableIF::INVALID_READ_WRITE_MODE, false, targetObjectId,
#else localPoolId);
fsfw::printWarning("LocalPoolVariable: Invalid read write "
"mode for commit call.\n\r");
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
return PoolVariableIF::INVALID_READ_WRITE_MODE; return PoolVariableIF::INVALID_READ_WRITE_MODE;
} }
PoolEntry<T>* poolEntry = nullptr; PoolEntry<T>* poolEntry = nullptr;