libdballe  7.7
mysql/attrv6.h
1 /*
2  * db/mysql/attr - attribute table management
3  *
4  * Copyright (C) 2015 ARPA-SIM <urpsim@smr.arpa.emr.it>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * Author: Enrico Zini <enrico@enricozini.com>
20  */
21 
22 #ifndef DBALLE_DB_MYSQL_ATTRV6_H
23 #define DBALLE_DB_MYSQL_ATTRV6_H
24 
25 #include <dballe/db/sql/attrv6.h>
26 #include <dballe/db/mysql/internals.h>
27 
28 namespace dballe {
29 namespace db {
30 namespace mysql {
31 
35 class MySQLAttrV6 : public sql::AttrV6
36 {
37 protected:
40 
41 public:
43  MySQLAttrV6(const MySQLAttrV6&) = delete;
44  MySQLAttrV6(const MySQLAttrV6&&) = delete;
45  MySQLAttrV6& operator=(const MySQLAttrV6&) = delete;
46  ~MySQLAttrV6();
47 
48  void insert(Transaction& t, sql::bulk::InsertAttrsV6& vars, UpdateMode update_mode=UPDATE) override;
49 
58  void read(int id_data, std::function<void(std::unique_ptr<wreport::Var>)> dest) override;
59 
63  void dump(FILE* out) override;
64 };
65 
66 }
67 }
68 }
69 #endif
Definition: sql/attrv6.h:103
Database connection.
Definition: mysql/internals.h:145
Precompiled queries to manipulate the attr table.
Definition: sql/attrv6.h:46
void insert(Transaction &t, sql::bulk::InsertAttrsV6 &vars, UpdateMode update_mode=UPDATE) override
Bulk attribute insert.
Precompiled queries to manipulate the attr table.
Definition: mysql/attrv6.h:35
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
void read(int id_data, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
Load from the database all the attributes for var.
MySQLConnection & conn
DB connection.
Definition: mysql/attrv6.h:39
A RAII transaction interface.
Definition: sql.h:134
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.