Update and clean up HK and Local Pool Modules

This commit is contained in:
2024-12-12 16:15:02 +01:00
parent f0087d5b0d
commit 33f3ae2434
213 changed files with 4125 additions and 4972 deletions

View File

@ -0,0 +1,33 @@
#include "fsfw/datapool/SharedLocalDataset.h"
SharedLocalDataset::SharedLocalDataset(object_id_t objectId, structure_id_t sid, const size_t maxSize)
: SystemObject(objectId), SharedDatasetBase(sid, nullptr, maxSize), poolVarVector(maxSize) {
this->setContainer(poolVarVector.data());
datasetLock = MutexFactory::instance()->createMutex();
}
SharedLocalDataset::SharedLocalDataset(object_id_t objectId, localpool::SharedPool& sharedPool,
uint32_t setId, const size_t maxSize)
: SystemObject(objectId),
SharedDatasetBase(sharedPool, setId, nullptr, maxSize),
poolVarVector(maxSize) {
this->setContainer(poolVarVector.data());
datasetLock = MutexFactory::instance()->createMutex();
}
SharedLocalDataset::~SharedLocalDataset() { MutexFactory::instance()->deleteMutex(datasetLock); }
ReturnValue_t SharedLocalDataset::lockDataset(MutexIF::TimeoutType timeoutType,
dur_millis_t mutexTimeout) {
if (datasetLock != nullptr) {
return datasetLock->lockMutex(timeoutType, mutexTimeout);
}
return returnvalue::FAILED;
}
ReturnValue_t SharedLocalDataset::unlockDataset() {
if (datasetLock != nullptr) {
return datasetLock->unlockMutex();
}
return returnvalue::FAILED;
}