OpenAssetIO / OpenAssetIO-TraitGen

A code generation tool that produces OpenAssetIO Traits and Specifications from a simple YAML description.
Apache License 2.0
6 stars 3 forks source link

[Core] Add trait `static` property accessors/mutators #24

Closed feltech closed 5 months ago

feltech commented 1 year ago

What

Add static variants of trait property accessors and mutators, e.g. getMyPropertyFrom(traitsData) / setMyPropertyTo(traitsData)

Why

Currently trait view classes require construction around a TraitsDataPtr before property accessors/mutators can be used. This involves a copy-construction of the TraitsDataPtr. If the user only cares to query a particular property, then that copy-construction is a waste of resources.

Note that we already have static variants of imbue/isImbued, i.e. imbueTo/isImbuedTo, so doing similar for properties adds some functional parity.

elliotcmorris commented 5 months ago

Dupe of https://github.com/OpenAssetIO/OpenAssetIO-TraitGen/issues/35