Generate C++ Trait/Specification from yaml definition.
Why
We anticipate an up-tick in C++ hosts in Y23.
Requirements
User
As a Host integrating OpenAssetIO into my project, I need to be able to define additional traits that are specific to my integration. I need to ensure these traits are available to any other OpenAssetIO user, regardless of their implementation of choice, and that they can be generated for new languages as they become available. This ensures that all parties involved in the ecosystem have the same source of truth to avoid interoperability issues.
As a host integrator, it should be simple to incorporate custom trait definitions into my existing build [and compile] workflow without being required to adopt a different build system.
As an OpenAssetIO integrator (Host or Manager) I wish to be able to easily use Traits defined in common libraries such as the MediaCreation project, without complex and onerous build steps.
As a maintainer of a common trait collection, I wish to be able to publish the trait collection (using a mechanism of my choice) as a library for C++ in the same way as we do for PyPI etc. such that it can be easily consumed by downstream projects.
Functional
The autogenerated code should not be opinionated about which build or packaging approach is used by a project incorporating traitgen code into their pipeline.
Generated traits should fail to link to ABI incompatible OpenAssetIO version.
Generated trait code should contain its own (traitgen centric) ABI namespace using the conventions established with the OpenAssetIO ABI namespace mechanism (ie most recent major version that broke ABI).
Generated trait code should use the same trait package namespace not openassetio.
Generated code should share the same namespace structure as Python unless otherwise dictated by the lanuguage.
Generated code should contain Doxygen formatted comments to describe the code, the nature of the traits/properties.
Technical
C++17/CY22 support
Linux/Mac/Windows
ACs
C++ code can be generated using the cpp generator
Autogenerated code has parity with Python in terms of detail of docstrings
Test coverage/CI has parity with Python (+ any new language specific considerations)
Code generation produces a src only package with no compiled output
README.md lists supported languages.
C++ code namespace(s) mirror python package structure
TraitGen ABI version encoded in inline namespace
C++17
API feature/naming parity with Python (flag any incongruous consequences).
Out of scope
No need extend documentation/examples beyond what already exists for Python.
No need to expose version numbers programtically
No build infrastructure or tooling to be generated
Rather than add a bunch of tasks to this ticket that aren't related only to C++ codegen, I've added #14 to track the additional tasks discovered/decided during this work.
What
Generate C++ Trait/Specification from yaml definition.
Why
We anticipate an up-tick in C++ hosts in Y23.
Requirements
User
As a Host integrating OpenAssetIO into my project, I need to be able to define additional traits that are specific to my integration. I need to ensure these traits are available to any other OpenAssetIO user, regardless of their implementation of choice, and that they can be generated for new languages as they become available. This ensures that all parties involved in the ecosystem have the same source of truth to avoid interoperability issues.
As a host integrator, it should be simple to incorporate custom trait definitions into my existing build [and compile] workflow without being required to adopt a different build system.
As an OpenAssetIO integrator (Host or Manager) I wish to be able to easily use Traits defined in common libraries such as the MediaCreation project, without complex and onerous build steps.
As a maintainer of a common trait collection, I wish to be able to publish the trait collection (using a mechanism of my choice) as a library for C++ in the same way as we do for PyPI etc. such that it can be easily consumed by downstream projects.
Functional
The autogenerated code should not be opinionated about which build or packaging approach is used by a project incorporating traitgen code into their pipeline.
Generated traits should fail to link to ABI incompatible OpenAssetIO version.
Generated trait code should contain its own (traitgen centric) ABI namespace using the conventions established with the OpenAssetIO ABI namespace mechanism (ie most recent major version that broke ABI).
Generated trait code should use the same trait package namespace not
openassetio
.Generated code should share the same namespace structure as Python unless otherwise dictated by the lanuguage.
Generated code should contain Doxygen formatted comments to describe the code, the nature of the traits/properties.
Technical
ACs
cpp
generatorREADME.md
lists supported languages.Out of scope
Tasks