nasa / fprime

F´ - A flight software and embedded systems framework
https://fprime.jpl.nasa.gov
Apache License 2.0
9.95k stars 1.28k forks source link

Fix copying of data product containers #2711

Closed bocchino closed 2 months ago

bocchino commented 2 months ago

This PR fixes an issue with copying data product containers. A DpContainer contains an Fw::ExternalSerializeBuffer as a member that provides a view into the Fw::Buffer that it owns. When a DpContainerwas copied via copy construction or copy assignment, the ExternalSerializeBuffer member was not being copied correctly.

I did the following:

@timcanham This PR pulls out the changes that I submitted to your DpCatalog branch. I thought it would be good to make a separate PR to mainline with just these changes.

bocchino commented 2 months ago

Note: If we had getSerializeRepr return an object, instead of a reference, then we could return Fw::ExternalSerializeBufferWithMemberCopy as suggested by @LeStarch. I wrote up an issue on it here: https://github.com/nasa/fprime/issues/2714.