libwave icon indicating copy to clipboard operation
libwave copied to clipboard

Refactor measurement containers

Open leokoppel opened this issue 7 years ago • 0 comments

Further to #41. Code duplication was noted in PR #82.

Reduce code duplication between the similar MeasurementContainer and LandmarkMeasurementContainer (and any other future variations).

This is done through static polymorphism, using CRTP (the technique used extensively by Eigen). References:

  • http://eli.thegreenplace.net/2011/05/17/the-curiously-recurring-template-pattern-in-c
  • https://stackoverflow.com/questions/4173254/what-is-the-curiously-recurring-template-pattern-crtp
  • https://stackoverflow.com/questions/6006614/c-static-polymorphism-crtp-and-using-typedefs-from-derived-classes

Pre-Merge Checklist:

  • [x] Code is documented in doxygen format
  • [x] Code has automated tests
  • [x] Zero compiler warnings
  • [x] Formatted with clang-format

Testing done: existing unit tests. There is no behaviour change, so unit tests are untouched.

leokoppel avatar May 31 '17 05:05 leokoppel