Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77577

Make IDL compiler generate “movable” getter methods

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Service Arch

    Description

      IDL compiler can generate class definitions with getter methods for the member fields.

      The instances of the generated classes may be used in various places in the code and we could avoid copying values of their member fields if there was a way of moving field values.

      This is not as simple as one could think as generated classes maintain a `_hasXField` boolean flag that indicates if the given field contains a value. This flag would need to be checked and set to false on value being moved.

      One proposal discussed with billy.donahue@mongodb.com is to generate:

      const Foo& getFoo() const;
      void setFoo(Foo);
      Foo takeFoo(); 

      Attachments

        Activity

          People

            backlog-server-servicearch Backlog - Service Architecture
            denis.grebennicov@mongodb.com Denis Grebennicov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: