libwreport 2.1
dds-validator.h
00001 /*
00002  * bulletin/dds-validator - Validate variables of a bulletin against its data
00003  *                          descriptor section
00004  *
00005  * Copyright (C) 2011  ARPA-SIM <urpsim@smr.arpa.emr.it>
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00019  *
00020  * Author: Enrico Zini <enrico@enricozini.com>
00021  */
00022 
00023 #ifndef WREPORT_BULLETIN_DDS_VALIDATOR_H
00024 #define WREPORT_BULLETIN_DDS_VALIDATOR_H
00025 
00026 #include <wreport/bulletin.h>
00027 #include <wreport/bulletin/internals.h>
00028 #include <vector>
00029 
00030 namespace wreport {
00031 namespace bulletin {
00032 
00038 class DDSValidator : public ConstBaseVisitor
00039 {
00040     bool is_crex;
00041     void check_fits(Varinfo info, const Var& var);
00042 
00043 public:
00050     DDSValidator(const Bulletin& b);
00051 
00052     virtual void do_attr(Varinfo info, unsigned var_pos, Varcode attr_code);
00053     virtual void do_var(Varinfo info);
00054     virtual const Var& do_semantic_var(Varinfo info);
00055     virtual void do_char_data(Varcode code);
00056     virtual void do_associated_field(unsigned bit_count, unsigned significance);
00057 };
00058 
00059 }
00060 }
00061 
00062 #endif