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

Add FittedStar measurementCount increment/decrement method/operator

    XMLWordPrintable

    Details

      Description

      While fixing DM-7070, we discovered that FittedStar's handling of MeasurementCount is via a potentially dangerous int&-returning method. Better would be incrementMeasurementCount/decrementMeasurementCount methods (or could we just use the ++/-- operators?). It should only ever be incremented or decremented (or set to 0, but that happens on construction and in clearBeforeAssoc()).

      This would prevent accidentally overwriting it. We should also have the decrement raise an exception if the value would go below 0 (which it shouldn't, as it's a strict counter).

        Attachments

          Issue Links

            Activity

            Hide
            krzys Krzysztof Findeisen added a comment -

            I'd recommend against using ++ because it leads to a confusing API – just what does it mean to "increment a star"? Does that turn it into a binary?

            If you're trying to go for a shorter name, how about e.g. addMeasurement and removeMeasurement/clearMeasurement (depending on exactly what it means for Jointcal to decrement this)?

            Show
            krzys Krzysztof Findeisen added a comment - I'd recommend against using ++ because it leads to a confusing API – just what does it mean to "increment a star"? Does that turn it into a binary? If you're trying to go for a shorter name, how about e.g. addMeasurement and removeMeasurement / clearMeasurement (depending on exactly what it means for Jointcal to decrement this)?
            Hide
            yusra Yusra AlSayyad added a comment -

            John Parejko Is this still an problem?

            Show
            yusra Yusra AlSayyad added a comment - John Parejko Is this still an problem?
            Hide
            Parejkoj John Parejko added a comment -

            This part of the code has not been fixed, so in that sense it is still a probably. It's not necessary to fix it if we're not continuing with jointcal though.

            Show
            Parejkoj John Parejko added a comment - This part of the code has not been fixed, so in that sense it is still a probably. It's not necessary to fix it if we're not continuing with jointcal though.

              People

              Assignee:
              Parejkoj John Parejko
              Reporter:
              Parejkoj John Parejko
              Watchers:
              John Parejko, Krzysztof Findeisen, Simon Krughoff, Yusra AlSayyad
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.