1
0
forked from fsfw/fsfw

DHB ctor simplified

This commit is contained in:
2020-07-09 16:31:33 +02:00
parent 32ef807341
commit 5a351474d2
6 changed files with 24 additions and 10 deletions

View File

@ -29,7 +29,7 @@ ReturnValue_t FailureIsolationBase::initialize() {
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
if (ownerId != 0) {
if (faultTreeParent != objects::NO_OBJECT) {
result = manager->subscribeToAllEventsFrom(eventQueue->getId(), ownerId);
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
@ -41,10 +41,15 @@ ReturnValue_t FailureIsolationBase::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
}
if (faultTreeParent != 0) {
if (faultTreeParent != objects::NO_OBJECT) {
ConfirmsFailuresIF* parentIF = objectManager->get<ConfirmsFailuresIF>(
faultTreeParent);
if (parentIF == NULL) {
if (parentIF == nullptr) {
sif::error << "FailureIsolationBase::intialize: Parent object"
<< "invalid." << std::endl;
sif::error << "Make sure it implements ConfirmsFailuresIF."
<< std::endl;
return ObjectManagerIF::CHILD_INIT_FAILED;
return RETURN_FAILED;
}
eventQueue->setDefaultDestination(parentIF->getEventReceptionQueue());