Generate builder constructors for IDL-defined structs

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: IDL
    • None
    • Server Programmability
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Optional fields need to be set manually after construction of IDL-generated classes, which is cumbersome. Instead, IDL could generate constructor(s) that allow one to set optional arguments, perhaps through a builder API.

      e.g.

      auto foo = MyIdlStruct::builder(requiredArg1, requiredArg2).setOptionalArg("bar").build(); 

      This would avoid the need to construct instances of IDL-generated classes in immediately invoked lambdas or over the course of multiple setX statements.

              Assignee:
              Unassigned
              Reporter:
              Patrick Freed
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: