OpenCPN Partial API docs
Loading...
Searching...
No Matches
tc_data_factory.h
Go to the documentation of this file.
1/**************************************************************************
2 * Copyright (C) 2013 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#ifndef TCDATAFACTORY_H_
25#define TCDATAFACTORY_H_
26
27#include <wx/string.h>
28
29#include "idx_entry.h"
30#include "tc_error_code.h"
31
32#define NUMUNITS 4
33#define REGION 1
34#define COUNTRY 2
35#define STATE 3
36
37typedef enum { LENGTH, VELOCITY, BOGUS } unit_type;
38
39typedef struct {
40 const char *name;
41 const char *abbrv;
42 unit_type type;
43 double conv_factor;
44} unit;
45
47public:
48 int type;
49 wxString short_s;
50 wxString long_s;
51};
52
54public:
55 TCDataFactory() {}
56 virtual ~TCDataFactory() {}
57
58 virtual TC_Error_Code LoadData(const wxString &data_file_path) = 0;
59
60 virtual int GetMaxIndex() = 0;
61 virtual IDX_entry *GetIndexEntry(int n_index) = 0;
62
63 static int findunit(const char *unit);
64 static const unit known_units[NUMUNITS];
65
66 wxString source_ident;
67};
68
69#endif
Represents an index entry for tidal and current data.
Definition idx_entry.h:48
Tidal data container.