libdballe  6.8
Public Member Functions
dballe::db::Cursor Class Referenceabstract
Inheritance diagram for dballe::db::Cursor:
dballe::db::mem::Cursor dballe::db::v5::Cursor dballe::db::v6::Cursor dballe::db::v6::CursorBest dballe::db::v6::CursorLinear dballe::db::v6::CursorData dballe::db::v6::CursorDataIDs dballe::db::v6::CursorStations dballe::db::v6::CursorSummary

Public Member Functions

virtual DBget_db () const =0
 Get the database that created this cursor.
 
virtual int remaining () const =0
 Get the number of rows still to be fetched. More...
 
virtual bool next ()=0
 Get a new item from the results of a query. More...
 
virtual void discard_rest ()=0
 Discard the results that have not been read yet.
 
virtual void to_record (Record &rec)=0
 Fill in a record with the contents of a dba_db_cursor. More...
 
virtual int get_station_id () const =0
 Get the station identifier.
 
virtual double get_lat () const =0
 Get the station latitude.
 
virtual double get_lon () const =0
 Get the station longitude.
 
virtual const char * get_ident (const char *def=0) const =0
 Get the station identifier, or NULL if missing.
 
virtual const char * get_rep_memo (const char *def=0) const =0
 Get the report name.
 
virtual Level get_level () const =0
 Get the level.
 
virtual Trange get_trange () const =0
 Get the level.
 
virtual void get_datetime (int(&dt)[6]) const =0
 Get the datetime.
 
virtual wreport::Varcode get_varcode () const =0
 Get the variable code.
 
virtual wreport::Var get_var () const =0
 Get the variable.
 
virtual int attr_reference_id () const =0
 Return an integer value that can be used to refer to the current variable for attribute access.
 
virtual unsigned query_attrs (const AttrList &qcs, Record &attrs)=0
 Query attributes for the current variable.
 
virtual void attr_insert (const Record &attrs)=0
 Insert/overwrite new attributes for the current variable. More...
 
virtual void attr_remove (const AttrList &qcs)=0
 Delete attributes for the current variable. More...
 
virtual unsigned test_iterate (FILE *dump=0)
 Iterate the cursor until the end, returning the number of items. More...
 

Member Function Documentation

virtual void dballe::db::Cursor::attr_insert ( const Record attrs)
pure virtual

Insert/overwrite new attributes for the current variable.

Parameters
attrsThe record with the attributes to be added

Implemented in dballe::db::v5::Cursor, and dballe::db::v6::Cursor.

virtual void dballe::db::Cursor::attr_remove ( const AttrList &  qcs)
pure virtual

Delete attributes for the current variable.

Parameters
qcsArray of WMO codes of the attributes to delete. If empty, all attributes associated to id_data will be deleted.

Implemented in dballe::db::v5::Cursor, and dballe::db::v6::Cursor.

virtual bool dballe::db::Cursor::next ( )
pure virtual

Get a new item from the results of a query.

Returns
true if a new record has been read, false if there is no more data to read

Implemented in dballe::db::v6::CursorBest, dballe::db::v6::CursorLinear, dballe::db::v5::Cursor, dballe::db::v6::Cursor, and dballe::db::mem::Cursor.

virtual int dballe::db::Cursor::remaining ( ) const
pure virtual

Get the number of rows still to be fetched.

Returns
The number of rows still to be queried. The value is undefined if no query has been successfully peformed yet using this cursor.

Implemented in dballe::db::v5::Cursor, dballe::db::v6::Cursor, and dballe::db::mem::Cursor.

virtual unsigned dballe::db::Cursor::test_iterate ( FILE *  dump = 0)
virtual

Iterate the cursor until the end, returning the number of items.

If dump is a FILE pointer, also dump the cursor values to it

Reimplemented in dballe::db::v6::CursorBest, dballe::db::v6::CursorDataIDs, dballe::db::v6::CursorSummary, dballe::db::v6::CursorData, dballe::db::v6::CursorStations, and dballe::db::v6::Cursor.

virtual void dballe::db::Cursor::to_record ( Record rec)
pure virtual

Fill in a record with the contents of a dba_db_cursor.

Parameters
recThe record where to store the values

Implemented in dballe::db::v6::CursorBest, dballe::db::v6::CursorDataIDs, dballe::db::v6::CursorSummary, dballe::db::v6::CursorData, dballe::db::v6::CursorStations, and dballe::db::v5::Cursor.


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