fsfw/archive/datapoolglob/GlobalDataSet.cpp

49 lines
1.2 KiB
C++
Raw Normal View History

#include "../datapoolglob/GlobalDataPool.h"
#include "../datapoolglob/GlobalDataSet.h"
#include "../serviceinterface/ServiceInterfaceStream.h"
2020-05-17 01:17:11 +02:00
2020-07-14 15:45:03 +02:00
GlobDataSet::GlobDataSet(): PoolDataSetBase(
reinterpret_cast<PoolVariableIF**>(&registeredVariables),
DATA_SET_MAX_SIZE) {}
2020-05-17 01:17:11 +02:00
2020-05-17 23:41:28 +02:00
// Don't do anything with your variables, they are dead already!
// (Destructor is already called)
GlobDataSet::~GlobDataSet() {}
2020-05-17 01:17:11 +02:00
2020-06-05 20:33:57 +02:00
ReturnValue_t GlobDataSet::commit(bool valid, uint32_t lockTimeout) {
2020-05-17 01:17:11 +02:00
setEntriesValid(valid);
setSetValid(valid);
2020-06-05 20:33:57 +02:00
return commit(lockTimeout);
2020-05-17 01:17:11 +02:00
}
2020-06-05 20:33:57 +02:00
ReturnValue_t GlobDataSet::commit(uint32_t lockTimeout) {
2020-07-14 15:45:03 +02:00
return PoolDataSetBase::commit(lockTimeout);
}
bool GlobDataSet::isValid() const {
return this->valid;
2020-05-17 01:17:11 +02:00
}
ReturnValue_t GlobDataSet::unlockDataPool() {
2020-06-05 20:33:57 +02:00
return glob::dataPool.unlockDataPool();
2020-05-17 01:17:11 +02:00
}
2020-06-05 20:33:57 +02:00
ReturnValue_t GlobDataSet::lockDataPool(uint32_t timeoutMs) {
return glob::dataPool.lockDataPool(timeoutMs);
2020-05-17 01:17:11 +02:00
}
void GlobDataSet::setEntriesValid(bool valid) {
2020-05-17 23:41:28 +02:00
for (uint16_t count = 0; count < fillCount; count++) {
2020-05-17 01:17:11 +02:00
if (registeredVariables[count]->getReadWriteMode()
!= PoolVariableIF::VAR_READ) {
registeredVariables[count]->setValid(valid);
}
}
}
void GlobDataSet::setSetValid(bool valid) {
this->valid = valid;
}
2020-05-17 23:41:28 +02:00