1 #ifndef DBALLE_DB_V6_DATAV6_H 2 #define DBALLE_DB_V6_DATAV6_H 12 #include <wreport/var.h> 49 virtual void dump(FILE* out) = 0;
57 static const unsigned FLAG_NEEDS_UPDATE = 1 << 0;
58 static const unsigned FLAG_UPDATED = 1 << 1;
59 static const unsigned FLAG_NEEDS_INSERT = 1 << 2;
60 static const unsigned FLAG_INSERTED = 1 << 3;
63 bool needs_update()
const {
return flags & FLAG_NEEDS_UPDATE; }
64 bool updated()
const {
return flags & FLAG_UPDATED; }
65 bool needs_insert()
const {
return flags & FLAG_NEEDS_INSERT; }
66 bool inserted()
const {
return flags & FLAG_INSERTED; }
67 void set_needs_update() { flags |= FLAG_NEEDS_UPDATE; }
68 void set_updated() { flags = (flags & ~FLAG_NEEDS_UPDATE) | FLAG_UPDATED; }
69 void set_needs_insert() { flags |= FLAG_NEEDS_INSERT; }
70 void set_inserted() { flags = (flags & ~FLAG_NEEDS_INSERT) | FLAG_INSERTED; }
77 void format_flags(
char* dest)
const;
90 : id_levtr(id_levtr), id_data(id_data), var(var)
93 bool operator<(
const VarV6& v)
const 95 if (
int d = id_levtr - v.id_levtr)
return d < 0;
99 void dump(FILE* out)
const;
115 emplace_back(var, id_levtr);
118 void dump(FILE* out)
const;
128 InsertV6::iterator iter;
129 bool do_insert =
false;
130 bool do_update =
false;
134 bool annotate(
int id_data,
int id_levtr,
wreport::Varcode code,
const char* value);
137 void dump(FILE* out)
const;
Forward declarations for public dballe/sql names.
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
Helper class for annotating InsertV6 variables with the current status of the database.
Definition: datav6.h:125
Workflow information about a variable listed for bulk insert/update.
Definition: datav6.h:83
A RAII transaction interface.
Definition: sql.h:133
Date and time.
Definition: types.h:158
Input for a bulk insert of a lot of variables sharing the same context information.
Definition: datav6.h:107
Build SQL queries for V6 databases.
Definition: v6/qbuilder.h:14
Precompiled query to manipulate the data table.
Definition: datav6.h:31