/* Queue.c generated by valac 0.56.19, the Vala compiler
 * generated from Queue.vala, do not modify */

/*
 * Copyright © 2023 Alain M. (https://github.com/alainm23/planify)
 *
 * 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 3 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., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301 USA
 *
 * Authored by: Alain M. <alainmh23@gmail.com>
 */

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

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

enum  {
	OBJECTS_QUEUE_0_PROPERTY,
	OBJECTS_QUEUE_UUID_PROPERTY,
	OBJECTS_QUEUE_OBJECT_ID_PROPERTY,
	OBJECTS_QUEUE_TEMP_ID_PROPERTY,
	OBJECTS_QUEUE_QUERY_PROPERTY,
	OBJECTS_QUEUE_ARGS_PROPERTY,
	OBJECTS_QUEUE_SOURCE_ID_PROPERTY,
	OBJECTS_QUEUE_DATE_ADDED_PROPERTY,
	OBJECTS_QUEUE_NUM_PROPERTIES
};
static GParamSpec* objects_queue_properties[OBJECTS_QUEUE_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

struct _ObjectsQueuePrivate {
	gchar* _uuid;
	gchar* _object_id;
	gchar* _temp_id;
	gchar* _query;
	gchar* _args;
	gchar* _source_id;
	gchar* _date_added;
};

static gint ObjectsQueue_private_offset;
static gpointer objects_queue_parent_class = NULL;

static void objects_queue_finalize (GObject * obj);
static GType objects_queue_get_type_once (void);
static void _vala_objects_queue_get_property (GObject * object,
                                       guint property_id,
                                       GValue * value,
                                       GParamSpec * pspec);
static void _vala_objects_queue_set_property (GObject * object,
                                       guint property_id,
                                       const GValue * value,
                                       GParamSpec * pspec);
static inline gpointer _vala_memdup2 (gconstpointer mem,
                        gsize byte_size);

static inline gpointer
objects_queue_get_instance_private (ObjectsQueue* self)
{
	return G_STRUCT_MEMBER_P (self, ObjectsQueue_private_offset);
}

static gchar*
g_date_time_to_string (GDateTime* self)
{
	gchar* _tmp0_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = g_date_time_format (self, "%FT%H:%M:%S%z");
	result = _tmp0_;
	return result;
}

ObjectsQueue*
objects_queue_construct (GType object_type)
{
	ObjectsQueue * self = NULL;
	self = (ObjectsQueue*) g_object_new (object_type, NULL);
	return self;
}

ObjectsQueue*
objects_queue_new (void)
{
	return objects_queue_construct (OBJECTS_TYPE_QUEUE);
}

const gchar*
objects_queue_get_uuid (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_uuid;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_uuid (ObjectsQueue* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_uuid (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_uuid);
		self->priv->_uuid = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_UUID_PROPERTY]);
	}
}

const gchar*
objects_queue_get_object_id (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_object_id;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_object_id (ObjectsQueue* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_object_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_object_id);
		self->priv->_object_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_OBJECT_ID_PROPERTY]);
	}
}

const gchar*
objects_queue_get_temp_id (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_temp_id;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_temp_id (ObjectsQueue* self,
                           const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_temp_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_temp_id);
		self->priv->_temp_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_TEMP_ID_PROPERTY]);
	}
}

const gchar*
objects_queue_get_query (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_query;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_query (ObjectsQueue* self,
                         const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_query (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_query);
		self->priv->_query = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_QUERY_PROPERTY]);
	}
}

const gchar*
objects_queue_get_args (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_args;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_args (ObjectsQueue* self,
                        const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_args (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_args);
		self->priv->_args = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_ARGS_PROPERTY]);
	}
}

const gchar*
objects_queue_get_source_id (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_source_id;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_source_id (ObjectsQueue* self,
                             const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_source_id (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_source_id);
		self->priv->_source_id = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_SOURCE_ID_PROPERTY]);
	}
}

const gchar*
objects_queue_get_date_added (ObjectsQueue* self)
{
	const gchar* result;
	const gchar* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_date_added;
	result = _tmp0_;
	return result;
}

void
objects_queue_set_date_added (ObjectsQueue* self,
                              const gchar* value)
{
	gchar* old_value;
	g_return_if_fail (self != NULL);
	old_value = objects_queue_get_date_added (self);
	if (g_strcmp0 (value, old_value) != 0) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup (value);
		_g_free0 (self->priv->_date_added);
		self->priv->_date_added = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, objects_queue_properties[OBJECTS_QUEUE_DATE_ADDED_PROPERTY]);
	}
}

static void
objects_queue_class_init (ObjectsQueueClass * klass,
                          gpointer klass_data)
{
	objects_queue_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &ObjectsQueue_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_objects_queue_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_objects_queue_set_property;
	G_OBJECT_CLASS (klass)->finalize = objects_queue_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_UUID_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_UUID_PROPERTY] = g_param_spec_string ("uuid", "uuid", "uuid", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_OBJECT_ID_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_OBJECT_ID_PROPERTY] = g_param_spec_string ("object-id", "object-id", "object-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_TEMP_ID_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_TEMP_ID_PROPERTY] = g_param_spec_string ("temp-id", "temp-id", "temp-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_QUERY_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_QUERY_PROPERTY] = g_param_spec_string ("query", "query", "query", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_ARGS_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_ARGS_PROPERTY] = g_param_spec_string ("args", "args", "args", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_SOURCE_ID_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_SOURCE_ID_PROPERTY] = g_param_spec_string ("source-id", "source-id", "source-id", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), OBJECTS_QUEUE_DATE_ADDED_PROPERTY, objects_queue_properties[OBJECTS_QUEUE_DATE_ADDED_PROPERTY] = g_param_spec_string ("date-added", "date-added", "date-added", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
objects_queue_instance_init (ObjectsQueue * self,
                             gpointer klass)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GDateTime* _tmp6_;
	GDateTime* _tmp7_;
	gchar* _tmp8_;
	self->priv = objects_queue_get_instance_private (self);
	_tmp0_ = g_strdup ("");
	self->priv->_uuid = _tmp0_;
	_tmp1_ = g_strdup ("");
	self->priv->_object_id = _tmp1_;
	_tmp2_ = g_strdup ("");
	self->priv->_temp_id = _tmp2_;
	_tmp3_ = g_strdup ("");
	self->priv->_query = _tmp3_;
	_tmp4_ = g_strdup ("");
	self->priv->_args = _tmp4_;
	_tmp5_ = g_strdup ("");
	self->priv->_source_id = _tmp5_;
	_tmp6_ = g_date_time_new_now_local ();
	_tmp7_ = _tmp6_;
	_tmp8_ = g_date_time_to_string (_tmp7_);
	self->priv->_date_added = _tmp8_;
	_g_date_time_unref0 (_tmp7_);
}

static void
objects_queue_finalize (GObject * obj)
{
	ObjectsQueue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, OBJECTS_TYPE_QUEUE, ObjectsQueue);
	_g_free0 (self->priv->_uuid);
	_g_free0 (self->priv->_object_id);
	_g_free0 (self->priv->_temp_id);
	_g_free0 (self->priv->_query);
	_g_free0 (self->priv->_args);
	_g_free0 (self->priv->_source_id);
	_g_free0 (self->priv->_date_added);
	G_OBJECT_CLASS (objects_queue_parent_class)->finalize (obj);
}

static GType
objects_queue_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (ObjectsQueueClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) objects_queue_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ObjectsQueue), 0, (GInstanceInitFunc) objects_queue_instance_init, NULL };
	GType objects_queue_type_id;
	objects_queue_type_id = g_type_register_static (G_TYPE_OBJECT, "ObjectsQueue", &g_define_type_info, 0);
	ObjectsQueue_private_offset = g_type_add_instance_private (objects_queue_type_id, sizeof (ObjectsQueuePrivate));
	return objects_queue_type_id;
}

GType
objects_queue_get_type (void)
{
	static volatile gsize objects_queue_type_id__once = 0;
	if (g_once_init_enter (&objects_queue_type_id__once)) {
		GType objects_queue_type_id;
		objects_queue_type_id = objects_queue_get_type_once ();
		g_once_init_leave (&objects_queue_type_id__once, objects_queue_type_id);
	}
	return objects_queue_type_id__once;
}

static void
_vala_objects_queue_get_property (GObject * object,
                                  guint property_id,
                                  GValue * value,
                                  GParamSpec * pspec)
{
	ObjectsQueue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_QUEUE, ObjectsQueue);
	switch (property_id) {
		case OBJECTS_QUEUE_UUID_PROPERTY:
		g_value_set_string (value, objects_queue_get_uuid (self));
		break;
		case OBJECTS_QUEUE_OBJECT_ID_PROPERTY:
		g_value_set_string (value, objects_queue_get_object_id (self));
		break;
		case OBJECTS_QUEUE_TEMP_ID_PROPERTY:
		g_value_set_string (value, objects_queue_get_temp_id (self));
		break;
		case OBJECTS_QUEUE_QUERY_PROPERTY:
		g_value_set_string (value, objects_queue_get_query (self));
		break;
		case OBJECTS_QUEUE_ARGS_PROPERTY:
		g_value_set_string (value, objects_queue_get_args (self));
		break;
		case OBJECTS_QUEUE_SOURCE_ID_PROPERTY:
		g_value_set_string (value, objects_queue_get_source_id (self));
		break;
		case OBJECTS_QUEUE_DATE_ADDED_PROPERTY:
		g_value_set_string (value, objects_queue_get_date_added (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_objects_queue_set_property (GObject * object,
                                  guint property_id,
                                  const GValue * value,
                                  GParamSpec * pspec)
{
	ObjectsQueue * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, OBJECTS_TYPE_QUEUE, ObjectsQueue);
	switch (property_id) {
		case OBJECTS_QUEUE_UUID_PROPERTY:
		objects_queue_set_uuid (self, g_value_get_string (value));
		break;
		case OBJECTS_QUEUE_OBJECT_ID_PROPERTY:
		objects_queue_set_object_id (self, g_value_get_string (value));
		break;
		case OBJECTS_QUEUE_TEMP_ID_PROPERTY:
		objects_queue_set_temp_id (self, g_value_get_string (value));
		break;
		case OBJECTS_QUEUE_QUERY_PROPERTY:
		objects_queue_set_query (self, g_value_get_string (value));
		break;
		case OBJECTS_QUEUE_ARGS_PROPERTY:
		objects_queue_set_args (self, g_value_get_string (value));
		break;
		case OBJECTS_QUEUE_SOURCE_ID_PROPERTY:
		objects_queue_set_source_id (self, g_value_get_string (value));
		break;
		case OBJECTS_QUEUE_DATE_ADDED_PROPERTY:
		objects_queue_set_date_added (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

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;
}

