|
libdballe
5.18
|
Fast cached access to the repinfo table. More...
#include <repinfo.h>
Public Member Functions | |
| Repinfo (Connection *conn) | |
| void | invalidate_cache () |
| Invalidate the repinfo cache. | |
| void | update (const char *deffile, int *added, int *deleted, int *updated) |
| Update the report type information in the database using the data from the given file. | |
| int | get_id (const char *memo) const |
| Get the id of a repinfo entry given its name. | |
| bool | has_id (unsigned id) const |
| Check if the database contains the given rep_cod id. | |
| const repinfo::Cache * | get_by_id (unsigned id) const |
| Get a repinfo cache entry by id. | |
| const repinfo::Cache * | get_by_memo (const char *memo) const |
| Get a repinfo cache entry by name. | |
Data Fields | |
| std::vector< repinfo::Cache > | cache |
| Cache of table entries. | |
| std::vector< repinfo::Memoidx > | memo_idx |
| rep_memo -> rep_cod reverse index | |
| Connection * | conn |
| DB connection. | |
Protected Member Functions | |
| void | read_cache () |
| void | cache_append (unsigned id, const char *memo, const char *desc, int prio, const char *descriptor, int tablea) |
| void | rebuild_memo_idx () const |
| int | cache_find_by_memo (const char *memo) const |
| int | cache_find_by_id (unsigned id) const |
| std::vector< repinfo::Cache > | read_repinfo_file (const char *deffile) |
Fast cached access to the repinfo table.
| const repinfo::Cache* dballe::db::Repinfo::get_by_id | ( | unsigned | id | ) | const |
Get a repinfo cache entry by id.
| id | id to query |
| const repinfo::Cache* dballe::db::Repinfo::get_by_memo | ( | const char * | memo | ) | const |
Get a repinfo cache entry by name.
| memo | name to query |
| int dballe::db::Repinfo::get_id | ( | const char * | memo | ) | const |
Get the id of a repinfo entry given its name.
| memo | The name to query |
| bool dballe::db::Repinfo::has_id | ( | unsigned | id | ) | const |
Check if the database contains the given rep_cod id.
| id | id to check |
Invalidate the repinfo cache.
To be called if the repinfo table is modified externally; for example, when the table is recreated on database reset.
| void dballe::db::Repinfo::update | ( | const char * | deffile, |
| int * | added, | ||
| int * | deleted, | ||
| int * | updated | ||
| ) |
Update the report type information in the database using the data from the given file.
| ri | dba_db_repinfo used to update the database |
| deffile | Pathname of the file to use for the update. The NULL value is accepted and means to use the default configure repinfo.csv file. |
| added | Number of entries that have been added during the update. |
| deleted | Number of entries that have been deleted during the update. |
| updated | Number of entries that have been updated during the update. |
DB connection.
The pointer is assumed always valid during the lifetime of the object
1.7.6.1