/* rygel-http-response-element.c generated by valac 0.56.1, the Vala compiler
 * generated from rygel-http-response-element.vala, do not modify */

/*
 * Copyright (C) 2013  Cable Television Laboratories, Inc.
 *
 * Author: Craig Pratt <craig@ecaspia.com>
 *
 * 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.1 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 library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include "rygel-server.h"
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <glib-object.h>

enum  {
	RYGEL_HTTP_RESPONSE_ELEMENT_0_PROPERTY,
	RYGEL_HTTP_RESPONSE_ELEMENT_NUM_PROPERTIES
};
static GParamSpec* rygel_http_response_element_properties[RYGEL_HTTP_RESPONSE_ELEMENT_NUM_PROPERTIES];

static gpointer rygel_http_response_element_parent_class = NULL;

static void rygel_http_response_element_real_add_response_headers (RygelHTTPResponseElement* self,
                                                            RygelHTTPRequest* request);
static gchar* rygel_http_response_element_real_to_string (RygelHTTPResponseElement* self);
static GType rygel_http_response_element_get_type_once (void);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

/**
     * Set the type-appropriate headers on the associated HTTP Message
     */
static void
rygel_http_response_element_real_add_response_headers (RygelHTTPResponseElement* self,
                                                       RygelHTTPRequest* request)
{
	g_critical ("Type `%s' does not implement abstract method `rygel_http_response_element_add_response_headers'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return;
}

void
rygel_http_response_element_add_response_headers (RygelHTTPResponseElement* self,
                                                  RygelHTTPRequest* request)
{
	RygelHTTPResponseElementClass* _klass_;
	g_return_if_fail (self != NULL);
	_klass_ = RYGEL_HTTP_RESPONSE_ELEMENT_GET_CLASS (self);
	if (_klass_->add_response_headers) {
		_klass_->add_response_headers (self, request);
	}
}

static gchar*
rygel_http_response_element_real_to_string (RygelHTTPResponseElement* self)
{
	g_critical ("Type `%s' does not implement abstract method `rygel_http_response_element_to_string'", g_type_name (G_TYPE_FROM_INSTANCE (self)));
	return NULL;
}

gchar*
rygel_http_response_element_to_string (RygelHTTPResponseElement* self)
{
	RygelHTTPResponseElementClass* _klass_;
	g_return_val_if_fail (self != NULL, NULL);
	_klass_ = RYGEL_HTTP_RESPONSE_ELEMENT_GET_CLASS (self);
	if (_klass_->to_string) {
		return _klass_->to_string (self);
	}
	return NULL;
}

RygelHTTPResponseElement*
rygel_http_response_element_construct (GType object_type)
{
	RygelHTTPResponseElement * self = NULL;
	self = (RygelHTTPResponseElement*) g_object_new (object_type, NULL);
	return self;
}

static void
rygel_http_response_element_class_init (RygelHTTPResponseElementClass * klass,
                                        gpointer klass_data)
{
	rygel_http_response_element_parent_class = g_type_class_peek_parent (klass);
	((RygelHTTPResponseElementClass *) klass)->add_response_headers = (void (*) (RygelHTTPResponseElement*, RygelHTTPRequest*)) rygel_http_response_element_real_add_response_headers;
	((RygelHTTPResponseElementClass *) klass)->to_string = (gchar* (*) (RygelHTTPResponseElement*)) rygel_http_response_element_real_to_string;
}

static void
rygel_http_response_element_instance_init (RygelHTTPResponseElement * self,
                                           gpointer klass)
{
}

/**
 * This abstract class represents an entity that can contribute response headers to a
 * HTTP request.
 */
static GType
rygel_http_response_element_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (RygelHTTPResponseElementClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) rygel_http_response_element_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (RygelHTTPResponseElement), 0, (GInstanceInitFunc) rygel_http_response_element_instance_init, NULL };
	GType rygel_http_response_element_type_id;
	rygel_http_response_element_type_id = g_type_register_static (G_TYPE_OBJECT, "RygelHTTPResponseElement", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return rygel_http_response_element_type_id;
}

GType
rygel_http_response_element_get_type (void)
{
	static volatile gsize rygel_http_response_element_type_id__once = 0;
	if (g_once_init_enter (&rygel_http_response_element_type_id__once)) {
		GType rygel_http_response_element_type_id;
		rygel_http_response_element_type_id = rygel_http_response_element_get_type_once ();
		g_once_init_leave (&rygel_http_response_element_type_id__once, rygel_http_response_element_type_id);
	}
	return rygel_http_response_element_type_id__once;
}

static inline gpointer
_vala_memdup2 (gconstpointer mem,
               gsize byte_size)
{
	gpointer new_mem;
	if (mem && byte_size != 0) {
		new_mem = g_malloc (byte_size);
		memcpy (new_mem, mem, byte_size);
	} else {
		new_mem = NULL;
	}
	return new_mem;
}

