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

Eliminate MONGO_INITIALIZER kruft

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

      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)`.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: