Skip to content

Code Generation

Andrei Tumbar edited this page Mar 3, 2025 · 9 revisions

Below we set forth the plan for the current version of code generation. As FPP becomes more mature, we will phase out the use of XML.

XML

Types:

  1. Convert each struct definition to a SerializableAi.xml file.

  2. Convert each enum definition to an EnumAi.xml file.

  3. Convert each array definition to an ArrayAi.xml file.

Ports: Convert each port definition to a PortAi.xml file.

Components: Convert each component definition to a ComponentAi.xml file.

Topologies: Convert each topology definition to a TopologyAppAi.xml file.

C++

Constants: Generate a header file FppConstants.hpp containing constant definitions.

Types:

  1. Convert each struct definition to SerializableAc.{hpp,cpp} files.

  2. Convert each enum definition to an EnumAc.{hpp,cpp} files.

  3. Convert each array definition to an ArrayAc.{hpp,cpp} files.

  4. Convert each type alias definition to a TypeAc.hpp file. If the type supports a C definition, generate a corresponding TypeAc.h header. Types support being aliases in C if their referenced type is numeric (float or int) and it does not reside in a module (namespace)

Ports: Convert each port definition to PortAc.{hpp,cpp} files.

Components:

  1. Convert each component definition to ComponentAc.{hpp,cpp} files.

  2. Generate an implementation template for each component definition.

  3. Generate unit test files for each component definition (in development).

Topologies: Convert each topology definition to TopologyAc.{hpp,cpp} files.

JSON

Ground dictionary: Convert the ground dictionary to a JSON representation.

Model: Convert the FPP model (not including the ground dictionary) to a JSON representation.

Clone this wiki locally