perform renaming
This commit is contained in:
@ -26,7 +26,7 @@ class SerialArrayListAdapter : public SerializeIF {
|
||||
ReturnValue_t result =
|
||||
SerializeAdapter::serialize(&list->size, buffer, size, maxSize, streamEndianness);
|
||||
count_t i = 0;
|
||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
|
||||
while ((result == returnvalue::OK) && (i < list->size)) {
|
||||
result =
|
||||
SerializeAdapter::serialize(&list->entries[i], buffer, size, maxSize, streamEndianness);
|
||||
++i;
|
||||
@ -56,7 +56,7 @@ class SerialArrayListAdapter : public SerializeIF {
|
||||
size_t* size, Endianness streamEndianness) {
|
||||
count_t tempSize = 0;
|
||||
ReturnValue_t result = SerializeAdapter::deSerialize(&tempSize, buffer, size, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
if (tempSize > list->maxSize()) {
|
||||
@ -65,7 +65,7 @@ class SerialArrayListAdapter : public SerializeIF {
|
||||
|
||||
list->size = tempSize;
|
||||
count_t i = 0;
|
||||
while ((result == HasReturnvaluesIF::RETURN_OK) && (i < list->size)) {
|
||||
while ((result == returnvalue::OK) && (i < list->size)) {
|
||||
result = SerializeAdapter::deSerialize(&list->front()[i], buffer, size, streamEndianness);
|
||||
++i;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ ReturnValue_t SerialBufferAdapter<count_t>::serialize(uint8_t** buffer, size_t*
|
||||
if (serializeLength) {
|
||||
ReturnValue_t result =
|
||||
SerializeAdapter::serialize(&bufferLength, buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -46,11 +46,11 @@ ReturnValue_t SerialBufferAdapter<count_t>::serialize(uint8_t** buffer, size_t*
|
||||
// set if non-const buffer is set.
|
||||
std::memcpy(*buffer, this->buffer, bufferLength);
|
||||
} else {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
*size += bufferLength;
|
||||
(*buffer) += bufferLength;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
template <typename count_t>
|
||||
@ -66,14 +66,14 @@ template <typename count_t>
|
||||
ReturnValue_t SerialBufferAdapter<count_t>::deSerialize(const uint8_t** buffer, size_t* size,
|
||||
Endianness streamEndianness) {
|
||||
if (this->buffer == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
if (serializeLength) {
|
||||
count_t lengthField = 0;
|
||||
ReturnValue_t result =
|
||||
SerializeAdapter::deSerialize(&lengthField, buffer, size, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
if (lengthField > bufferLength) {
|
||||
@ -86,7 +86,7 @@ ReturnValue_t SerialBufferAdapter<count_t>::deSerialize(const uint8_t** buffer,
|
||||
*size -= bufferLength;
|
||||
std::memcpy(this->buffer, *buffer, bufferLength);
|
||||
(*buffer) += bufferLength;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
} else {
|
||||
return STREAM_TOO_SHORT;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ class SerialLinkedListAdapter : public SinglyLinkedList<T>, public SerializeIF {
|
||||
count_t mySize = SinglyLinkedList<T>::getSize();
|
||||
ReturnValue_t result =
|
||||
SerializeAdapter::serialize(&mySize, buffer, size, maxSize, streamEndianness);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
@ -60,8 +60,8 @@ class SerialLinkedListAdapter : public SinglyLinkedList<T>, public SerializeIF {
|
||||
|
||||
static ReturnValue_t serialize(const LinkedElement<T>* element, uint8_t** buffer, size_t* size,
|
||||
size_t maxSize, Endianness streamEndianness) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
while ((result == HasReturnvaluesIF::RETURN_OK) and (element != nullptr)) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
while ((result == returnvalue::OK) and (element != nullptr)) {
|
||||
result = element->value->serialize(buffer, size, maxSize, streamEndianness);
|
||||
element = element->getNext();
|
||||
}
|
||||
@ -92,8 +92,8 @@ class SerialLinkedListAdapter : public SinglyLinkedList<T>, public SerializeIF {
|
||||
|
||||
static ReturnValue_t deSerialize(LinkedElement<T>* element, const uint8_t** buffer, size_t* size,
|
||||
Endianness streamEndianness) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
while ((result == HasReturnvaluesIF::RETURN_OK) and (element != nullptr)) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
while ((result == returnvalue::OK) and (element != nullptr)) {
|
||||
result = element->value->deSerialize(buffer, size, streamEndianness);
|
||||
element = element->getNext();
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ class SerializeAdapter {
|
||||
* SerializeIF::Endianness
|
||||
* @return
|
||||
* - @c BUFFER_TOO_SHORT The given buffer in is too short
|
||||
* - @c RETURN_FAILED Generic Error
|
||||
* - @c returnvalue::FAILED Generic Error
|
||||
* - @c RETURN_OK Successful serialization
|
||||
*/
|
||||
template <typename T>
|
||||
@ -64,14 +64,14 @@ class SerializeAdapter {
|
||||
* SerializeIF::Endianness
|
||||
* @return
|
||||
* - @c BUFFER_TOO_SHORT The given buffer in is too short
|
||||
* - @c RETURN_FAILED Generic Error
|
||||
* - @c returnvalue::FAILED Generic Error
|
||||
* - @c RETURN_OK Successful serialization
|
||||
*/
|
||||
template <typename T>
|
||||
static ReturnValue_t serialize(const T *object, uint8_t *const buffer, size_t *serSize,
|
||||
size_t maxSize, SerializeIF::Endianness streamEndianness) {
|
||||
if (object == nullptr or buffer == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
InternalSerializeAdapter<T, std::is_base_of<SerializeIF, T>::value> adapter;
|
||||
uint8_t **tempPtr = const_cast<uint8_t **>(&buffer);
|
||||
@ -113,7 +113,7 @@ class SerializeAdapter {
|
||||
* @return
|
||||
* - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object
|
||||
* - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected
|
||||
* - @c RETURN_FAILED Generic Error
|
||||
* - @c returnvalue::FAILED Generic Error
|
||||
* - @c RETURN_OK Successful deserialization
|
||||
*/
|
||||
template <typename T>
|
||||
@ -136,14 +136,14 @@ class SerializeAdapter {
|
||||
* @return
|
||||
* - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object
|
||||
* - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected
|
||||
* - @c RETURN_FAILED Generic Error
|
||||
* - @c returnvalue::FAILED Generic Error
|
||||
* - @c RETURN_OK Successful deserialization
|
||||
*/
|
||||
template <typename T>
|
||||
static ReturnValue_t deSerialize(T *object, const uint8_t *buffer, size_t *deserSize,
|
||||
SerializeIF::Endianness streamEndianness) {
|
||||
if (object == nullptr or buffer == nullptr) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
InternalSerializeAdapter<T, std::is_base_of<SerializeIF, T>::value> adapter;
|
||||
const uint8_t **tempPtr = &buffer;
|
||||
@ -200,7 +200,7 @@ class SerializeAdapter {
|
||||
std::memcpy(*buffer, &tmp, sizeof(T));
|
||||
*size += sizeof(T);
|
||||
(*buffer) += sizeof(T);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
} else {
|
||||
return SerializeIF::BUFFER_TOO_SHORT;
|
||||
}
|
||||
@ -226,7 +226,7 @@ class SerializeAdapter {
|
||||
}
|
||||
|
||||
*buffer += sizeof(T);
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
} else {
|
||||
return SerializeIF::STREAM_TOO_SHORT;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ class SerializeIF {
|
||||
* SerializeIF::Endianness
|
||||
* @return
|
||||
* - @c BUFFER_TOO_SHORT The given buffer in is too short
|
||||
* - @c RETURN_FAILED Generic error
|
||||
* - @c returnvalue::FAILED Generic error
|
||||
* - @c RETURN_OK Successful serialization
|
||||
*/
|
||||
[[nodiscard]] virtual ReturnValue_t serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||
@ -92,7 +92,7 @@ class SerializeIF {
|
||||
* @return
|
||||
* - @c STREAM_TOO_SHORT The input stream is too short to deSerialize the object
|
||||
* - @c TOO_MANY_ELEMENTS The buffer has more inputs than expected
|
||||
* - @c RETURN_FAILED Generic Error
|
||||
* - @c returnvalue::FAILED Generic Error
|
||||
* - @c RETURN_OK Successful deserialization
|
||||
*/
|
||||
virtual ReturnValue_t deSerialize(const uint8_t **buffer, size_t *size,
|
||||
|
Reference in New Issue
Block a user