diff options
Diffstat (limited to 'src/analysis/db/collection.h')
-rw-r--r-- | src/analysis/db/collection.h | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/analysis/db/collection.h b/src/analysis/db/collection.h index b400820..268c2be 100644 --- a/src/analysis/db/collection.h +++ b/src/analysis/db/collection.h @@ -39,10 +39,14 @@ #define G_TYPE_DB_COLLECTION g_db_collection_get_type() #define G_DB_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_db_collection_get_type(), GDbCollection)) #define G_IS_DB_COLLECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_db_collection_get_type())) -#define G_DB_COLLECTION_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE((inst), g_db_collection_get_type(), GDbCollectionIface)) +#define G_DB_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), G_TYPE_DB_COLLECTION, GDbCollectionClass)) +#define G_IS_DB_COLLECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), G_TYPE_DB_COLLECTION)) #define G_DB_COLLECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), G_TYPE_DB_COLLECTION, GDbCollectionClass)) + + + /* Collection générique d'éléments (instance) */ typedef struct _GDbCollection GDbCollection; @@ -70,7 +74,8 @@ bool g_db_collection_recv(GDbCollection *, int, sqlite3 *); /* Envoie pour traitement une requête réseau pour collection. */ bool g_db_collection_send(GDbCollection *, int, DBAction, GDbItem *); - +/* Envoie pour mise à jour tous les éléments courants. */ +bool g_db_collection_send_all_updates(GDbCollection *, int); @@ -89,15 +94,28 @@ void g_db_collection_lock_unlock(GDbCollection *, bool, bool); /* Renvoie la liste des éléments rassemblés. */ GList *g_db_collection_list_items(const GDbCollection *); +/* Détermine si un élément est déjà présent ou non. */ +GDbItem *g_db_collection_has_key(GDbCollection *, ...); - +/* Détermine si un élément est déjà présent ou non. */ +bool g_db_collection_has_item(GDbCollection *, GDbItem *); /* Procède à l'ajout d'un nouvel élément dans la collection. */ -bool g_db_collection_add_item(GDbCollection *, GDbItem *); +bool _g_db_collection_add_item(GDbCollection *, GDbItem *, bool); /* Procède à la modification d'un élément dans la collection. */ -bool g_db_collection_modify_item(GDbCollection *, GDbItem *); +bool _g_db_collection_modify_item(GDbCollection *, GDbItem *, bool); + +#define g_db_collection_add_item(c, i) _g_db_collection_add_item(c, i, true) +#define g_db_collection_modify_item(c, i) _g_db_collection_modify_item(c, i, true) + + + +/* --------------------- MANIPULATIONS AVEC UNE BASE DE DONNEES --------------------- */ + +/* Charge un ensemble d'éléments à partir d'une base de données. */ +bool g_db_collection_load_all_items(GDbCollection *, sqlite3 *); |