core: add constructor/destructor pairs to dive and divecomputer

This allows us to use non-C member variables. Convert a number
of pointers to unique_ptr<>s.

Code in uemis-downloader.cpp had to be refactored, because
it mixed owning and non-owning pointers. Mad.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-16 20:11:21 +02:00 committed by bstoeger
parent bfb54aa581
commit cc39f709ce
35 changed files with 289 additions and 308 deletions

View file

@ -54,7 +54,7 @@ struct parser_state {
enum import_source import_source = UNKNOWN;
struct divecomputer *cur_dc = nullptr; /* non-owning */
struct dive *cur_dive = nullptr; /* owning */
std::unique_ptr<dive> cur_dive; /* owning */
std::unique_ptr<dive_site> cur_dive_site; /* owning */
location_t cur_location;
struct dive_trip *cur_trip = nullptr; /* owning */