took over serial array list adapter changes
This commit is contained in:
parent
328c1b7195
commit
1a62158f33
@ -1,13 +1,14 @@
|
||||
#ifndef FRAMEWORK_SERIALIZE_SERIALARRAYLISTADAPTER_H_
|
||||
#define FRAMEWORK_SERIALIZE_SERIALARRAYLISTADAPTER_H_
|
||||
#ifndef FSFW_SERIALIZE_SERIALARRAYLISTADAPTER_H_
|
||||
#define FSFW_SERIALIZE_SERIALARRAYLISTADAPTER_H_
|
||||
|
||||
#include "../container/ArrayList.h"
|
||||
#include "SerializeIF.h"
|
||||
#include "../container/ArrayList.h"
|
||||
#include <utility>
|
||||
|
||||
/**
|
||||
* @ingroup serialize
|
||||
* Also serializes length field !
|
||||
* @author baetz
|
||||
* @ingroup serialize
|
||||
*/
|
||||
template<typename T, typename count_t = uint8_t>
|
||||
class SerialArrayListAdapter : public SerializeIF {
|
||||
@ -27,8 +28,8 @@ public:
|
||||
buffer, size, maxSize, streamEndianness);
|
||||
count_t i = 0;
|
||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
|
||||
result = SerializeAdapter::serialize(&list->entries[i], buffer,
|
||||
size, maxSize, streamEndianness);
|
||||
result = SerializeAdapter::serialize(&list->entries[i], buffer, size,
|
||||
maxSize, streamEndianness);
|
||||
++i;
|
||||
}
|
||||
return result;
|
||||
@ -66,6 +67,7 @@ public:
|
||||
if (tempSize > list->maxSize()) {
|
||||
return SerializeIF::TOO_MANY_ELEMENTS;
|
||||
}
|
||||
|
||||
list->size = tempSize;
|
||||
count_t i = 0;
|
||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
|
||||
@ -76,10 +78,9 @@ public:
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
ArrayList<T, count_t> *adaptee;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /* FRAMEWORK_SERIALIZE_SERIALARRAYLISTADAPTER_H_ */
|
||||
#endif /* FSFW_SERIALIZE_SERIALARRAYLISTADAPTER_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user