libdballe  6.8
match-wreport.h
Go to the documentation of this file.
1 /*
2  * dballe/match-wreport - Matched implementation for wreport bulletins
3  *
4  * Copyright (C) 2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Author: Enrico Zini <enrico@enricozini.com>
20  */
21 
22 #ifndef DBALLE_CORE_MATCH_WREPORT_H
23 #define DBALLE_CORE_MATCH_WREPORT_H
24 
30 #include <dballe/core/matcher.h>
31 
32 namespace wreport {
33 struct Var;
34 struct Subset;
35 struct Bulletin;
36 }
37 
38 namespace dballe {
39 
40 struct MatchedSubset : public Matched
41 {
42  const wreport::Subset& r;
43 
44  MatchedSubset(const wreport::Subset& r);
45  ~MatchedSubset();
46 
51  virtual matcher::Result match_var_id(int val) const;
52 
53  virtual matcher::Result match_station_id(int val) const;
54  virtual matcher::Result match_station_wmo(int block, int station=-1) const;
55  virtual matcher::Result match_date(const int* min, const int* max) const;
56  virtual matcher::Result match_coords(int latmin, int latmax, int lonmin, int lonmax) const;
57  virtual matcher::Result match_rep_memo(const char* memo) const;
58 
59 protected:
60  int date[6];
61  int lat, lon;
62  const wreport::Var* var_ana_id;
63  const wreport::Var* var_block;
64  const wreport::Var* var_station;
65  const wreport::Var* var_rep_memo;
66 };
67 
71 struct MatchedBulletin : public Matched
72 {
73  const wreport::Bulletin& r;
74 
75  MatchedBulletin(const wreport::Bulletin& r);
76  ~MatchedBulletin();
77 
78  virtual matcher::Result match_var_id(int val) const;
79  virtual matcher::Result match_station_id(int val) const;
80  virtual matcher::Result match_station_wmo(int block, int station=-1) const;
81  virtual matcher::Result match_date(const int* min, const int* max) const;
82  virtual matcher::Result match_coords(int latmin, int latmax, int lonmin, int lonmax) const;
83  virtual matcher::Result match_rep_memo(const char* memo) const;
84 
85 protected:
86  const MatchedSubset** subsets;
87 };
88 
89 }
90 
91 /* vim:set ts=4 sw=4: */
92 #endif
virtual matcher::Result match_station_wmo(int block, int station=-1) const
Match station WMO code.
Common interface for things that are matched.
Definition: matcher.h:48
virtual matcher::Result match_var_id(int val) const
Match variable ID.
virtual matcher::Result match_station_id(int val) const
Match station ID.
virtual matcher::Result match_station_wmo(int block, int station=-1) const
Match station WMO code.
virtual matcher::Result match_rep_memo(const char *memo) const
Match rep_memo.
virtual matcher::Result match_rep_memo(const char *memo) const
Match rep_memo.
Definition: cmdline.h:34
virtual matcher::Result match_date(const int *min, const int *max) const
Match date.
virtual matcher::Result match_date(const int *min, const int *max) const
Match date.
virtual matcher::Result match_coords(int latmin, int latmax, int lonmin, int lonmax) const
Match coordinates, with bounds in 1/100000 of degree.
Definition: conversion.h:31
virtual matcher::Result match_coords(int latmin, int latmax, int lonmin, int lonmax) const
Match coordinates, with bounds in 1/100000 of degree.
Definition: match-wreport.h:40
Match all subsets in turn, returning true if at least one subset matches.
Definition: match-wreport.h:71
virtual matcher::Result match_station_id(int val) const
Match station ID.
virtual matcher::Result match_var_id(int val) const
Return YES if the subset contains at least one var with the given B33195 attribute; else return NA...