libdballe  7.7
Public Member Functions | Static Public Attributes
dballe::fortran::API Struct Referenceabstract
Inheritance diagram for dballe::fortran::API:
dballe::fortran::CommonAPIImplementation dballe::fortran::DbAPI dballe::fortran::MsgAPI

Public Member Functions

virtual void scopa (const char *repinfofile=0)=0
 Reset the database contents, loading default report informations from a file. More...
 
virtual void remove_all ()=0
 Remove all data from the database. More...
 
virtual void unset (const char *param)=0
 Remove one parameter from the input record. More...
 
virtual void unsetall ()=0
 Remove all parameters from the input record. More...
 
virtual void unsetb ()=0
 Remove all B* parameters from the input record. More...
 
virtual int quantesono ()=0
 Count the number of elements in the anagraphical storage, and start a new anagraphical query. More...
 
virtual void elencamele ()=0
 Iterate through the anagraphical data. More...
 
virtual int voglioquesto ()=0
 Submit a query to the database. More...
 
virtual const char * dammelo ()=0
 Iterate through the query results data. More...
 
virtual void prendilo ()=0
 Insert a new item in the database. More...
 
virtual void dimenticami ()=0
 Remove all selected items from the database. More...
 
virtual void messages_open_input (const char *filename, const char *mode, File::Encoding format, bool simplified=true)=0
 Open a BUFR/CREX/AOF file for reading. More...
 
virtual void messages_open_output (const char *filename, const char *mode, File::Encoding format)=0
 Open a BUFR/CREX/AOF file for writing. More...
 
virtual bool messages_read_next ()=0
 Read the next message and import it in the database. More...
 
virtual void messages_write_next (const char *template_name=0)=0
 Export the currently selected data to the output message.
 
virtual const char * spiegal (int ltype1, int l1, int ltype2, int l2)=0
 
virtual const char * spiegat (int ptype, int p1, int p2)=0
 
virtual const char * spiegab (const char *varcode, const char *value)=0
 
virtual void test_input_to_output ()=0
 
enq*

Functions used to read the output values of the DBALLE action routines

virtual int enqi (const char *param)=0
 Read one integer value from the output record. More...
 
virtual signed char enqb (const char *param)=0
 Read one byte value from the output record. More...
 
virtual float enqr (const char *param)=0
 Read one real value from the output record. More...
 
virtual double enqd (const char *param)=0
 Read one real*8 value from the output record. More...
 
virtual const char * enqc (const char *param)=0
 Read one character value from the output record. More...
 
set*

Functions used to read the input values for the DBALLE action routines

virtual void seti (const char *param, int value)=0
 Set one integer value into the input record. More...
 
virtual void setb (const char *param, signed char value)=0
 Set one byte value into the input record. More...
 
virtual void setr (const char *param, float value)=0
 Set one real value into the input record. More...
 
virtual void setd (const char *param, double value)=0
 Set one real*8 value into the input record. More...
 
virtual void setc (const char *param, const char *value)=0
 Set one character value into the input record. More...
 
virtual void setcontextana ()=0
 Shortcut function to set query parameters to the anagraphical context. More...
 
virtual void enqlevel (int &ltype1, int &l1, int &ltype2, int &l2)=0
 Shortcut function to read level data. More...
 
virtual void setlevel (int ltype1, int l1, int ltype2, int l2)=0
 Shortcut function to set level data. More...
 
virtual void enqtimerange (int &ptype, int &p1, int &p2)=0
 Shortcut function to read time range data. More...
 
virtual void settimerange (int ptype, int p1, int p2)=0
 Shortcut function to set time range data. More...
 
virtual void enqdate (int &year, int &month, int &day, int &hour, int &min, int &sec)=0
 Shortcut function to read date information. More...
 
virtual void setdate (int year, int month, int day, int hour, int min, int sec)=0
 Shortcut function to set date information. More...
 
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. More...
 
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. More...
 
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().

virtual int voglioancora ()=0
 Retrieve QC informations from the last variable returned by dammelo(). More...
 
virtual const char * ancora ()=0
 Retrieve QC informations from the last variable returned by dammelo(). More...
 
virtual void critica ()=0
 Insert new QC informations for a variable of the current record. More...
 
virtual void scusa ()=0
 Remove QC informations for a variable of the current record. More...
 

Static Public Attributes

static const signed char missing_byte
 
static const int missing_int
 
static const float missing_float
 
static const double missing_double
 

Member Function Documentation

virtual const char* dballe::fortran::API::ancora ( )
pure virtual

Retrieve QC informations from the last variable returned by dammelo().

Parameters
handleHandle to a DBALLE session
Return values
parameterContains the ID of the parameter retrieved by this fetch
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::critica ( )
pure 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:

  • by variable code, using ::setc(handle, "*var", "Bxxyyy")
  • by variable id, using ::seti(handle, "*data_id", id)
  • unspecified, will use the last variable returned by ::dammelo
Parameters
handleHandle to a DBALLE session
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual const char* dballe::fortran::API::dammelo ( )
pure 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.

Parameters
handleHandle to a DBALLE session
Return values
parameterContains the ID of the parameter retrieved by this fetch
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::dimenticami ( )
pure virtual

Remove all selected items from the database.

This function will fail unless the database is open in data rewrite mode.

Parameters
handleHandle to a DBALLE session
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::elencamele ( )
pure 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.

Parameters
handleHandle to a DBALLE session
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual signed char dballe::fortran::API::enqb ( const char *  param)
pure virtual

Read one byte value from the output record.

Parameters
handleHandle to a DBALLE session
parameterParameter 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
valueWhere the value will be returned
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual const char* dballe::fortran::API::enqc ( const char *  param)
pure virtual

Read one character value from the output record.

Parameters
handleHandle to a DBALLE session
parameterParameter 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
valueWhere the value will be returned
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual double dballe::fortran::API::enqd ( const char *  param)
pure virtual

Read one real*8 value from the output record.

Parameters
handleHandle to a DBALLE session
parameterParameter 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
valueWhere the value will be returned
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::enqdate ( int &  year,
int &  month,
int &  day,
int &  hour,
int &  min,
int &  sec 
)
pure virtual

Shortcut function to read date information.

Parameters
handleHandle to a DBALLE session
Return values
yearYear from the output record
monthMonth the output record
dayDay the output record
hourHour the output record
minMinute the output record
secSecond the output record
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual int dballe::fortran::API::enqi ( const char *  param)
pure virtual

Read one integer value from the output record.

Parameters
handleHandle to a DBALLE session
parameterParameter 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
valueWhere the value will be returned
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::enqlevel ( int &  ltype1,
int &  l1,
int &  ltype2,
int &  l2 
)
pure virtual

Shortcut function to read level data.

Parameters
handleHandle to a DBALLE session
Return values
ltypeLevel type from the output record
l1L1 from the output record
l2L2 from the output record
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual float dballe::fortran::API::enqr ( const char *  param)
pure virtual

Read one real value from the output record.

Parameters
handleHandle to a DBALLE session
parameterParameter 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
valueWhere the value will be returned
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::enqtimerange ( int &  ptype,
int &  p1,
int &  p2 
)
pure virtual

Shortcut function to read time range data.

Parameters
handleHandle to a DBALLE session
Return values
ptypeP indicator from the output record
p1P1 from the output record
p2P2 from the output record
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::messages_open_input ( const char *  filename,
const char *  mode,
File::Encoding  format,
bool  simplified = true 
)
pure 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.

Parameters
filenameThe file name
modeThe opening mode. See the mode parameter of libc's fopen() call for details.
encodingThe file encoding
simplifiedAn argument for configuring the Importers::Options used to create the importer for this file.

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::messages_open_output ( const char *  filename,
const char *  mode,
File::Encoding  format 
)
pure 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.

Parameters
filenameThe file name
modeThe opening mode. See the mode parameter of libc's fopen() call for details.
encodingThe file encoding

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual bool dballe::fortran::API::messages_read_next ( )
pure virtual

Read the next message and import it in the database.

The access mode of the session controls how data is imported.

Returns
True if a message has been imported, false if we have reached the end of file.

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::prendilo ( )
pure 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.

Parameters
handleHandle to a DBALLE session
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual int dballe::fortran::API::quantesono ( )
pure virtual

Count the number of elements in the anagraphical storage, and start a new anagraphical query.

Resulting anagraphical data can be retrieved with elencamele()

Parameters
handleHandle to a DBALLE session
countThe count of elements
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::remove_all ( )
pure virtual

Remove all data from the database.

The difference with scopa() is that it preserves report information.

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::scopa ( const char *  repinfofile = 0)
pure virtual

Reset the database contents, loading default report informations from a file.

It only works in rewrite mode.

Parameters
handleHandle to a DBALLE session
repinfofileCSV 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.
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::scusa ( )
pure virtual

Remove QC informations for a variable of the current record.

The QC informations to be removed are set with:

setc(handle, "*varlist", "*B33021,*B33003");

The variable referred by the QC informations can be specified in three ways:

  • by variable code, using ::setc(handle, "*var", "Bxxyyy")
  • by variable id, using ::seti(handle, "*data_id", id)
  • unspecified, will use the last variable returned by ::dammelo
Parameters
handleHandle to a DBALLE session
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual void dballe::fortran::API::setb ( const char *  param,
signed char  value 
)
pure virtual

Set one byte value into the input record.

Parameters
handleHandle to a DBALLE session
parameterParameter to set. 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
valueThe value to assign to the parameter
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setc ( const char *  param,
const char *  value 
)
pure virtual

Set one character value into the input record.

Parameters
handleHandle to a DBALLE session
parameterParameter to set. 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
valueThe value to assign to the parameter
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setcontextana ( )
pure virtual

Shortcut function to set query parameters to the anagraphical context.

Parameters
handleHandle to a DBALLE session
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setd ( const char *  param,
double  value 
)
pure virtual

Set one real*8 value into the input record.

Parameters
handleHandle to a DBALLE session
parameterParameter to set. 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
valueThe value to assign to the parameter
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setdate ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec 
)
pure virtual

Shortcut function to set date information.

Parameters
handleHandle to a DBALLE session
yearYear to set in the input record
monthMonth to set in the input
dayDay to set in the input
hourHour to set in the input
minMinute to set in the input
secSecond to set in the input
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setdatemax ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec 
)
pure virtual

Shortcut function to set maximum date for a query.

Parameters
handleHandle to a DBALLE session
yearMaximum year to set in the query
monthMaximum month to set in the query
dayMaximum day to set in the query
hourMaximum hour to set in the query
minMaximum minute to set in the query
secMaximum second to set in the query
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setdatemin ( int  year,
int  month,
int  day,
int  hour,
int  min,
int  sec 
)
pure virtual

Shortcut function to set minimum date for a query.

Parameters
handleHandle to a DBALLE session
yearMinimum year to set in the query
monthMinimum month to set in the query
dayMinimum day to set in the query
hourMinimum hour to set in the query
minMinimum minute to set in the query
secMinimum second to set in the query
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::seti ( const char *  param,
int  value 
)
pure virtual

Set one integer value into the input record.

Parameters
handleHandle to a DBALLE session
parameterParameter to set. 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
valueThe value to assign to the parameter
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setlevel ( int  ltype1,
int  l1,
int  ltype2,
int  l2 
)
pure virtual

Shortcut function to set level data.

Parameters
handleHandle to a DBALLE session
ltypeLevel type to set in the input record
l1L1 to set in the input record
l2L2 to set in the input record
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::setr ( const char *  param,
float  value 
)
pure virtual

Set one real value into the input record.

Parameters
handleHandle to a DBALLE session
parameterParameter to set. 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
valueThe value to assign to the parameter
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::settimerange ( int  ptype,
int  p1,
int  p2 
)
pure virtual

Shortcut function to set time range data.

Parameters
handleHandle to a DBALLE session
ptypeP indicator to set in the input record
p1P1 to set in the input record
p2P2 to set in the input record
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::unset ( const char *  param)
pure virtual

Remove one parameter from the input record.

Parameters
handleHandle to a DBALLE session
parameterParameter to remove. 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
Returns
The error indicator for the function

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::unsetall ( )
pure virtual

Remove all parameters from the input record.

Parameters
handleHandle to a DBALLE session

Implemented in dballe::fortran::CommonAPIImplementation.

virtual void dballe::fortran::API::unsetb ( )
pure virtual

Remove all B* parameters from the input record.

Parameters
handleHandle to a DBALLE session

Implemented in dballe::fortran::CommonAPIImplementation.

virtual int dballe::fortran::API::voglioancora ( )
pure virtual

Retrieve QC informations from the last variable returned by dammelo().

Parameters
handleHandle to a DBALLE session
Return values
parameterContains the ID of the parameter retrieved by this fetch
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.

virtual int dballe::fortran::API::voglioquesto ( )
pure virtual

Submit a query to the database.

The query results can be accessed with calls to dammelo.

Parameters
handleHandle to a DBALLE session
Return values
countNumber of values returned by the function
Returns
The error indicator for the function

Implemented in dballe::fortran::MsgAPI, and dballe::fortran::DbAPI.


The documentation for this struct was generated from the following file: