22 #ifndef DBA_DB_MEM_CURSOR_H
23 #define DBA_DB_MEM_CURSOR_H
25 #include <dballe/memdb/memdb.h>
26 #include <dballe/memdb/results.h>
47 typedef std::vector<wreport::Varcode> AttrList;
67 const wreport::Var* cur_var;
83 virtual bool next() = 0;
96 virtual const char*
get_ident(
const char* def=0)
const;
97 virtual const char*
get_rep_memo(
const char* def=0)
const;
102 virtual wreport::Var
get_var()
const;
131 void to_record_station(
Record& rec);
132 void to_record_levtr(
Record& rec);
133 void to_record_varcode(
Record& rec);
134 void to_record_value(
Record& rec);
152 : values(values), idx(idx) {}
159 std::ostream& operator<<(std::ostream& out,
const DataBestKey& k);
virtual void get_datetime(int(&dt)[6]) const
Get the datetime.
virtual void discard_rest()=0
Discard the results that have not been read yet.
Wrapper around a Value index that compares so that all values from which the best report should be se...
Definition: mem/cursor.h:146
Definition: mem/cursor.h:35
mem::DB & db
Database to operate on.
Definition: mem/cursor.h:57
size_t count
Number of results still to be fetched.
Definition: mem/cursor.h:63
virtual const char * get_ident(const char *def=0) const
Get the station identifier, or NULL if missing.
virtual int get_station_id() const
Get the station identifier.
const unsigned int modifiers
Modifier flags to enable special query behaviours.
Definition: mem/cursor.h:60
virtual double get_lon() const
Get the station longitude.
virtual wreport::Var get_var() const
Get the variable.
DB-All.E record.
Definition: record.h:102
virtual wreport::Varcode get_varcode() const
Get the variable code.
void add_station_info(Record &rec)
Query extra station info and add it to rec.
Cursor(mem::DB &db, unsigned modifiers)
Create a query cursor.
Station information.
Definition: value.h:43
Functions used to connect to DB-All.e and insert, query and delete data.
Station information.
Definition: memdb/station.h:43
Structure used to build and execute a query, and to iterate through the results.
Definition: mem/cursor.h:53
virtual const char * get_rep_memo(const char *def=0) const
Get the report name.
virtual unsigned test_iterate(FILE *dump=0)
Iterate the cursor until the end, returning the number of items.
virtual dballe::DB & get_db() const
Get the database that created this cursor.
virtual int attr_reference_id() const
Return an integer value that can be used to refer to the current variable for attribute access...
int remaining() const
Get the number of rows still to be fetched.
unsigned query_attrs(const AttrList &qcs, Record &attrs)
Query attributes for the current variable.
virtual Trange get_trange() const
Get the level.
virtual double get_lat() const
Get the station latitude.
virtual bool next()=0
Get a new item from the results of a query.
DB-ALLe database connection.
Definition: mem/db.h:52
virtual Level get_level() const
Get the level.