summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Clapies <nclapies@entrouvert.com>2004-12-07 15:16:03 +0000
committerNicolas Clapies <nclapies@entrouvert.com>2004-12-07 15:16:03 +0000
commit4bc779dcf2812c8206d80b5a5df0d10575bd8ba6 (patch)
tree12341e7c80ca3d8c29249f9cf493c5b9b391cf5e
parent4b023c5b85966c1e9a37441e019bc10ac89ab585 (diff)
downloadlasso-4bc779dcf2812c8206d80b5a5df0d10575bd8ba6.tar.gz
lasso-4bc779dcf2812c8206d80b5a5df0d10575bd8ba6.tar.xz
lasso-4bc779dcf2812c8206d80b5a5df0d10575bd8ba6.zip
Initial version : abstract class to store ResourceID, ResourceOfferings, QueryItem.
-rw-r--r--lasso/id-wsf/abstract_service.c131
-rw-r--r--lasso/id-wsf/abstract_service.h81
2 files changed, 212 insertions, 0 deletions
diff --git a/lasso/id-wsf/abstract_service.c b/lasso/id-wsf/abstract_service.c
new file mode 100644
index 00000000..2b6dc054
--- /dev/null
+++ b/lasso/id-wsf/abstract_service.c
@@ -0,0 +1,131 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <lasso/xml/dst_query.h>
+#include <lasso/xml/dst_query_response.h>
+#include <lasso/id-wsf/abstract_service.h>
+
+struct _LassoAbstractServicePrivate
+{
+ gboolean dispose_has_run;
+};
+
+/*****************************************************************************/
+/* public methods */
+/*****************************************************************************/
+
+/*****************************************************************************/
+/* private methods */
+/*****************************************************************************/
+
+static LassoAbstractServiceClass *parent_class = NULL;
+
+/*****************************************************************************/
+/* overrided parent class methods */
+/*****************************************************************************/
+
+static void
+dispose(GObject *object)
+{
+ LassoAbstractService *service = LASSO_ABSTRACT_SERVICE(object);
+
+ if (service->private_data->dispose_has_run) {
+ return;
+ }
+ service->private_data->dispose_has_run = TRUE;
+
+ debug("LassoAbstractService object 0x%x disposed ...", service);
+
+ G_OBJECT_CLASS(parent_class)->dispose(G_OBJECT(service));
+}
+
+static void
+finalize(GObject *object)
+{
+ LassoAbstractService *service = LASSO_ABSTRACT_SERVICE(object);
+
+ debug("LassoAbstractService object 0x%x finalized ...", object);
+
+ g_free(service->private_data);
+
+ G_OBJECT_CLASS(parent_class)->finalize(object);
+}
+
+/*****************************************************************************/
+/* instance and class init functions */
+/*****************************************************************************/
+
+static void
+instance_init(LassoAbstractService *service)
+{
+ service->private_data = g_new(LassoAbstractServicePrivate, 1);
+ service->private_data->dispose_has_run = FALSE;
+
+}
+
+static void
+class_init(LassoAbstractServiceClass *klass)
+{
+ parent_class = g_type_class_peek_parent(klass);
+
+ G_OBJECT_CLASS(klass)->dispose = dispose;
+ G_OBJECT_CLASS(klass)->finalize = finalize;
+}
+
+GType
+lasso_abstract_service_get_type()
+{
+ static GType this_type = 0;
+
+ if (!this_type) {
+ static const GTypeInfo this_info = {
+ sizeof(LassoAbstractServiceClass),
+ NULL,
+ NULL,
+ (GClassInitFunc) class_init,
+ NULL,
+ NULL,
+ sizeof(LassoAbstractService),
+ 0,
+ (GInstanceInitFunc) instance_init,
+ };
+
+ this_type = g_type_register_static(LASSO_TYPE_WSF_PROFILE,
+ "LassoAbstractService", &this_info, 0);
+ }
+ return this_type;
+}
+
+LassoAbstractService*
+lasso_abstract_service_new(LassoServer *server)
+{
+ LassoAbstractService *service = NULL;
+
+ g_return_val_if_fail(server != NULL, NULL);
+
+ service = g_object_new(LASSO_TYPE_ABSTRACT_SERVICE, NULL);
+
+ return service;
+}
diff --git a/lasso/id-wsf/abstract_service.h b/lasso/id-wsf/abstract_service.h
new file mode 100644
index 00000000..778f4a41
--- /dev/null
+++ b/lasso/id-wsf/abstract_service.h
@@ -0,0 +1,81 @@
+/* $Id$
+ *
+ * Lasso - A free implementation of the Liberty Alliance specifications.
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Nicolas Clapies <nclapies@entrouvert.com>
+ * Valery Febvre <vfebvre@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef __LASSO_ABSTRACT_SERVICE_H__
+#define __LASSO_ABSTRACT_SERVICE_H__
+
+#ifdef __cplusplus
+extern "C" {
+
+#endif /* __cplusplus */
+
+#include <lasso/xml/disco_resource_offering.h>
+#include <lasso/xml/dst_query_item.h>
+#include <lasso/id-wsf/wsf_profile.h>
+
+#define LASSO_TYPE_ABSTRACT_SERVICE (lasso_abstract_service_get_type())
+#define LASSO_ABSTRACT_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), \
+ LASSO_TYPE_ABSTRACT_SERVICE, LassoAbstractService))
+#define LASSO_ABSTRACT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), \
+ LASSO_TYPE_ABSTRACT_SERVICE, LassoAbstractServiceClass))
+#define LASSO_IS_ABSTRACT_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
+ LASSO_TYPE_ABSTRACT_SERVICE))
+#define LASSO_IS_ABSTRACT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ LASSO_TYPE_ABSTRACT_SERVICE))
+#define LASSO_ABSTRACT_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
+ LASSO_TYPE_ABSTRACT_SERVICE, LassoAbstractServiceClass))
+
+typedef struct _LassoAbstractService LassoAbstractService;
+typedef struct _LassoAbstractServiceClass LassoAbstractServiceClass;
+typedef struct _LassoAbstractServicePrivate LassoAbstractServicePrivate;
+
+struct _LassoAbstractService {
+ LassoWsfProfile parent;
+
+ LassoDiscoResourceOffering *ResourceOffering;
+
+ char *ResourceID;
+ gboolean is_encrypted;
+
+ GList *Data;
+ GList *QueryItem;
+
+ LassoAbstractServicePrivate *private_data;
+};
+
+struct _LassoAbstractServiceClass {
+ LassoWsfProfileClass parent;
+};
+
+
+LASSO_EXPORT GType lasso_abstract_service_get_type(void);
+
+LASSO_EXPORT LassoAbstractService* lasso_abstract_service_new(LassoServer *server);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __LASSO_ABSTRACT_SERVICE_H__ */