some formatting stuff
This commit is contained in:
parent
036a887ea3
commit
4bffcf17fb
@ -1,18 +1,13 @@
|
|||||||
/**
|
#ifndef FRAMEWORK_SERIALIZE_SERIALARRAYLISTADAPTER_H_
|
||||||
* @file SerialArrayListAdapter.h
|
#define FRAMEWORK_SERIALIZE_SERIALARRAYLISTADAPTER_H_
|
||||||
* @brief This file defines the SerialArrayListAdapter class.
|
|
||||||
* @date 22.07.2014
|
|
||||||
* @author baetz
|
|
||||||
*/
|
|
||||||
#ifndef SERIALARRAYLISTADAPTER_H_
|
|
||||||
#define SERIALARRAYLISTADAPTER_H_
|
|
||||||
|
|
||||||
#include <framework/container/ArrayList.h>
|
#include <framework/container/ArrayList.h>
|
||||||
#include <framework/serialize/SerializeIF.h>
|
#include <framework/serialize/SerializeIF.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \ingroup serialize
|
* @ingroup serialize
|
||||||
|
* @author baetz
|
||||||
*/
|
*/
|
||||||
template<typename T, typename count_t = uint8_t>
|
template<typename T, typename count_t = uint8_t>
|
||||||
class SerialArrayListAdapter : public SerializeIF {
|
class SerialArrayListAdapter : public SerializeIF {
|
||||||
@ -25,14 +20,15 @@ public:
|
|||||||
return serialize(adaptee, buffer, size, maxSize, streamEndianness);
|
return serialize(adaptee, buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ReturnValue_t serialize(const ArrayList<T, count_t>* list, uint8_t** buffer, size_t* size,
|
static ReturnValue_t serialize(const ArrayList<T, count_t>* list,
|
||||||
size_t maxSize, Endianness streamEndianness) {
|
uint8_t** buffer, size_t* size, size_t maxSize,
|
||||||
|
Endianness streamEndianness) {
|
||||||
ReturnValue_t result = SerializeAdapter::serialize(&list->size,
|
ReturnValue_t result = SerializeAdapter::serialize(&list->size,
|
||||||
buffer, size, maxSize, streamEndianness);
|
buffer, size, maxSize, streamEndianness);
|
||||||
count_t i = 0;
|
count_t i = 0;
|
||||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
|
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
|
||||||
result = SerializeAdapter::serialize(&list->entries[i], buffer, size,
|
result = SerializeAdapter::serialize(&list->entries[i], buffer,
|
||||||
maxSize, streamEndianness);
|
size, maxSize, streamEndianness);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -58,7 +54,8 @@ public:
|
|||||||
return deSerialize(adaptee, buffer, size, streamEndianness);
|
return deSerialize(adaptee, buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
static ReturnValue_t deSerialize(ArrayList<T, count_t>* list, const uint8_t** buffer, size_t* size,
|
static ReturnValue_t deSerialize(ArrayList<T, count_t>* list,
|
||||||
|
const uint8_t** buffer, size_t* size,
|
||||||
Endianness streamEndianness) {
|
Endianness streamEndianness) {
|
||||||
count_t tempSize = 0;
|
count_t tempSize = 0;
|
||||||
ReturnValue_t result = SerializeAdapter::deSerialize(&tempSize,
|
ReturnValue_t result = SerializeAdapter::deSerialize(&tempSize,
|
||||||
@ -85,4 +82,4 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* SERIALARRAYLISTADAPTER_H_ */
|
#endif /* FRAMEWORK_SERIALIZE_SERIALARRAYLISTADAPTER_H_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user