libdballe  7.7
odbc/attrv6.h
1 /*
2  * db/odbc/attrv6 - attribute table management
3  *
4  * Copyright (C) 2005--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_ODBC_ATTRV6_H
23 #define DBALLE_DB_ODBC_ATTRV6_H
24 
25 #include <dballe/db/sql/attrv6.h>
27 
28 namespace dballe {
29 namespace db {
30 namespace odbc {
31 
35 class ODBCAttrV6 : public sql::AttrV6
36 {
37 protected:
40 
43 
45  int id_data;
47  wreport::Varcode type;
49  char value[255];
51  SQLLEN value_ind;
52 
53 public:
55  ~ODBCAttrV6();
56 
57  void insert(Transaction& t, sql::bulk::InsertAttrsV6& vars, UpdateMode update_mode=UPDATE) override;
58 
67  void read(int id_data, std::function<void(std::unique_ptr<wreport::Var>)> dest) override;
68 
72  void dump(FILE* out) override;
73 
74 private:
75  // disallow copy
76  ODBCAttrV6(const ODBCAttrV6&);
77  ODBCAttrV6& operator=(const ODBCAttrV6&);
78 };
79 
80 }
81 }
82 }
83 #endif
Definition: sql/attrv6.h:103
SQLLEN value_ind
attribute value indicator
Definition: odbc/attrv6.h:51
Precompiled queries to manipulate the attr table.
Definition: odbc/attrv6.h:35
ODBC statement.
Definition: odbc/internals.h:170
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
void read(int id_data, std::function< void(std::unique_ptr< wreport::Var >)> dest) override
Load from the database all the attributes for var.
wreport::Varcode type
attribute id SQL parameter
Definition: odbc/attrv6.h:47
void dump(FILE *out) override
Dump the entire contents of the table to an output stream.
ODBCStatement * sstm
Precompiled select statement.
Definition: odbc/attrv6.h:42
ODBCConnection & conn
DB connection.
Definition: odbc/attrv6.h:39
A RAII transaction interface.
Definition: sql.h:134
char value[255]
attribute value SQL parameter
Definition: odbc/attrv6.h:49
int id_data
id_data SQL parameter
Definition: odbc/attrv6.h:45
void insert(Transaction &t, sql::bulk::InsertAttrsV6 &vars, UpdateMode update_mode=UPDATE) override
Bulk attribute insert.
Database functions and data structures used by the db module, but not exported as official API...
Database connection.
Definition: odbc/internals.h:87