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

Add noexcept specifiers to applicable methods in afw

    XMLWordPrintable

    Details

      Description

      C++11 methods that are declared noexcept enable compilers to streamline code that calls them, in some cases (e.g., STL code) unlocking more efficient algorithms that would be unsafe with throwing methods. These changes are most useful for low-level types, whose methods are also the most likely to be provably non-throwing.

      This ticket shall add the noexcept specifier to any methods that are guaranteed not to throw and are unlikely to be modified to throw exceptions in the future (e.g., trivial getters will usually qualify, but methods for which some inputs are invalid will not even if the existing code performs no input validation). Particular attention shall be paid to constructors, assignment operators, and std::swap implementations, as these are the methods where noexcept provides the biggest gains.

      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 -

            Problems can be spotted using clang-tidy -checks='-*,*noexcept*'.

            Show
            krzys Krzysztof Findeisen added a comment - Problems can be spotted using clang-tidy -checks='-*,*noexcept*' .
            Hide
            krzys Krzysztof Findeisen added a comment -

            This ticket ended up being split across six packages because of the (re)creation of lsst::geom and the inheritance implications of noexcept.

            Jim Bosch, would you be willing to review the changes to afw, plus all the meas_* packages (which are just updates to isPersistable for subclasses of table::io::Persistable)? It's about 470 lines of changes, but of course if there are more methods in afw that you think should be noexcept, please let me know.

            Russell Owen, would you be willing to review the changes to geom? I've changed 400 lines; again, please let me know if you spot anything that should have been converted but wasn't.

            Show
            krzys Krzysztof Findeisen added a comment - This ticket ended up being split across six packages because of the (re)creation of lsst::geom and the inheritance implications of noexcept . Jim Bosch , would you be willing to review the changes to afw , plus all the meas_* packages (which are just updates to isPersistable for subclasses of table::io::Persistable )? It's about 470 lines of changes, but of course if there are more methods in afw that you think should be noexcept , please let me know. Russell Owen , would you be willing to review the changes to geom ? I've changed 400 lines; again, please let me know if you spot anything that should have been converted but wasn't.
            Hide
            jbosch Jim Bosch added a comment -

            My review is complete; comments on the PRs.

            Show
            jbosch Jim Bosch added a comment - My review is complete; comments on the PRs.
            Hide
            rowen Russell Owen added a comment -

            geom looks great (I had a few little things on github). I believe Jim Bosch finished his review, so am marking this as Reviewed.

            Show
            rowen Russell Owen added a comment - geom looks great (I had a few little things on github). I believe Jim Bosch finished his review, so am marking this as Reviewed.

              People

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

                Dates

                Created:
                Updated:
                Resolved: