GXmlSerializableContainer

GXmlSerializableContainer — Any GXmlSerializable class having a collection managed list of GXmlNode must implement this abstract class.

Functions

Types and Values

Description

Gee Serializable clases requires to be initialized with required typed objects to contain its collections and Serializable interface don't know required type. Then you must use this function to initialize any Serializable collection objects in order to serialize/deserialize all GXmlNode to given clases.

Functions

gxml_serializable_container_init_containers ()

void
gxml_serializable_container_init_containers
                               (GXmlSerializableContainer *self);

Implementors must implement this function and initialize any Serializable container.

Parameters

self

the GXmlSerializableContainer instance

 

gxml_serializable_collection_deserialize_proceed ()

gboolean
gxml_serializable_collection_deserialize_proceed
                               (GXmlSerializableCollection *self);

Returns true if the collection should be deserialized from a GXmlNode's children when gxml_serializable_deserialize() is called. For large collection of nodes this could impact in performance; return false and use gxml_serializable_collection_deserialize_children() when you need to deserialize all nodes to access them.

Parameters

self

the GXmlSerializableCollection instance

 

gxml_serializable_collection_deserialized ()

gboolean
gxml_serializable_collection_deserialized
                               (GXmlSerializableCollection *self);

Returns true if the collection was deserialized from a GXmlNode's children.

Parameters

self

the GXmlSerializableCollection instance

 

gxml_serializable_collection_deserialize_node ()

gboolean
gxml_serializable_collection_deserialize_node
                               (GXmlSerializableCollection *self,
                                GXmlNode *node,
                                GError **error);

Executes a deserialization from a GXmlNode. After this operation gxml_serializable_collection_deserialized() should return true. This operation should not be executed if GXml.SerializableCollection.is_prepared return false;

This could override existing objects in collection.

Parameters

self

the GXmlSerializableCollection instance

 

node

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_collection_deserialize_children ()

gboolean
gxml_serializable_collection_deserialize_children
                               (GXmlSerializableCollection *self,
                                GError **error);

Executes a deserialization from all children nodes in a GXmlNode. After this operation gxml_serializable_collection_deserialized() should return true. This operation should not be executed if GXml.SerializableCollection.is_prepared return false;

This could override existing objects in collection.

Parameters

self

the GXmlSerializableCollection instance

 

error

location to store the error occuring, or NULL to ignore

 

gxml_serializable_collection_is_collection ()

gboolean
gxml_serializable_collection_is_collection
                               (GXmlSerializableCollection *self);

Convenient function to detect Serializable Collections.

Parameters

self

the GXmlSerializableCollection instance

 

Types and Values

GXML_TYPE_SERIALIZABLE_CONTAINER

#define GXML_TYPE_SERIALIZABLE_CONTAINER (gxml_serializable_container_get_type ())

The type for GXmlSerializableContainer.


struct GXmlSerializableContainer

struct GXmlSerializableContainer {
	GXmlSerializableObjectModel parent_instance;
	GXmlSerializableContainerPrivate * priv;
};

Any GXmlSerializable class having a collection managed list of GXmlNode must implement this abstract class.

Gee Serializable clases requires to be initialized with required typed objects to contain its collections and Serializable interface don't know required type. Then you must use this function to initialize any Serializable collection objects in order to serialize/deserialize all GXmlNode to given clases.


struct GXmlSerializableContainerClass

struct GXmlSerializableContainerClass {
	GXmlSerializableObjectModelClass parent_class;
	void (*init_containers) (GXmlSerializableContainer* self);
};

The class structure for GXML_TYPE_SERIALIZABLE_CONTAINER. All the fields in this structure are private and should never be accessed directly.

Members

init_containers ()

virtual method called by gxml_serializable_container_init_containers()

 

GXmlSerializableCollection

typedef struct _GXmlSerializableCollection GXmlSerializableCollection;

Serializable Framework. interface to be implemented by any collection of GXmlSerializable objects.


struct GXmlSerializableCollectionIface

struct GXmlSerializableCollectionIface {
	GTypeInterface parent_iface;
	gboolean (*deserialize_proceed) (GXmlSerializableCollection* self);
	gboolean (*deserialized) (GXmlSerializableCollection* self);
	gboolean (*deserialize_node) (GXmlSerializableCollection* self, GXmlNode* node, GError** error);
	gboolean (*deserialize_children) (GXmlSerializableCollection* self, GError** error);
	gboolean (*is_collection) (GXmlSerializableCollection* self);
};

Interface for creating GXmlSerializableCollection implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

deserialize_proceed ()

virtual method called by gxml_serializable_collection_deserialize_proceed()

 

deserialized ()

virtual method called by gxml_serializable_collection_deserialized()

 

deserialize_node ()

virtual method called by gxml_serializable_collection_deserialize_node()

 

deserialize_children ()

virtual method called by gxml_serializable_collection_deserialize_children()

 

is_collection ()

virtual method called by gxml_serializable_collection_is_collection()