libdballe
6.8
|
Public Member Functions | |
DbAPI (DB &db, const char *anaflag, const char *dataflag, const char *attrflag) | |
virtual int | enqi (const char *param) |
Read one integer value from the output record. More... | |
virtual void | scopa (const char *repinfofile=0) |
Reset the database contents, loading default report informations from a file. More... | |
virtual void | remove_all () |
Remove all data from the database. More... | |
virtual int | quantesono () |
Count the number of elements in the anagraphical storage, and start a new anagraphical query. More... | |
virtual void | elencamele () |
Iterate through the anagraphical data. More... | |
virtual int | voglioquesto () |
Submit a query to the database. More... | |
virtual const char * | dammelo () |
Iterate through the query results data. More... | |
virtual void | prendilo () |
Insert a new item in the database. More... | |
virtual void | dimenticami () |
Remove all selected items from the database. More... | |
virtual int | voglioancora () |
Retrieve QC informations from the last variable returned by dammelo(). More... | |
virtual void | critica () |
Insert new QC informations for a variable of the current record. More... | |
virtual void | scusa () |
Remove QC informations for a variable of the current record. More... | |
virtual void | messages_open_input (const char *filename, const char *mode, Encoding format, bool simplified=true) |
Open a BUFR/CREX/AOF file for reading. More... | |
virtual void | messages_open_output (const char *filename, const char *mode, Encoding format) |
Open a BUFR/CREX/AOF file for writing. More... | |
virtual bool | messages_read_next () |
Read the next message and import it in the database. More... | |
virtual void | messages_write_next (const char *template_name=0) |
Export the currently selected data to the output message. | |
![]() | |
virtual void | test_input_to_output () |
virtual signed char | enqb (const char *param) |
Read one byte value from the output record. More... | |
virtual float | enqr (const char *param) |
Read one real value from the output record. More... | |
virtual double | enqd (const char *param) |
Read one real*8 value from the output record. More... | |
virtual const char * | enqc (const char *param) |
Read one character value from the output record. More... | |
virtual void | seti (const char *param, int value) |
Set one integer value into the input record. More... | |
virtual void | setb (const char *param, signed char value) |
Set one byte value into the input record. More... | |
virtual void | setr (const char *param, float value) |
Set one real value into the input record. More... | |
virtual void | setd (const char *param, double value) |
Set one real*8 value into the input record. More... | |
virtual void | setc (const char *param, const char *value) |
Set one character value into the input record. More... | |
virtual void | setcontextana () |
Shortcut function to set query parameters to the anagraphical context. More... | |
virtual void | enqlevel (int <ype1, int &l1, int <ype2, int &l2) |
Shortcut function to read level data. More... | |
virtual void | setlevel (int ltype1, int l1, int ltype2, int l2) |
Shortcut function to set level data. More... | |
virtual void | enqtimerange (int &ptype, int &p1, int &p2) |
Shortcut function to read time range data. More... | |
virtual void | settimerange (int ptype, int p1, int p2) |
Shortcut function to set time range data. More... | |
virtual void | enqdate (int &year, int &month, int &day, int &hour, int &min, int &sec) |
Shortcut function to read date information. More... | |
virtual void | setdate (int year, int month, int day, int hour, int min, int sec) |
Shortcut function to set date information. More... | |
virtual void | setdatemin (int year, int month, int day, int hour, int min, int sec) |
Shortcut function to set minimum date for a query. More... | |
virtual void | setdatemax (int year, int month, int day, int hour, int min, int sec) |
Shortcut function to set maximum date for a query. More... | |
virtual void | unset (const char *param) |
Remove one parameter from the input record. More... | |
virtual void | unsetall () |
Remove all parameters from the input record. More... | |
virtual void | unsetb () |
Remove all B* parameters from the input record. More... | |
virtual const char * | spiegal (int ltype1, int l1, int ltype2, int l2) |
virtual const char * | spiegat (int ptype, int p1, int p2) |
virtual const char * | spiegab (const char *varcode, const char *value) |
virtual const char * | ancora () |
Retrieve QC informations from the last variable returned by dammelo(). More... | |
AttrState | test_get_attr_state () const |
enq* | |
set* | |
QC functions | |
Functions used to manipulate QC data. All these functions require some context data about the variable, which is automatically available when the variable just came as the result of an dammelo() or has just been inserted with an prendilo(). |
Protected Attributes | |
DB & | db |
db::Cursor * | ana_cur |
db::Cursor * | query_cur |
InputFile * | input_file |
OutputFile * | output_file |
![]() | |
int | perms |
Record | input |
Record | output |
Record | qcinput |
Record | qcoutput |
int | qc_iter |
int | qc_count |
AttrState | attr_state |
wreport::Varcode | attr_varid |
int | attr_reference_id |
std::string | cached_spiega |
Additional Inherited Members | |
![]() | |
enum | AttrState { ATTR_DAMMELO = 1, ATTR_PRENDILO = 2, ATTR_REFERENCE = 3 } |
![]() | |
static const signed char | missing_byte |
static const int | missing_int |
static const float | missing_float |
static const double | missing_double |
![]() | |
enum | { PERM_ANA_RO = (1 << 0), PERM_ANA_WRITE = (1 << 1), PERM_DATA_RO = (1 << 2), PERM_DATA_ADD = (1 << 3), PERM_DATA_WRITE = (1 << 4), PERM_ATTR_RO = (1 << 5), PERM_ATTR_WRITE = (1 << 6) } |
![]() | |
void | set_permissions (const char *anaflag, const char *dataflag, const char *attrflag) |
Set the permission bits, parsing the flags and doing consistency checks. | |
Record & | choose_input_record (const char *¶m) |
Choose the input record to use for param. More... | |
Record & | choose_output_record (const char *¶m) |
Choose the output record to use for param. More... | |
void | read_qc_list (std::vector< wreport::Varcode > &res_arr) const |
Reads the list of QC values to operate on, for dba_voglioancora and dba_scusa. | |
|
virtual |
Insert new QC informations for a variable of the current record.
QC informations inserted are all those set by the functions seti(), setc(), setr(), setd(), using an asterisk in front of the variable name.
Contrarily to prendilo(), this function resets all the QC informations (but only the QC informations) previously set in input, so the values to be inserted need to be explicitly set every time.
This function will fail if the database is open in QC readonly mode, and it will refuse to overwrite existing values if the database is open in QC add mode.
The variable referred by the QC informations can be specified in three ways:
handle | Handle to a DBALLE session |
Implements dballe::fortran::API.
|
virtual |
Iterate through the query results data.
Every invocation of this function will return a new result, or fill fail with code DBA_ERR_NOTFOUND when there are no more results available.
handle | Handle to a DBALLE session |
parameter | Contains the ID of the parameter retrieved by this fetch |
Implements dballe::fortran::API.
|
virtual |
Remove all selected items from the database.
This function will fail unless the database is open in data rewrite mode.
handle | Handle to a DBALLE session |
Implements dballe::fortran::API.
|
virtual |
Iterate through the anagraphical data.
Every invocation of this function will return a new anagraphical data, or fill fail with code DBA_ERR_NOTFOUND when there are no more anagraphical data available.
handle | Handle to a DBALLE session |
Implements dballe::fortran::API.
|
virtual |
Read one integer value from the output record.
handle | Handle to a DBALLE session |
parameter | Parameter to query. It can be the code of a WMO variable prefixed by "B" (such as "B01023" ); the code of a QC value prefixed by "*B" (such as "*B01023" ) or a keyword among the ones defined in Keywords used by dba_record |
value | Where the value will be returned |
Reimplemented from dballe::fortran::CommonAPIImplementation.
|
virtual |
Open a BUFR/CREX/AOF file for reading.
Each session can only have one input file: if one was previously open, it is closed before opening the new one.
filename | The file name |
mode | The opening mode. See the mode parameter of libc's fopen() call for details. |
encoding | The file encoding |
simplified | An argument for configuring the Importers::Options used to create the importer for this file. |
Implements dballe::fortran::API.
|
virtual |
Open a BUFR/CREX/AOF file for writing.
Each session can only have one output file: if one was previously open, it is closed before opening the new one.
filename | The file name |
mode | The opening mode. See the mode parameter of libc's fopen() call for details. |
encoding | The file encoding |
Implements dballe::fortran::API.
|
virtual |
Read the next message and import it in the database.
The access mode of the session controls how data is imported.
Implements dballe::fortran::API.
|
virtual |
Insert a new item in the database.
This function will fail if the database is open in data readonly mode, and it will refuse to overwrite existing values if the database is open in data add mode.
If the database is open in pseudoana reuse mode, the pseudoana values provided on input will be used to create a pseudoana record if it is missing, but will be ignored if it is already present. If it is open in pseudoana rewrite mode instead, the pseudoana values on input will be used to replace all the existing pseudoana values.
handle | Handle to a DBALLE session |
Implements dballe::fortran::API.
|
virtual |
Count the number of elements in the anagraphical storage, and start a new anagraphical query.
Resulting anagraphical data can be retrieved with elencamele()
handle | Handle to a DBALLE session |
count | The count of elements |
Implements dballe::fortran::API.
|
virtual |
Remove all data from the database.
The difference with scopa() is that it preserves report information.
Implements dballe::fortran::API.
|
virtual |
Reset the database contents, loading default report informations from a file.
It only works in rewrite mode.
handle | Handle to a DBALLE session |
repinfofile | CSV file with the default report informations. See dba_reset() documentation for the format of the file. If it is NULL or "\0", the system default is used. |
Implements dballe::fortran::API.
|
virtual |
Remove QC informations for a variable of the current record.
The QC informations to be removed are set with:
The variable referred by the QC informations can be specified in three ways:
handle | Handle to a DBALLE session |
Implements dballe::fortran::API.
|
virtual |
Retrieve QC informations from the last variable returned by dammelo().
handle | Handle to a DBALLE session |
parameter | Contains the ID of the parameter retrieved by this fetch |
Implements dballe::fortran::API.
|
virtual |
Submit a query to the database.
The query results can be accessed with calls to dammelo.
handle | Handle to a DBALLE session |
count | Number of values returned by the function |
Implements dballe::fortran::API.