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

Use explicit constructors for Control classes

    XMLWordPrintable

Details

    • 2

    Description

      We discovered on DM-22814 that some calls to deprecated code were accidentally compiling because code that called flags or settings was being implicitly converted to calls that used Control objects. This is unsafe, since the order of constructor arguments to a Control object is not necessarily the same as the order of settings to a function, especially one that doesn't need all settings.

      Make the constructors explicit for all of the following classes (as of C++11, this includes argument lists of any length, as implicit constructors enable list-initialization).

      • afw::math::ApproximateControl
      • afw::math::BackgroundControl
      • afw::math::ConvolutionControl
      • afw::math::StatisticsControl
      • meas::modelfit::GeneralPsfFitterComponentControl

      This list omits those Control classes that can only take a zero-argument constructor, as these are unlikely to ever be called in a way that uses implicit conversion. There are dozens of such classes, primarily associated with the meas packages.

      Attachments

        Issue Links

          Activity

            Parejkoj John Parejko added a comment -

            A search of my `lsstsw/build` only found potential errors in `afw/examples`, so I think at least in the pipelines code we're all safe. We can fix those bugged examples when we fix the above (if we even care about having C++ examples anyway...).

            Parejkoj John Parejko added a comment - A search of my `lsstsw/build` only found potential errors in `afw/examples`, so I think at least in the pipelines code we're all safe. We can fix those bugged examples when we fix the above (if we even care about having C++ examples anyway...).

            The C++ examples are included inline in the documentation, so at least until that all gets migrated to Sphinx, removing them would be nontrivial.

            krzys Krzysztof Findeisen added a comment - The C++ examples are included inline in the documentation, so at least until that all gets migrated to Sphinx, removing them would be nontrivial.

            People

              Unassigned Unassigned
              krzys Krzysztof Findeisen
              John Parejko, Kian-Tat Lim, Krzysztof Findeisen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Jenkins

                  No builds found.