core: make register_dive() member of dive_table

This one is for symmetry with unregister_dive(). However, it
makes me unhappy, because it modifies global state, namely the
selection machinery and the fulltext. I think these should be
moved up in the call chain.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-06-18 21:19:14 +02:00 committed by bstoeger
parent 271df8962b
commit f3b8e3c4aa
3 changed files with 9 additions and 6 deletions

View file

@ -19,6 +19,7 @@ int comp_dives_ptr(const struct dive *a, const struct dive *b);
struct dive_table : public sorted_owning_table<dive, &comp_dives> {
dive *get_by_uniq_id(int id) const;
void record_dive(std::unique_ptr<dive> d); // call fixup_dive() before adding dive to table.
struct dive *register_dive(std::unique_ptr<dive> d);
std::unique_ptr<dive> unregister_dive(int idx);
int get_dive_nr_at_idx(int idx) const;
@ -56,7 +57,6 @@ extern void get_dive_gas(const struct dive *dive, int *o2_p, int *he_p, int *o2l
int get_min_datafile_version();
void report_datafile_version(int version);
void clear_dive_file_data();
struct dive *register_dive(std::unique_ptr<dive> d);
extern bool has_dive(unsigned int deviceid, unsigned int diveid);
#endif // DIVELIST_H