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

Eliminate MONGO_INITIALIZER kruft

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: Needs Further Definition
    • Fix Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Sprint:
      Dev Tools 2019-05-20, Dev Tools 2019-06-03, Dev Tools 2019-06-17, Dev Tools 2019-09-09

      Description

      MONGO_INITIALIZER has some unnecessary API complexity.

      We don't need:
      MONGO_INITIALIZER_WITH_PREREQUISITES
      MONGO_INITIALIZER_GENERAL.

      `MONGO_INITIALIZER` can instead take a name and 2 optional parameters.

      MONGO_INITIALIZER(name)
      MONGO_INITIALIZER(name,prereqs)
      MONGO_INITIALIZER(name,prereqs,dependents)

      The preprocessor can handle this with a `_VA_ARGS_` arity selector idiom.

      We do not need the make_string_vector.h,cpp files at all.
      We can remove parens from prereqs and dependents preprocessor-tuples with the preprocessor, and rely on vector<string> to brace-init in place.
      This would eliminate the need to have the primitive NULL-terminated va_arg list API.

      We can just have the MONGO_INITIALIZER macro directly create `vector<string>` to give the registration API as temporaries and we can more gracefully handle empty lists as () instead of (NULL). At that point we don't need the MONGO_NO_PREREQUISITES or MONGO_NO_DEPENDENTS macros because the `()` is easier to remember than `(NULL)`.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-servicearch Backlog - Service Architecture
              Reporter:
              billy.donahue Billy Donahue
              Participants:
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: