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
37
38// Seems like a gcc 16 false positive in handling ChartTableEntry.
39#pragma GCC diagnostic push
40#pragma GCC diagnostic ignored "-Warray-bounds"
41
42bool ChartTableEntryJobTicket::DoJob() {
43 // printf("DoJob\n");
44 ChartDatabase *db = dynamic_cast<ChartDatabase *>(ChartData);
45 ChartTableEntry *pnewChartTableEntry =
46 db->CreateChartTableEntry(m_ChartPath, m_ChartPath, chart_desc);
47 if (pnewChartTableEntry) {
48 std::shared_ptr<ChartTableEntry> safe_ptr(pnewChartTableEntry);
49 m_chart_table_entry = safe_ptr; // class member
50 }
51
52 return true;
53}
54#pragma GCC diagnostic pop
ChartDB * ChartData
Global instance.
Definition chartdb.cpp:71
Charts database management
ChartDB * ChartData
Global instance.
Definition chartdb.cpp:71
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:307
Represents an entry in the chart table, containing information about a single chart.
Definition chartdbs.h:190