libdballe  6.8
simple.h
1 #ifndef FDBA_SIMPLE_H
2 #define FDBA_SIMPLE_H
3 
4 /*
5  * fortran/simple - Interface for Fortran API implementations
6  *
7  * Copyright (C) 2005--2014 ARPA-SIM <urpsim@smr.arpa.emr.it>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * Author: Enrico Zini <enrico@enricozini.com>
23  */
24 #include <dballe/core/defs.h>
25 
26 namespace dballe {
27 namespace fortran {
28 
29 struct API
30 {
31  static const signed char missing_byte;
32  static const int missing_int;
33  static const float missing_float;
34  static const double missing_double;
35 
36  virtual ~API() {}
37 
52  virtual void scopa(const char* repinfofile = 0) = 0;
53 
59  virtual void remove_all() = 0;
60 
82  virtual int enqi(const char* param) = 0;
83 
99  virtual signed char enqb(const char* param) = 0;
100 
116  virtual float enqr(const char* param) = 0;
117 
133  virtual double enqd(const char* param) = 0;
134 
150  virtual const char* enqc(const char* param) = 0;
151 
174  virtual void seti(const char* param, int value) = 0;
175 
191  virtual void setb(const char* param, signed char value) = 0;
192 
208  virtual void setr(const char* param, float value) = 0;
209 
225  virtual void setd(const char* param, double value) = 0;
226 
242  virtual void setc(const char* param, const char* value) = 0;
243 
252  virtual void setcontextana() = 0;
253 
268  virtual void enqlevel(int& ltype1, int& l1, int& ltype2, int& l2) = 0;
269 
284  virtual void setlevel(int ltype1, int l1, int ltype2, int l2) = 0;
285 
300  virtual void enqtimerange(int& ptype, int& p1, int& p2) = 0;
301 
316  virtual void settimerange(int ptype, int p1, int p2) = 0;
317 
338  virtual void enqdate(int& year, int& month, int& day, int& hour, int& min, int& sec) = 0;
339 
360  virtual void setdate(int year, int month, int day, int hour, int min, int sec) = 0;
361 
382  virtual void setdatemin(int year, int month, int day, int hour, int min, int sec) = 0;
383 
404  virtual void setdatemax(int year, int month, int day, int hour, int min, int sec) = 0;
405 
421  virtual void unset(const char* param) = 0;
422 
429  virtual void unsetall() = 0;
430 
437  virtual void unsetb() = 0;
438 
452  virtual int quantesono() = 0;
453 
466  virtual void elencamele() = 0;
467 
480  virtual int voglioquesto() = 0;
481 
495  virtual const char* dammelo() = 0;
496 
515  virtual void prendilo() = 0;
516 
527  virtual void dimenticami() = 0;
528 
539  virtual int voglioancora() = 0;
540 
551  virtual const char* ancora() = 0;
552 
579  virtual void critica() = 0;
580 
600  virtual void scusa() = 0;
601 
620  virtual void messages_open_input(const char* filename, const char* mode, Encoding format, bool simplified=true) = 0;
621 
634  virtual void messages_open_output(const char* filename, const char* mode, Encoding format) = 0;
635 
645  virtual bool messages_read_next() = 0;
646 
650  virtual void messages_write_next(const char* template_name=0) = 0;
651 
652  virtual const char* spiegal(int ltype1, int l1, int ltype2, int l2) = 0;
653 
654  virtual const char* spiegat(int ptype, int p1, int p2) = 0;
655 
656  virtual const char* spiegab(const char* varcode, const char* value) = 0;
657 
658  // Function used for test purposes only
659  virtual void test_input_to_output() = 0;
660 };
661 
662 }
663 }
664 
665 /* vim:set ts=4 sw=4: */
666 #endif
virtual void enqtimerange(int &ptype, int &p1, int &p2)=0
Shortcut function to read time range data.
virtual const char * enqc(const char *param)=0
Read one character value from the output record.
virtual void elencamele()=0
Iterate through the anagraphical data.
virtual void remove_all()=0
Remove all data from the database.
virtual void setlevel(int ltype1, int l1, int ltype2, int l2)=0
Shortcut function to set level data.
virtual void setdate(int year, int month, int day, int hour, int min, int sec)=0
Shortcut function to set date information.
virtual void setcontextana()=0
Shortcut function to set query parameters to the anagraphical context.
virtual const char * dammelo()=0
Iterate through the query results data.
virtual const char * ancora()=0
Retrieve QC informations from the last variable returned by dammelo().
virtual void setdatemin(int year, int month, int day, int hour, int min, int sec)=0
Shortcut function to set minimum date for a query.
Common definitions.
virtual void messages_open_input(const char *filename, const char *mode, Encoding format, bool simplified=true)=0
Open a BUFR/CREX/AOF file for reading.
virtual int enqi(const char *param)=0
Read one integer value from the output record.
virtual void unset(const char *param)=0
Remove one parameter from the input record.
virtual void setc(const char *param, const char *value)=0
Set one character value into the input record.
virtual void dimenticami()=0
Remove all selected items from the database.
Definition: cmdline.h:34
virtual void enqdate(int &year, int &month, int &day, int &hour, int &min, int &sec)=0
Shortcut function to read date information.
Definition: simple.h:29
virtual void messages_open_output(const char *filename, const char *mode, Encoding format)=0
Open a BUFR/CREX/AOF file for writing.
virtual int quantesono()=0
Count the number of elements in the anagraphical storage, and start a new anagraphical query...
virtual void setd(const char *param, double value)=0
Set one real*8 value into the input record.
virtual int voglioancora()=0
Retrieve QC informations from the last variable returned by dammelo().
virtual void messages_write_next(const char *template_name=0)=0
Export the currently selected data to the output message.
virtual void settimerange(int ptype, int p1, int p2)=0
Shortcut function to set time range data.
virtual void prendilo()=0
Insert a new item in the database.
virtual void setdatemax(int year, int month, int day, int hour, int min, int sec)=0
Shortcut function to set maximum date for a query.
virtual signed char enqb(const char *param)=0
Read one byte value from the output record.
virtual void unsetb()=0
Remove all B* parameters from the input record.
virtual int voglioquesto()=0
Submit a query to the database.
virtual bool messages_read_next()=0
Read the next message and import it in the database.
virtual void setb(const char *param, signed char value)=0
Set one byte value into the input record.
virtual void enqlevel(int &ltype1, int &l1, int &ltype2, int &l2)=0
Shortcut function to read level data.
virtual float enqr(const char *param)=0
Read one real value from the output record.
virtual void scopa(const char *repinfofile=0)=0
Reset the database contents, loading default report informations from a file.
virtual void unsetall()=0
Remove all parameters from the input record.
virtual void setr(const char *param, float value)=0
Set one real value into the input record.
virtual void scusa()=0
Remove QC informations for a variable of the current record.
virtual void seti(const char *param, int value)=0
Set one integer value into the input record.
virtual void critica()=0
Insert new QC informations for a variable of the current record.
virtual double enqd(const char *param)=0
Read one real*8 value from the output record.