hk manager optional now

This commit is contained in:
Robin Müller 2020-12-26 23:16:33 +01:00
parent b469340ef4
commit e35c2cd604

View File

@ -34,13 +34,9 @@ LocalPoolDataSetBase::LocalPoolDataSetBase(sid_t sid,
PoolDataSetBase(registeredVariablesArray, maxNumberOfVariables) {
HasLocalDataPoolIF* hkOwner = objectManager->get<HasLocalDataPoolIF>(
sid.objectId);
if(hkOwner == nullptr) {
// Configuration error.
sif::error << "LocalPoolDataSetBase::LocalPoolDataSetBase: Owner "
<< "invalid!" << std::endl;
return;
if(hkOwner != nullptr) {
hkManager = hkOwner->getHkManagerHandle();
}
hkManager = hkOwner->getHkManagerHandle();
this->sid = sid;
mutex = MutexFactory::instance()->createMutex();
@ -50,8 +46,11 @@ LocalPoolDataSetBase::~LocalPoolDataSetBase() {
}
ReturnValue_t LocalPoolDataSetBase::lockDataPool(uint32_t timeoutMs) {
MutexIF* mutex = hkManager->getMutexHandle();
return mutex->lockMutex(MutexIF::TimeoutType::WAITING, timeoutMs);
if(hkManager != nullptr) {
MutexIF* mutex = hkManager->getMutexHandle();
return mutex->lockMutex(MutexIF::TimeoutType::WAITING, timeoutMs);
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t LocalPoolDataSetBase::serializeWithValidityBuffer(uint8_t **buffer,
@ -127,8 +126,11 @@ ReturnValue_t LocalPoolDataSetBase::deSerializeWithValidityBuffer(
}
ReturnValue_t LocalPoolDataSetBase::unlockDataPool() {
MutexIF* mutex = hkManager->getMutexHandle();
return mutex->unlockMutex();
if(hkManager != nullptr) {
MutexIF* mutex = hkManager->getMutexHandle();
return mutex->unlockMutex();
}
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t LocalPoolDataSetBase::serializeLocalPoolIds(uint8_t** buffer,