/* rygel-tracker-bound-filter.c generated by valac 0.15.1.36-84b2b, the Vala compiler
 * generated from rygel-tracker-bound-filter.vala, do not modify */

/*
 * Copyright (C) 2010 MediaNet Inh.
 *
 * Author: Sunil Mohan Adapa <sunil@medhas.org>
 *
 * This file is part of Rygel.
 *
 * Rygel is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * Rygel 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>


#define RYGEL_TRACKER_TYPE_QUERY_FILTER (rygel_tracker_query_filter_get_type ())
#define RYGEL_TRACKER_QUERY_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_QUERY_FILTER, RygelTrackerQueryFilter))
#define RYGEL_TRACKER_IS_QUERY_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_QUERY_FILTER))
#define RYGEL_TRACKER_QUERY_FILTER_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), RYGEL_TRACKER_TYPE_QUERY_FILTER, RygelTrackerQueryFilterIface))

typedef struct _RygelTrackerQueryFilter RygelTrackerQueryFilter;
typedef struct _RygelTrackerQueryFilterIface RygelTrackerQueryFilterIface;

#define RYGEL_TRACKER_TYPE_BOUND_FILTER (rygel_tracker_bound_filter_get_type ())
#define RYGEL_TRACKER_BOUND_FILTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), RYGEL_TRACKER_TYPE_BOUND_FILTER, RygelTrackerBoundFilter))
#define RYGEL_TRACKER_BOUND_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), RYGEL_TRACKER_TYPE_BOUND_FILTER, RygelTrackerBoundFilterClass))
#define RYGEL_TRACKER_IS_BOUND_FILTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), RYGEL_TRACKER_TYPE_BOUND_FILTER))
#define RYGEL_TRACKER_IS_BOUND_FILTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), RYGEL_TRACKER_TYPE_BOUND_FILTER))
#define RYGEL_TRACKER_BOUND_FILTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), RYGEL_TRACKER_TYPE_BOUND_FILTER, RygelTrackerBoundFilterClass))

typedef struct _RygelTrackerBoundFilter RygelTrackerBoundFilter;
typedef struct _RygelTrackerBoundFilterClass RygelTrackerBoundFilterClass;
typedef struct _RygelTrackerBoundFilterPrivate RygelTrackerBoundFilterPrivate;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _RygelTrackerQueryFilterIface {
	GTypeInterface parent_iface;
	gchar* (*to_string) (RygelTrackerQueryFilter* self);
};

struct _RygelTrackerBoundFilter {
	GObject parent_instance;
	RygelTrackerBoundFilterPrivate * priv;
	gchar* variable;
};

struct _RygelTrackerBoundFilterClass {
	GObjectClass parent_class;
};


static gpointer rygel_tracker_bound_filter_parent_class = NULL;
static RygelTrackerQueryFilterIface* rygel_tracker_bound_filter_rygel_tracker_query_filter_parent_iface = NULL;

GType rygel_tracker_query_filter_get_type (void) G_GNUC_CONST;
GType rygel_tracker_bound_filter_get_type (void) G_GNUC_CONST;
enum  {
	RYGEL_TRACKER_BOUND_FILTER_DUMMY_PROPERTY
};
RygelTrackerBoundFilter* rygel_tracker_bound_filter_new (const gchar* variable);
RygelTrackerBoundFilter* rygel_tracker_bound_filter_construct (GType object_type, const gchar* variable);
static gchar* rygel_tracker_bound_filter_real_to_string (RygelTrackerQueryFilter* base);
static void rygel_tracker_bound_filter_finalize (GObject* obj);


RygelTrackerBoundFilter* rygel_tracker_bound_filter_construct (GType object_type, const gchar* variable) {
	RygelTrackerBoundFilter * self = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	g_return_val_if_fail (variable != NULL, NULL);
	self = (RygelTrackerBoundFilter*) g_object_new (object_type, NULL);
	_tmp0_ = variable;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (self->variable);
	self->variable = _tmp1_;
	return self;
}


RygelTrackerBoundFilter* rygel_tracker_bound_filter_new (const gchar* variable) {
	return rygel_tracker_bound_filter_construct (RYGEL_TRACKER_TYPE_BOUND_FILTER, variable);
}


static gchar* rygel_tracker_bound_filter_real_to_string (RygelTrackerQueryFilter* base) {
	RygelTrackerBoundFilter * self;
	gchar* result = NULL;
	const gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	self = (RygelTrackerBoundFilter*) base;
	_tmp0_ = self->variable;
	_tmp1_ = g_strconcat ("bound(", _tmp0_, NULL);
	_tmp2_ = _tmp1_;
	_tmp3_ = g_strconcat (_tmp2_, ")", NULL);
	_tmp4_ = _tmp3_;
	_g_free0 (_tmp2_);
	result = _tmp4_;
	return result;
}


static void rygel_tracker_bound_filter_class_init (RygelTrackerBoundFilterClass * klass) {
	rygel_tracker_bound_filter_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = rygel_tracker_bound_filter_finalize;
}


static void rygel_tracker_bound_filter_rygel_tracker_query_filter_interface_init (RygelTrackerQueryFilterIface * iface) {
	rygel_tracker_bound_filter_rygel_tracker_query_filter_parent_iface = g_type_interface_peek_parent (iface);
	iface->to_string = (gchar* (*)(RygelTrackerQueryFilter*)) rygel_tracker_bound_filter_real_to_string;
}


static void rygel_tracker_bound_filter_instance_init (RygelTrackerBoundFilter * self) {
}


static void rygel_tracker_bound_filter_finalize (GObject* obj) {
	RygelTrackerBoundFilter * self;
	self = RYGEL_TRACKER_BOUND_FILTER (obj);
	_g_free0 (self->variable);
	G_OBJECT_CLASS (rygel_tracker_bound_filter_parent_class)->finalize (obj);
}


/**
 * Bound expressions in SPARQL query filter
 */
GType rygel_tracker_bound_filter_get_type (void) {
	static volatile gsize rygel_tracker_bound_filter_type_id__volatile = 0;
	if (g_once_init_enter (&rygel_tracker_bound_filter_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (RygelTrackerBoundFilterClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_tracker_bound_filter_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelTrackerBoundFilter), 0, (GInstanceInitFunc) rygel_tracker_bound_filter_instance_init, NULL };
		static const GInterfaceInfo rygel_tracker_query_filter_info = { (GInterfaceInitFunc) rygel_tracker_bound_filter_rygel_tracker_query_filter_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
		GType rygel_tracker_bound_filter_type_id;
		rygel_tracker_bound_filter_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelTrackerBoundFilter", &g_define_type_info, 0);
		g_type_add_interface_static (rygel_tracker_bound_filter_type_id, RYGEL_TRACKER_TYPE_QUERY_FILTER, &rygel_tracker_query_filter_info);
		g_once_init_leave (&rygel_tracker_bound_filter_type_id__volatile, rygel_tracker_bound_filter_type_id);
	}
	return rygel_tracker_bound_filter_type_id__volatile;
}



