OpenCPN Partial API docs
Loading...
Searching...
No Matches
navobj_db.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2025 by David S. Register *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 **************************************************************************/
19
25#ifndef _NAVOBJ_DB_H__
26#define _NAVOBJ_DB_H__
27
28#include <wx/timer.h>
29#include "notification.h"
30#include "observable_evtvar.h"
31#include "comm_appmsg.h"
32#include <sqlite3.h>
33#include "track.h"
34
36class NavObj_dB {
37public:
38 static NavObj_dB &GetInstance();
39
40 NavObj_dB(const NavObj_dB &) = delete;
41 NavObj_dB &operator=(const NavObj_dB &) = delete;
42
43 void Close();
44 void LoadNavObjects();
45
46 // Tracks
47 bool LoadAllTracks();
48 bool AddNewTrack(Track *track);
49 bool AddTrackPoint(Track *track, TrackPoint *point);
50 bool UpdateDBTrackAttributes(Track *track);
51 bool DeleteTrack(Track *track);
52
53 // Legacy navobj import
54 bool ImportLegacyNavobj();
55 bool ImportLegacyTracks();
56
57private:
58 NavObj_dB();
59 ~NavObj_dB();
60
61 int m_open_result;
62 sqlite3 *m_db;
63};
64
65#endif
The navobj SQLite container object, a singleton.
Definition navobj_db.h:36
Represents a single point in a track.
Definition track.h:53
Represents a track, which is a series of connected track points.
Definition track.h:111
Class Notification.