OpenCPN Partial API docs
Loading...
Searching...
No Matches
GribRecordSet.h
Go to the documentation of this file.
1/***************************************************************************
2 * Copyright (C) 2010 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 ***************************************************************************/
27#include "GribRecord.h"
28
29// These are indexes into the array
30enum {
69};
70
94public:
102 GribRecordSet(unsigned int id) : m_Reference_Time(-1), m_ID(id) {
103 for (int i = 0; i < Idx_COUNT; i++) {
105 m_GribRecordUnref[i] = false;
106 }
107 }
108
109 virtual ~GribRecordSet() { RemoveGribRecords(); }
110
120 void SetUnRefGribRecord(int i, GribRecord *pGR) {
121 assert(i >= 0 && i < Idx_COUNT);
122 if (m_GribRecordUnref[i] == true) {
123 delete m_GribRecordPtrArray[i];
124 }
125 m_GribRecordPtrArray[i] = pGR;
126 m_GribRecordUnref[i] = true;
127 }
128
135 for (int i = 0; i < Idx_COUNT; i++) {
136 if (m_GribRecordUnref[i] == true) {
137 delete m_GribRecordPtrArray[i];
138 }
139 }
140 }
141
145 unsigned int m_ID;
146
156
157private:
158 // grib records files are stored and owned by reader mapGribRecords
159 // interpolated grib are not, keep track of them
160 bool m_GribRecordUnref[Idx_COUNT];
161};
@ Idx_AIR_TEMP850
Air temperature at 850 hPa.
@ Idx_COMP_REFL
Composite radar reflectivity.
@ Idx_PRECIP_TOT
Total precipitation.
@ Idx_AIR_TEMP
Air temperature at 2m.
@ Idx_PRESSURE
Surface pressure.
@ Idx_WVDIR
Wave direction.
@ Idx_HUMID_RE850
Relative humidity at 850 hPa.
@ Idx_CLOUD_TOT
Total cloud cover.
@ Idx_WIND_GUST
Wind gust speed at surface.
@ Idx_WIND_VX
Surface wind velocity X component.
@ Idx_AIR_TEMP300
Air temperature at 300 hPa.
@ Idx_COUNT
Number of supported GRIB record types.
@ Idx_WIND_VY850
Wind velocity Y component at 850 hPa.
@ Idx_HUMID_RE500
Relative humidity at 500 hPa.
@ Idx_WIND_VX300
Wind velocity X component at 300 hPa.
@ Idx_HUMID_RE300
Relative humidity at 300 hPa.
@ Idx_WIND_VX850
Wind velocity X component at 850 hPa.
@ Idx_WIND_VY300
Wind velocity Y component at 300 hPa.
@ Idx_WVPER
Wave period.
@ Idx_WIND_VX700
Wind velocity X component at 700 hPa.
@ Idx_HTSIGW
Significant wave height.
@ Idx_HUMID_RE
Surface relative humidity.
@ Idx_AIR_TEMP700
Air temperature at 700 hPa.
@ Idx_WIND_VY500
Wind velocity Y component at 500 hPa.
@ Idx_GEOP_HGT500
Geopotential height at 500 hPa.
@ Idx_SEACURRENT_VY
Sea current velocity Y component.
@ Idx_WIND_VX500
Wind velocity X component at 500 hPa.
@ Idx_GEOP_HGT300
Geopotential height at 300 hPa.
@ Idx_GEOP_HGT700
Geopotential height at 700 hPa.
@ Idx_WIND_VY700
Wind velocity Y component at 700 hPa.
@ Idx_GEOP_HGT
Surface geopotential height.
@ Idx_SEA_TEMP
Sea surface temperature.
@ Idx_WIND_VY
Surface wind velocity Y component.
@ Idx_GEOP_HGT850
Geopotential height at 850 hPa.
@ Idx_SEACURRENT_VX
Sea current velocity X component.
@ Idx_AIR_TEMP500
Air temperature at 500 hPa.
@ Idx_HUMID_RE700
Relative humidity at 700 hPa.
@ Idx_CAPE
Convective Available Potential Energy.
GRIB Record Base Class Implementation.
Manages a collection of GribRecord objects representing multiple meteorological parameters at a singl...
unsigned int m_ID
Unique identifier for this record set.
void SetUnRefGribRecord(int i, GribRecord *pGR)
Sets a GRIB record that this set owns and will be responsible for deleting.
GribRecord * m_GribRecordPtrArray[Idx_COUNT]
Array of pointers to GRIB records representing different meteorological parameters.
time_t m_Reference_Time
Reference time for this set of records.
GribRecordSet(unsigned int id)
Creates an empty record set.
void RemoveGribRecords()
Removes and deletes all GRIB records owned by this set.
Represents a meteorological data grid from a GRIB (Gridded Binary) file.
Definition GribRecord.h:182