OpenCPN Partial API docs
Loading...
Searching...
No Matches
chartdb_thread.cpp
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2026 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, see <https://www.gnu.org/licenses/>. *
16 ***************************************************************************/
17
24#include <wx/wx.h>
25
26#include "chartdb.h"
27#include "chartdbs.h"
28#include "chartdb_thread.h"
29
30wxDEFINE_EVENT(wxEVT_OCPN_CHARTTABLEENTRYTHREAD,
32
33// Static globals
34extern ChartDB *ChartData;
35
36// ChartTableEntryJobTicket implementation
37bool ChartTableEntryJobTicket::DoJob() {
38 // printf("DoJob\n");
39 ChartDatabase *db = dynamic_cast<ChartDatabase *>(ChartData);
40 ChartTableEntry *pnewChartTableEntry =
41 db->CreateChartTableEntry(m_ChartPath, m_ChartPath, chart_desc);
42 if (pnewChartTableEntry) {
43 std::shared_ptr<ChartTableEntry> safe_ptr(pnewChartTableEntry);
44 m_chart_table_entry = safe_ptr; // class member
45 }
46
47 return true;
48}
ChartDB * ChartData
Global instance.
Definition chartdb.cpp:72
Charts database management
ChartDB * ChartData
Global instance.
Definition chartdb.cpp:72
Define threaded chart database classes.
Basic chart info storage.
Manages the chart database and provides access to chart data.
Definition chartdb.h:95
Manages a database of charts, including reading, writing, and querying chart information.
Definition chartdbs.h:304
Represents an entry in the chart table, containing information about a single chart.
Definition chartdbs.h:187