22 #ifndef DBALLE_DB_SQL_ATTRV6_H
23 #define DBALLE_DB_SQL_ATTRV6_H
26 #include <wreport/var.h>
71 virtual void read(
int id_data, std::function<
void(std::unique_ptr<wreport::Var>)> dest) = 0;
76 virtual void dump(FILE* out) = 0;
88 const wreport::Var* attr;
90 AttrV6(
const wreport::Var* attr,
int id_data=-1)
91 : id_data(id_data), attr(attr)
94 bool operator<(
const AttrV6& v)
const
96 if (
int d = id_data - v.id_data)
return d < 0;
97 return attr->code() < v.attr->code();
100 void dump(FILE* out)
const;
105 void add(
const wreport::Var* attr,
int id_data)
107 emplace_back(attr, id_data);
111 void add_all(
const wreport::Var& var,
int id_data);
113 void dump(FILE* out)
const;
123 InsertAttrsV6::iterator iter;
124 bool do_insert =
false;
125 bool do_update =
false;
129 bool annotate(
int id_data, wreport::Varcode code,
const char* value);
132 void dump(FILE* out)
const;
void insert_attributes(Transaction &t, int id_data, const wreport::Var &var, UpdateMode update_mode=UPDATE)
Insert all attributes of the given variable.
Definition: sql/attrv6.h:103
Precompiled queries to manipulate the attr table.
Definition: sql/attrv6.h:46
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
virtual void dump(FILE *out)=0
Dump the entire contents of the table to an output stream.
virtual void read(int id_data, std::function< void(std::unique_ptr< wreport::Var >)> dest)=0
Load from the database all the attributes for var.
Attribute table management used by the db module.
Definition: sql/datav6.h:81
Helper class for annotating InsertV6 variables with the current status of the database.
Definition: sql/attrv6.h:120
A RAII transaction interface.
Definition: sql.h:134
virtual void insert(Transaction &t, sql::bulk::InsertAttrsV6 &vars, UpdateMode update_mode=UPDATE)=0
Bulk attribute insert.
Workflow information about an attribute variable listed for bulk insert/update.
Definition: sql/attrv6.h:85