timothygrant80 / cisTEM

Other
32 stars 26 forks source link

Make Curve object use std::vector under the hood #477

Open bHimes opened 8 months ago

bHimes commented 8 months ago

The Curve object manages a two-dimensional array that is dynamically resized as needed using home-spun logic.

While there are many cases where we do not want to modernize aspects of cisTEM: e.g.

  1. use of wxString and wxArray as wrappers to std::string and std::vector makes interfacing with WX easier as well as maintaining consistency across the code base (where fitting.)
  2. Explicit memory management for objects that require special considerations like alignment, padding, or complex object ownership/lifetime.

In this specific case the memory management by Curve, see for example Curve::CheckMemory() which is needlessly duplicating behavior encapsulated in std::vector.