fsfw/datapoollocal/LocalDataSet.cpp

36 lines
888 B
C++
Raw Normal View History

2020-06-07 02:22:18 +02:00
#include <framework/datapoollocal/LocalDataPoolManager.h>
2020-05-17 01:17:11 +02:00
#include <framework/datapoollocal/LocalDataSet.h>
2020-06-07 02:22:18 +02:00
LocalDataSet::LocalDataSet(OwnsLocalDataPoolIF *hkOwner): DataSetBase() {
2020-06-05 20:34:34 +02:00
if(hkOwner != nullptr) {
hkManager = hkOwner->getHkManagerHandle();
}
else {
// config error, error output here.
2020-05-17 01:17:11 +02:00
}
}
2020-06-05 20:34:34 +02:00
LocalDataSet::LocalDataSet(object_id_t ownerId): DataSetBase() {
2020-06-07 02:22:18 +02:00
OwnsLocalDataPoolIF* hkOwner = objectManager->get<OwnsLocalDataPoolIF>(
2020-06-05 20:34:34 +02:00
ownerId);
if(hkOwner == nullptr) {
// config error, error output here.
}
hkManager = hkOwner->getHkManagerHandle();
2020-05-17 01:17:11 +02:00
}
LocalDataSet::~LocalDataSet() {
}
2020-06-05 20:34:34 +02:00
ReturnValue_t LocalDataSet::lockDataPool(uint32_t timeoutMs) {
MutexIF* mutex = hkManager->getMutexHandle();
return mutex->lockMutex(timeoutMs);
2020-05-17 01:17:11 +02:00
}
ReturnValue_t LocalDataSet::unlockDataPool() {
2020-06-05 20:34:34 +02:00
MutexIF* mutex = hkManager->getMutexHandle();
return mutex->unlockMutex();
2020-05-17 01:17:11 +02:00
}