mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
b95ac3f79c
This is a humongous commit, because it touches all parts of the code. It removes the last user of our horrible TABLE macros, which simulate std::vector<> in a very clumsy way. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
37 lines
900 B
C++
37 lines
900 B
C++
// SPDX-License-Identifier: GPL-2.0
|
|
// A structure that contains all the data we store in a divelog files
|
|
#ifndef DIVELOG_H
|
|
#define DIVELOG_H
|
|
|
|
#include "divelist.h"
|
|
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
struct trip_table;
|
|
class dive_site_table;
|
|
struct device;
|
|
struct filter_preset_table;
|
|
|
|
struct divelog {
|
|
dive_table dives;
|
|
std::unique_ptr<trip_table> trips;
|
|
std::unique_ptr<dive_site_table> sites;
|
|
std::vector<device> devices;
|
|
std::unique_ptr<filter_preset_table> filter_presets;
|
|
bool autogroup;
|
|
|
|
divelog();
|
|
~divelog();
|
|
divelog(divelog &&); // move constructor (argument is consumed).
|
|
divelog &operator=(divelog &&); // move assignment (argument is consumed).
|
|
|
|
void delete_single_dive(int idx);
|
|
void delete_multiple_dives(const std::vector<dive *> &dives);
|
|
void clear();
|
|
bool is_trip_before_after(const struct dive *dive, bool before) const;
|
|
};
|
|
|
|
extern struct divelog divelog;
|
|
|
|
#endif
|