minor improvements for fixed slot sequence
This commit is contained in:
parent
96babff67e
commit
cec12c0073
@ -138,23 +138,22 @@ ReturnValue_t FixedSlotSequence::checkSequence() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const {
|
ReturnValue_t FixedSlotSequence::intializeSequenceAfterTaskCreation() const {
|
||||||
std::set<ExecutableObjectIF*> uniqueObjects;
|
std::set<ExecutableObjectIF*> uniqueObjects = {};
|
||||||
uint32_t count = 0;
|
uint32_t failedCount = 0;
|
||||||
for (const auto& slot : slotList) {
|
for (const auto& slot : slotList) {
|
||||||
// Ensure that each unique object is initialized once.
|
// Ensure that each unique object is initialized once.
|
||||||
if (uniqueObjects.find(slot.executableObject) == uniqueObjects.end()) {
|
if (uniqueObjects.find(slot.executableObject) == uniqueObjects.end()) {
|
||||||
ReturnValue_t result = slot.executableObject->initializeAfterTaskCreation();
|
ReturnValue_t result = slot.executableObject->initializeAfterTaskCreation();
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
count++;
|
failedCount++;
|
||||||
}
|
}
|
||||||
uniqueObjects.emplace(slot.executableObject);
|
uniqueObjects.emplace(slot.executableObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (count > 0) {
|
if (failedCount > 0) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << "FixedSlotSequence::intializeSequenceAfterTaskCreation:"
|
sif::error << "FixedSlotSequence::intializeSequenceAfterTaskCreation:"
|
||||||
"Counted "
|
"Counted " << failedCount << " failed initializations" << std::endl;
|
||||||
<< count << " failed initializations!" << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_FAILED;
|
return HasReturnvaluesIF::RETURN_FAILED;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user