Update SerialBufferAdapter #37

Open
opened 2020-04-17 17:47:43 +02:00 by mohr · 7 comments
Owner

Add Template parameter for element type.
This would allow (de)serializing arrays of arbitrary type but also need to respect endianness.

Add Template parameter for element type. This would allow (de)serializing arrays of arbitrary type but also need to respect endianness.
mohr added the
feature
label 2020-04-17 17:58:01 +02:00
Author
Owner

If the proposed parameter is added as second parameter with a default value, existing code should be still correct.

The current implementation is not header-only, which would need to be changed to allow arbitrary and not only preselected types. Right now, I do not see a reason not to change it to header-only.

If the proposed parameter is added as second parameter with a default value, existing code should be still correct. The current implementation is **not** header-only, which would need to be changed to allow arbitrary and not only preselected types. Right now, I do not see a reason not to change it to header-only.
Author
Owner

Also, use SerializeAdapter for all access to stored elements.

And fix deserialize to deserialize the length field.

Also, use SerializeAdapter for all access to stored elements. And fix deserialize to deserialize the length field.
mohr changed title from Add template Parameter to SerialBufferAdapter to change the type of the Array to Update SerialBufferAdapter 2020-04-21 11:25:40 +02:00
Owner

I made some slight SerialBufferAdapter changes, for example providing a setter function to set the internal buffer without ctor. Maybe this could be useful.

I'll create a pull request as soon as SerializeIF changes have been integrated.

I made some slight SerialBufferAdapter changes, for example providing a setter function to set the internal buffer without ctor. Maybe this could be useful. I'll create a pull request as soon as SerializeIF changes have been integrated.
Owner

I think this can be closed..

I think this can be closed..
Owner

I don't think so. "Add Template parameter for element type." is not implemented

I don't think so. "Add Template parameter for element type." is not implemented
Owner

I guess this means making SerialBufferAdapter header-only?

I guess this means making SerialBufferAdapter header-only?
Owner

It is a template for count_t at the moment.

template<typename count_t>
class SerialBufferAdapter: public SerializeIF

vs

template<typename T, typename count_t>
class SerialBufferAdapter: public SerializeIF

I'm not sure if we need arbitrary or just the typical integer/float/double variants. More complex types can use linked lists or so.

It is a template for count_t at the moment. ``` c++ template<typename count_t> class SerialBufferAdapter: public SerializeIF ``` vs ``` c++ template<typename T, typename count_t> class SerialBufferAdapter: public SerializeIF ``` I'm not sure if we need arbitrary or just the typical integer/float/double variants. More complex types can use linked lists or so.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fsfw/fsfw#37
No description provided.