libdballe 5.10
match-wreport.h
Go to the documentation of this file.
00001 /*
00002  * dballe/match-wreport - Matched implementation for wreport bulletins
00003  *
00004  * Copyright (C) 2010  ARPA-SIM <urpsim@smr.arpa.emr.it>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00018  *
00019  * Author: Enrico Zini <enrico@enricozini.com>
00020  */
00021 
00022 #ifndef DBALLE_CORE_MATCH_WREPORT_H
00023 #define DBALLE_CORE_MATCH_WREPORT_H
00024 
00030 #include <dballe/core/matcher.h>
00031 
00032 namespace wreport {
00033 struct Var;
00034 struct Subset;
00035 struct Bulletin;
00036 }
00037 
00038 namespace dballe {
00039 
00040 struct MatchedSubset : public Matched
00041 {
00042     const wreport::Subset& r;
00043 
00044     MatchedSubset(const wreport::Subset& r);
00045     ~MatchedSubset();
00046 
00051     virtual matcher::Result match_var_id(int val) const;
00052 
00053     virtual matcher::Result match_station_id(int val) const;
00054     virtual matcher::Result match_station_wmo(int block, int station=-1) const;
00055     virtual matcher::Result match_date(const int* min, const int* max) const;
00056     virtual matcher::Result match_coords(int latmin, int latmax, int lonmin, int lonmax) const;
00057     virtual matcher::Result match_rep_memo(const char* memo) const;
00058 
00059 protected:
00060     int date[6];
00061     int lat, lon;
00062     const wreport::Var* var_ana_id;
00063     const wreport::Var* var_block;
00064     const wreport::Var* var_station;
00065     const wreport::Var* var_rep_memo;
00066 };
00067 
00071 struct MatchedBulletin : public Matched
00072 {
00073     const wreport::Bulletin& r;
00074 
00075     MatchedBulletin(const wreport::Bulletin& r);
00076     ~MatchedBulletin();
00077 
00078     virtual matcher::Result match_var_id(int val) const;
00079     virtual matcher::Result match_station_id(int val) const;
00080     virtual matcher::Result match_station_wmo(int block, int station=-1) const;
00081     virtual matcher::Result match_date(const int* min, const int* max) const;
00082     virtual matcher::Result match_coords(int latmin, int latmax, int lonmin, int lonmax) const;
00083     virtual matcher::Result match_rep_memo(const char* memo) const;
00084 
00085 protected:
00086     const MatchedSubset** subsets;
00087 };
00088 
00089 }
00090 
00091 /* vim:set ts=4 sw=4: */
00092 #endif