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 symbolic constants for record sizes #399

Closed bocchino closed 3 months ago

bocchino commented 5 months ago

In the generated code, add a symbolic constant for the size of each fixed-size record. That will allow users to size containers in terms of the record sizes, which is more convenient than using the underlying types. For example, the user can say "give me a container that's big enough to hold 10 records R" instead of reasoning that record R has struct type S and saying "give me a container that's big enough to hold 10 pairs of (record id, type S)."

We can also add constexpr functions for array records, e.g., "give me the size of an array record R with 10 array elements."