summaryrefslogtreecommitdiff
path: root/src/analysis/db/collection.h
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-08-18 21:55:24 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-08-18 21:55:24 (GMT)
commita0a7b6c1e05c78ae433f353d15e3366107b67d03 (patch)
treebca0b187778cf016c6131bfc982b08c67a38442b /src/analysis/db/collection.h
parent161c0f8ab227af5033b1b6456607b9b9c3bc60df (diff)
Inserted storages and collections into loaded binaries (first steps).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@389 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/db/collection.h')
-rw-r--r--src/analysis/db/collection.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/src/analysis/db/collection.h b/src/analysis/db/collection.h
index 715cdc9..75ee7df 100644
--- a/src/analysis/db/collection.h
+++ b/src/analysis/db/collection.h
@@ -25,6 +25,87 @@
#define _ANALYSIS_DB_COLLECTION_H
+#include <glib-object.h>
+#include <stdint.h>
+
+
+#include "item.h"
+#include "protocol.h"
+
+
+
+#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_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;
+
+/* Collection générique d'éléments (classe) */
+typedef struct _GDbCollectionClass GDbCollectionClass;
+
+
+/* Indique le type défini pour une collection générique d'éléments. */
+GType g_db_collection_get_type(void);
+
+/* Prépare la mise en place d'une nouvelle collection. */
+GDbCollection *g_db_collection_new(uint32_t, GType);
+
+
+
+/* Décrit le type des éléments rassemblées dans une collection. */
+uint32_t g_db_collection_get_feature(const GDbCollection *);
+
+
+
+
+/* Réceptionne et traite une requête réseau pour collection. */
+bool g_db_collection_recv(GDbCollection *, int);
+
+/* Envoie pour traitement une requête réseau pour collection. */
+bool g_db_collection_send(GDbCollection *, int, DBAction, GDbItem *);
+
+
+
+
+
+
+/* Met à disposition un encadrement des accès aux éléments. */
+void g_db_collection_lock_unlock(GDbCollection *, bool, bool);
+
+
+#define g_db_collection_wlock(col) g_db_collection_lock_unlock(col, true, true);
+#define g_db_collection_wunlock(col) g_db_collection_lock_unlock(col, true, false);
+
+#define g_db_collection_rlock(col) g_db_collection_lock_unlock(col, false, true);
+#define g_db_collection_runlock(col) g_db_collection_lock_unlock(col, false, false);
+
+
+/* Renvoie la liste des éléments rassemblés. */
+GList *g_db_collection_list_items(const GDbCollection *);
+
+
+
+
+/* Procède à l'ajout d'un nouvel élément dans la collection. */
+bool g_db_collection_add_item(GDbCollection *, GDbItem *);
+
+/* Procède à la modification d'un élément dans la collection. */
+bool g_db_collection_modify_item(GDbCollection *, GDbItem *);
+
+
+
+
+
+/* ------------------- CREATION DE L'ABSTRACTION POUR COLLECTIONS ------------------- */
+
+
+/* Recherche une collection correspondant à un type donné. */
+GDbCollection *find_collection_in_list(GList *, uint32_t);
+
#endif /* _ANALYSIS_DB_COLLECTION_H */