49 lines
1.2 KiB
C++
49 lines
1.2 KiB
C++
#include "../datapoolglob/GlobalDataPool.h"
|
|
#include "../datapoolglob/GlobalDataSet.h"
|
|
#include "../serviceinterface/ServiceInterfaceStream.h"
|
|
|
|
GlobDataSet::GlobDataSet(): PoolDataSetBase(
|
|
reinterpret_cast<PoolVariableIF**>(®isteredVariables),
|
|
DATA_SET_MAX_SIZE) {}
|
|
|
|
// Don't do anything with your variables, they are dead already!
|
|
// (Destructor is already called)
|
|
GlobDataSet::~GlobDataSet() {}
|
|
|
|
ReturnValue_t GlobDataSet::commit(bool valid, uint32_t lockTimeout) {
|
|
setEntriesValid(valid);
|
|
setSetValid(valid);
|
|
return commit(lockTimeout);
|
|
}
|
|
|
|
ReturnValue_t GlobDataSet::commit(uint32_t lockTimeout) {
|
|
return PoolDataSetBase::commit(lockTimeout);
|
|
}
|
|
|
|
bool GlobDataSet::isValid() const {
|
|
return this->valid;
|
|
}
|
|
|
|
ReturnValue_t GlobDataSet::unlockDataPool() {
|
|
return glob::dataPool.unlockDataPool();
|
|
}
|
|
|
|
ReturnValue_t GlobDataSet::lockDataPool(uint32_t timeoutMs) {
|
|
return glob::dataPool.lockDataPool(timeoutMs);
|
|
}
|
|
|
|
void GlobDataSet::setEntriesValid(bool valid) {
|
|
for (uint16_t count = 0; count < fillCount; count++) {
|
|
if (registeredVariables[count]->getReadWriteMode()
|
|
!= PoolVariableIF::VAR_READ) {
|
|
registeredVariables[count]->setValid(valid);
|
|
}
|
|
}
|
|
}
|
|
|
|
void GlobDataSet::setSetValid(bool valid) {
|
|
this->valid = valid;
|
|
}
|
|
|
|
|