Closed bocchino closed 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.
This PR fixes an issue with copying data product containers. A
DpContainer
contains anFw::ExternalSerializeBuffer
as a member that provides a view into theFw::Buffer
that it owns. When aDpContainer
was copied via copy construction or copy assignment, theExternalSerializeBuffer
member was not being copied correctly.I did the following:
ExternalSerializeBuffer
.ExternalSerializeBuffer
:ExternalSerializeBufferWithDataCopy
andExternalSerializeBufferWithMemberCopy
. Each derived class adds just that kind of copy semantics to the base class.DpContainer
so that theExternalSerializeBuffer
has typeExternalSerializeBufferWithMemberCopy
. The slice is owned by theDpContainer
, so this is the behavior we want.FppTest/dp
to verify that the container assignment is working.SerializeBufferBase
protected, so that assigning into aSerializeBufferBase
reference is not allowed.SerializeBufferBase
reference, in a way that was not necessary.@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.