#ifndef SERIALFIXEDARRAYLISTADAPTER_H_ #define SERIALFIXEDARRAYLISTADAPTER_H_ #include #include /** * @brief This adapter provides an interface for SerializeIF to serialize and deserialize * buffers with a header containing the buffer length. * @details * Can be used by SerialLinkedListAdapter by using this type in * SerializeElement<> * Buffers with a size header inside that class can be declared with * SerialFixedArrayListAdapter. * typeOfMaxData specifies the data type of the buffer header containing the buffer size that follows * and MAX_BUFFER_LENGTH specifies the maximum allowed value for the buffer size. * The sequence of objects is defined in the constructor by using the setStart and setNext functions. * * @ingroup serialize */ template class SerialFixedArrayListAdapter : public FixedArrayList, public SerializeIF { public: template SerialFixedArrayListAdapter(Args... args) : FixedArrayList(std::forward(args)...) { } ReturnValue_t serialize(uint8_t** buffer, uint32_t* size, const uint32_t max_size, bool bigEndian) const { return SerialArrayListAdapter::serialize(this, buffer, size, max_size, bigEndian); } uint32_t getSerializedSize() const { return SerialArrayListAdapter::getSerializedSize(this); } ReturnValue_t deSerialize(const uint8_t** buffer, int32_t* size, bool bigEndian) { return SerialArrayListAdapter::deSerialize(this, buffer, size, bigEndian); } }; #endif /* SERIALFIXEDARRAYLISTADAPTER_H_ */