libdballe  7.19
v6/mysql/repinfo.h
1 #ifndef DBALLE_DB_V6_MYSQL_REPINFO_H
2 #define DBALLE_DB_V6_MYSQL_REPINFO_H
3 
4 #include <dballe/db/v6/repinfo.h>
5 #include <dballe/sql/fwd.h>
6 #include <vector>
7 #include <string>
8 #include <map>
9 
10 namespace dballe {
11 struct Record;
12 
13 namespace db {
14 namespace v6 {
15 namespace mysql {
16 
21 {
27 
29  MySQLRepinfoBase(const MySQLRepinfoBase&) = delete;
30  MySQLRepinfoBase(const MySQLRepinfoBase&&) = delete;
31  virtual ~MySQLRepinfoBase();
32  MySQLRepinfoBase& operator=(const MySQLRepinfoBase&) = delete;
33 
34  void dump(FILE* out) override;
35 
36 protected:
37  void delete_entry(unsigned id) override;
38  void update_entry(const v6::repinfo::Cache& entry) override;
39  void insert_entry(const v6::repinfo::Cache& entry) override;
40  int id_use_count(unsigned id, const char* name) override;
41  void read_cache() override;
42  void insert_auto_entry(const char* memo) override;
43 };
44 
46 {
48 
49 protected:
50  int id_use_count(unsigned id, const char* name) override;
51 };
52 
53 }
54 }
55 }
56 }
57 #endif
58 
dballe::sql::MySQLConnection & conn
DB connection.
Definition: v6/mysql/repinfo.h:26
void update_entry(const v6::repinfo::Cache &entry) override
Update an entry using the new_* fields of entry.
int id_use_count(unsigned id, const char *name) override
Return how many time this ID is used in the database.
void dump(FILE *out) override
Dump the entire contents of the database to an output stream.
Forward declarations for public dballe/sql names.
Copyright (C) 2008–2010 ARPA-SIM urpsim@smr.arpa.emr.it
Definition: cmdline.h:17
void insert_auto_entry(const char *memo) override
Create an automatic entry for a missing memo, and insert it in the database.
void read_cache() override
Reread the repinfo cache from the database.
Fast cached access to the repinfo table.
Definition: v6/mysql/repinfo.h:20
void insert_entry(const v6::repinfo::Cache &entry) override
Insert an entry using the new_* fields of entry.
repinfo cache entry
Definition: v6/repinfo.h:29
Fast cached access to the repinfo table.
Definition: v6/repinfo.h:76
void delete_entry(unsigned id) override
Delete a repinfo entry.
Definition: v6/mysql/repinfo.h:45
Repinfo table management used by the db module.
Database connection.
Definition: mysql.h:125