Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-21382

Separate GenericMap's visitor API from its implementation

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: To Do
    • Resolution: Unresolved
    • Fix Version/s: None
    • Component/s: afw
    • Labels:
      None

      Description

      The GenericMap.apply methods take a user-defined callable ("visitor") that must have a method template or explicit method overload for each type listed in the protected GenericMap.StorableType. This adds a burden to users, because changes to StorableType may break all visitors. The burden is particularly onerous because boost::variant cannot handle implicitly convertible types well, so, for example, a visitor must have separate float and double overloads.

      Reduce the coupling between apply's visitors and StorableType so that a user can, for example, provide a single integer and a single floating-point method.

      It may be possible to do this by providing an adapter that fully enumerates StorableType's types, but delegates to a (possibly less comprehensive) user-defined visitor using ordinary function dispatch. Note that const visitors are allowed to accept arguments by any combination of value and reference to const, and that mutating vistors may, in addition, take arguments by reference to non-const. The adapter must be flexible enough to behave naturally for any combination of these three cases.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              krzys Krzysztof Findeisen
              Reporter:
              krzys Krzysztof Findeisen
              Watchers:
              Jim Bosch, Krzysztof Findeisen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Jenkins

                  No builds found.