nasa / fpp

F Prime Prime: A modeling language for F Prime
https://fprime.jpl.nasa.gov
Apache License 2.0
46 stars 31 forks source link

[Data products] Add support for incrementally building an array record #405

Open bocchino opened 4 months ago

bocchino commented 4 months ago

Currently, to construct an array record, you have to pass in an array of records. This is inconvenient in some cases.

For each array record R, we should add functions to start R, to add an element to R, and to finish R. We will need a state machine so that, for example, attempting to serialize a different kind of record while in the "adding elements to R" state causes an error. Starting a record R should fail if there is not enough room to hold the metadata for R. Adding an element should fail if there is not enough room to hold the element. If a container is sent in the "adding elements to R" state, then R should be implicitly finished before sending.