Skip to content

Code Generation

Rob Bocchino edited this page Aug 2, 2023 · 7 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.

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

  1. Convert the FPP model to a JSON representation.