Use the T4 templating engine to generate the boilerplate code for the interface wrappers. This will reduce the maintenance cost of adding new interface types as they become available from osvr-core. The wrappers are mostly boilerplate with a little bit of configuration:
- Name of the class to generate (e.g.
PositionInterface)
- What native methods to use for callback registration and getting the state.
- What type to use as the
IInterface<T> type param (e.g. Vec3 for PositionInterface).
- What type to use for the report value of the native callback (e.g.
PoseReport for PoseInterface)
- The field name of the "value" within the report type (e.g.
translation for PoseReport)
- The name of the extension method on
ClientContext to get an interface of that type (e.g. GetPositionInterface for PositionInterface), Unless we just want to use "Get" + nameOfClass by convention.
Use the T4 templating engine to generate the boilerplate code for the interface wrappers. This will reduce the maintenance cost of adding new interface types as they become available from osvr-core. The wrappers are mostly boilerplate with a little bit of configuration:
PositionInterface)IInterface<T>type param (e.g.Vec3forPositionInterface).PoseReportforPoseInterface)translationforPoseReport)ClientContextto get an interface of that type (e.g.GetPositionInterfaceforPositionInterface), Unless we just want to use "Get" + nameOfClass by convention.