2016-06-15 23:48:41 +02:00
|
|
|
#ifndef SERIALFIXEDARRAYLISTADAPTER_H_
|
|
|
|
#define SERIALFIXEDARRAYLISTADAPTER_H_
|
|
|
|
|
|
|
|
#include <framework/container/FixedArrayList.h>
|
|
|
|
#include <framework/serialize/SerialArrayListAdapter.h>
|
|
|
|
|
2019-08-28 14:50:24 +02:00
|
|
|
/**
|
|
|
|
* \ingroup serialize
|
|
|
|
*/
|
2016-06-15 23:48:41 +02:00
|
|
|
template<typename T, uint32_t MAX_SIZE, typename count_t = uint8_t>
|
|
|
|
class SerialFixedArrayListAdapter : public FixedArrayList<T, MAX_SIZE, count_t>, public SerializeIF {
|
|
|
|
public:
|
|
|
|
template<typename... Args>
|
|
|
|
SerialFixedArrayListAdapter(Args... args) : FixedArrayList<T, MAX_SIZE, count_t>(std::forward<Args>(args)...) {
|
|
|
|
}
|
2020-04-21 22:28:43 +02:00
|
|
|
ReturnValue_t serialize(uint8_t** buffer, size_t* size,
|
|
|
|
size_t maxSize, Endianness streamEndianness) const {
|
|
|
|
return SerialArrayListAdapter<T, count_t>::serialize(this, buffer, size, maxSize, streamEndianness);
|
2016-06-15 23:48:41 +02:00
|
|
|
}
|
2020-04-21 22:28:43 +02:00
|
|
|
size_t getSerializedSize() const {
|
2016-06-15 23:48:41 +02:00
|
|
|
return SerialArrayListAdapter<T, count_t>::getSerializedSize(this);
|
|
|
|
}
|
2020-04-21 22:28:43 +02:00
|
|
|
ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size,
|
|
|
|
Endianness streamEndianness) {
|
|
|
|
return SerialArrayListAdapter<T, count_t>::deSerialize(this, buffer, size, streamEndianness);
|
2016-06-15 23:48:41 +02:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* SERIALFIXEDARRAYLISTADAPTER_H_ */
|