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

Add C++11 inheritance safeguards to afw

    XMLWordPrintable

    Details

      Description

      C++11 allows programmers with more control over how classes are inherited and how methods are overridden. These features allow for safer code, particularly when applied to fundamental data types. They can be retrofitted onto existing code fairly mechanically.

      This ticket includes the following changes:

      • Declare standalone types final (do not do this for any type that's part of an inheritance hierarchy, even if it appears to be intended as a leaf class).
      • Declare methods final only if their existing documentation forbids overriding them.
      • Declare overriding methods override.

      The classes covered by this ticket are (based on assumed simplicity, and therefore subject to change):

      • afw::cameraGeom::CameraPoint
      • afw::cameraGeom::CameraSys
      • afw::cameraGeom::CameraSysPrefix
      • afw::cameraGeom::Orientation
      • afw::coord::Coord and its subclasses
      • afw::coord::Observatory
      • afw::coord::Weather
      • afw::detection::Threshold
      • afw::geom::Angle
      • afw::geom::AngleUnit
      • afw::geom::Box
      • afw::geom::CoordinateBase and its subclasses
      • afw::geom::CoordinateExpr
      • afw::geom::Span
      • afw::geom::SpherePoint
      • afw::geom::polygon::Polygon
      • afw::image::Calib
      • afw::image::Color
      • afw::image::DefectBase
      • afw::image::Filter
      • afw::image::FilterProperty
      • afw::math::FitResults
      • afw::math::Function and its subclasses
      • afw::math::MaskedVector
      • afw::math::Statistics
      • afw::table::BaseRecord and its subclasses
      • afw::table::ConstFunctorKey
      • afw::table::FieldBase and its subclasses
      • afw::table::InputFunctorKey and its subclasses
      • afw::table::KeyBase and its subclasses
      • afw::table::Match
      • afw::table::OutputFunctorKey and its subclasses
      • afw::table::ReferenceFunctorKey
      • afw::table::SchemaItem
      • afw::table::io::Persistable
      • afw::table::io::PersistableFacade

        Attachments

          Issue Links

            Activity

            Hide
            krzys Krzysztof Findeisen added a comment -

            Adding override should be unneccessary after DM-13744. The other changes still apply.

            Show
            krzys Krzysztof Findeisen added a comment - Adding override should be unneccessary after DM-13744 . The other changes still apply.
            Hide
            krzys Krzysztof Findeisen added a comment - - edited

            Hi Russell Owen, would you be willing to review this issue? I added override (as you know) and final classes, but found no methods that met my criteria for safely declaring them final. Perhaps they all got removed since this issue was first opened.

            EDIT: since we're still having Jira problems, the PRs are geom#13 and afw#390.

            Show
            krzys Krzysztof Findeisen added a comment - - edited Hi Russell Owen , would you be willing to review this issue? I added override (as you know) and final classes, but found no methods that met my criteria for safely declaring them final . Perhaps they all got removed since this issue was first opened. EDIT: since we're still having Jira problems, the PRs are geom#13 and afw#390 .
            Hide
            rowen Russell Owen added a comment -

            These changes look fine and I built afw on macOS with no override warnings (a huge improvement). Thank you very much for doing this.

            Show
            rowen Russell Owen added a comment - These changes look fine and I built afw on macOS with no override warnings (a huge improvement). Thank you very much for doing this.

              People

              Assignee:
              krzys Krzysztof Findeisen
              Reporter:
              krzys Krzysztof Findeisen
              Reviewers:
              Russell Owen
              Watchers:
              Krzysztof Findeisen, Russell Owen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: