Skip to content

T4 template generators for interface wrappers #16

@JeroMiya

Description

@JeroMiya

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions