Merge remote-tracking branch 'origin/eive/develop' into mueller/master
This commit is contained in:
commit
cd3153b464
@ -10,16 +10,24 @@ class HybridIterator : public LinkedElement<T>::Iterator, public ArrayList<T, co
|
||||
HybridIterator() {}
|
||||
|
||||
HybridIterator(typename LinkedElement<T>::Iterator *iter)
|
||||
: LinkedElement<T>::Iterator(*iter), value(iter->value), linked(true) {}
|
||||
: LinkedElement<T>::Iterator(*iter), value(iter->value), linked(true) {
|
||||
if(iter != nullptr) {
|
||||
value = iter->value;
|
||||
}
|
||||
}
|
||||
|
||||
HybridIterator(LinkedElement<T> *start)
|
||||
: LinkedElement<T>::Iterator(start), value(start->value), linked(true) {}
|
||||
: LinkedElement<T>::Iterator(start), linked(true) {
|
||||
if(start != nullptr) {
|
||||
value = start->value;
|
||||
}
|
||||
}
|
||||
|
||||
HybridIterator(typename ArrayList<T, count_t>::Iterator start,
|
||||
typename ArrayList<T, count_t>::Iterator end)
|
||||
: ArrayList<T, count_t>::Iterator(start), value(start.value), linked(false), end(end.value) {
|
||||
if (value == this->end) {
|
||||
value = NULL;
|
||||
value = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ PoolEntry<T>::PoolEntry(std::initializer_list<T> initValues, bool setValid)
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
PoolEntry<T>::PoolEntry(T* initValue, uint8_t setLength, bool setValid)
|
||||
PoolEntry<T>::PoolEntry(const T* initValue, uint8_t setLength, bool setValid)
|
||||
: length(setLength), valid(setValid) {
|
||||
this->address = new T[this->length]();
|
||||
if (initValue != nullptr) {
|
||||
|
@ -65,7 +65,7 @@ class PoolEntry : public PoolEntryIF {
|
||||
* @param setValid
|
||||
* Sets the initialization flag. It is invalid by default.
|
||||
*/
|
||||
PoolEntry(T* initValue, uint8_t setLength = 1, bool setValid = false);
|
||||
PoolEntry(const T* initValue, uint8_t setLength = 1, bool setValid = false);
|
||||
|
||||
//! Explicitely deleted copy ctor, copying is not allowed.
|
||||
PoolEntry(const PoolEntry&) = delete;
|
||||
|
@ -179,6 +179,9 @@ class MatchTree : public SerializeableMatcherIF<T>, public BinaryTree<Serializea
|
||||
virtual ReturnValue_t cleanUpElement(iterator position) { return HasReturnvaluesIF::RETURN_OK; }
|
||||
|
||||
bool matchSubtree(iterator iter, T number) {
|
||||
if(iter == nullptr) {
|
||||
return false;
|
||||
}
|
||||
bool isMatch = iter->match(number);
|
||||
if (isMatch) {
|
||||
if (iter.left() == this->end()) {
|
||||
|
@ -30,11 +30,11 @@ ReturnValue_t Subsystem::checkSequence(HybridIterator<ModeListEntry> iter,
|
||||
return FALLBACK_SEQUENCE_DOES_NOT_EXIST;
|
||||
}
|
||||
|
||||
if (iter.value == NULL) {
|
||||
if (iter.value ==nullptr) {
|
||||
return NO_TARGET_TABLE;
|
||||
}
|
||||
|
||||
for (; iter.value != NULL; ++iter) {
|
||||
for (; iter.value != nullptr; ++iter) {
|
||||
if (!existsModeTable(iter->getTableId())) {
|
||||
return TABLE_DOES_NOT_EXIST;
|
||||
} else {
|
||||
@ -66,13 +66,18 @@ HybridIterator<ModeListEntry> Subsystem::getCurrentTable() {
|
||||
void Subsystem::performChildOperation() {
|
||||
if (isInTransition) {
|
||||
if (commandsOutstanding <= 0) { // all children of the current table were commanded and replied
|
||||
if (currentSequenceIterator.value == NULL) { // we're through with this sequence
|
||||
if (currentSequenceIterator.value == nullptr) { // we're through with this sequence
|
||||
if (checkStateAgainstTable(currentTargetTable, targetSubmode) == RETURN_OK) {
|
||||
setMode(targetMode, targetSubmode);
|
||||
isInTransition = false;
|
||||
return;
|
||||
} else {
|
||||
transitionFailed(TARGET_TABLE_NOT_REACHED, getSequence(targetMode)->getTableId());
|
||||
Mode_t tableId = 0;
|
||||
auto seq = getSequence(targetMode);
|
||||
if(seq.value != nullptr) {
|
||||
tableId = seq->getTableId();
|
||||
}
|
||||
transitionFailed(TARGET_TABLE_NOT_REACHED, tableId);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -248,10 +253,13 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage *message) {
|
||||
case ModeSequenceMessage::READ_TABLE: {
|
||||
ReturnValue_t result;
|
||||
Mode_t table = ModeSequenceMessage::getSequenceId(message);
|
||||
EntryPointer *entry = NULL;
|
||||
EntryPointer *entry = nullptr;
|
||||
result = modeTables.find(table, &entry);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != RETURN_OK or entry == nullptr) {
|
||||
replyToCommand(result, 0);
|
||||
if(entry == nullptr) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
SerializeIF *elements[2];
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef FSFW_SUBSYSTEM_SUBSYSTEM_H_
|
||||
#define FSFW_SUBSYSTEM_SUBSYSTEM_H_
|
||||
|
||||
#include <FSFWConfig.h>
|
||||
#include "fsfw/FSFW.h"
|
||||
|
||||
#include "../container/FixedArrayList.h"
|
||||
#include "../container/FixedMap.h"
|
||||
|
Loading…
Reference in New Issue
Block a user