GXmlBaseCollection

GXmlBaseCollection — Base class for collections implemeting GXmlGomCollection, priving basic infrastructure.

Functions

void gxml_base_collection_initialize ()
void gxml_base_collection_initialize_element ()
void gxml_base_collection_append ()
void gxml_base_collection_search ()
gboolean gxml_base_collection_validate_append ()
const gchar * gxml_base_collection_get_items_name ()
GType gxml_base_collection_get_items_type ()
void gxml_base_collection_set_items_type ()
GQueue * gxml_base_collection_get_nodes_index ()
GXmlGomElement * gxml_base_collection_get_element ()
void gxml_base_collection_set_element ()
GXmlGomArrayList * gxml_gom_array_list_new ()
void gxml_gom_hash_map_initialize_element_with_key ()
void gxml_gom_hash_map_initialize_with_key ()
GXmlDomElement * gxml_gom_hash_map_get ()
gboolean gxml_gom_hash_map_has_key ()
GList * gxml_gom_hash_map_get_keys ()
GXmlGomHashMap * gxml_gom_hash_map_new ()
const gchar * gxml_gom_hash_map_get_attribute_key ()
void gxml_gom_hash_map_set_attribute_key ()
void gxml_gom_hash_paired_map_initialize_element_with_keys ()
void gxml_gom_hash_paired_map_initialize_with_keys ()
GXmlDomElement * gxml_gom_hash_paired_map_get ()
gboolean gxml_gom_hash_paired_map_has_primary_key ()
gboolean gxml_gom_hash_paired_map_has_secondary_key ()
GList * gxml_gom_hash_paired_map_get_primary_keys ()
GList * gxml_gom_hash_paired_map_get_secondary_keys ()
GXmlGomHashPairedMap * gxml_gom_hash_paired_map_new ()
const gchar * gxml_gom_hash_paired_map_get_attribute_primary_key ()
void gxml_gom_hash_paired_map_set_attribute_primary_key ()
const gchar * gxml_gom_hash_paired_map_get_attribute_secondary_key ()
void gxml_gom_hash_paired_map_set_attribute_secondary_key ()
void gxml_gom_collection_search ()
GXmlDomElement * gxml_gom_collection_get_item ()
void gxml_gom_collection_append ()
void gxml_gom_collection_initialize ()
GXmlGomElement * gxml_gom_collection_create_item ()
gboolean gxml_gom_collection_validate_append ()
GQueue * gxml_gom_collection_get_nodes_index ()
GXmlGomElement * gxml_gom_collection_get_element ()
void gxml_gom_collection_set_element ()
const gchar * gxml_gom_collection_get_items_name ()
GType gxml_gom_collection_get_items_type ()
void gxml_gom_collection_set_items_type ()
gint gxml_gom_collection_get_length ()
gchar * gxml_mappeable_element_get_map_key ()
gchar * gxml_mappeable_element_pair_key_get_map_primary_key ()
gchar * gxml_mappeable_element_pair_key_get_map_secondary_key ()

Types and Values

Description

Collections properties should be initialized with current container element in order to be able to add new references to elements. Use gxml_base_collection_initialize_element() to set parent element and gxml_base_collection_search() to find elements for collection.

Functions

gxml_base_collection_initialize ()

void
gxml_base_collection_initialize (GXmlBaseCollection *self,
                                 GType items_type,
                                 GError **error);

Parameters

self

the GXmlBaseCollection instance

 

items_type

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_base_collection_initialize_element ()

void
gxml_base_collection_initialize_element
                               (GXmlBaseCollection *self,
                                GXmlGomElement *e,
                                GError **error);

Initialize an GXmlGomCollection to use an element as children's parent. Searchs for all nodes, calling gxml_gom_collection_search() with "items-type", using its "local-name" to find it.

Implemenation classes, should initialize collection to hold a GXmlGomElement derived type using gxml_gom_collection_initialize().

Parameters

self

the GXmlBaseCollection instance

 

e

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_base_collection_append ()

void
gxml_base_collection_append (GXmlBaseCollection *self,
                             GXmlDomElement *node,
                             GError **error);

Adds an GXmlDomElement of type GXmlGomObject as a child of "element".

Object is always added as a child of "element" but just added to collection if gxml_base_collection_validate_append() returns true;

Parameters

self

the GXmlBaseCollection instance

 

node

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_base_collection_search ()

void
gxml_base_collection_search (GXmlBaseCollection *self,
                             GError **error);

Search for all child nodes in "element" of type GXmlGomElement with a "local-name" equal to "items-name", to add it to collection.

Implementations could add additional restrictions to add element to collection.

Parameters

self

the GXmlBaseCollection instance

 

error

location to store the error occuring, or NULL to ignore

 

gxml_base_collection_validate_append ()

gboolean
gxml_base_collection_validate_append (GXmlBaseCollection *self,
                                      gint index,
                                      GXmlDomElement *element,
                                      GError **error);

Parameters

self

the GXmlBaseCollection instance

 

index

 

 

element

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_base_collection_get_items_name ()

const gchar *
gxml_base_collection_get_items_name (GXmlBaseCollection *self);

Get and return the current value of the "items-name" property.

Parameters

self

the GXmlBaseCollection instance to query

 

Returns

the value of the "items-name" property


gxml_base_collection_get_items_type ()

GType
gxml_base_collection_get_items_type (GXmlBaseCollection *self);

Get and return the current value of the "items-type" property.

Parameters

self

the GXmlBaseCollection instance to query

 

Returns

the value of the "items-type" property


gxml_base_collection_set_items_type ()

void
gxml_base_collection_set_items_type (GXmlBaseCollection *self,
                                     GType value);

Set the value of the "items-type" property to value .

Parameters

self

the GXmlBaseCollection instance to modify

 

value

the new value of the "items-type" property

 

gxml_base_collection_get_nodes_index ()

GQueue *
gxml_base_collection_get_nodes_index (GXmlBaseCollection *self);

Get and return the current value of the "nodes-index" property.

Parameters

self

the GXmlBaseCollection instance to query

 

Returns

the value of the "nodes-index" property


gxml_base_collection_get_element ()

GXmlGomElement *
gxml_base_collection_get_element (GXmlBaseCollection *self);

Get and return the current value of the "element" property.

Parameters

self

the GXmlBaseCollection instance to query

 

Returns

the value of the "element" property


gxml_base_collection_set_element ()

void
gxml_base_collection_set_element (GXmlBaseCollection *self,
                                  GXmlGomElement *value);

Set the value of the "element" property to value .

Parameters

self

the GXmlBaseCollection instance to modify

 

value

the new value of the "element" property

 

gxml_gom_array_list_new ()

GXmlGomArrayList *
gxml_gom_array_list_new (void);

gxml_gom_hash_map_initialize_element_with_key ()

void
gxml_gom_hash_map_initialize_element_with_key
                               (GXmlGomHashMap *self,
                                GXmlGomElement *element,
                                GType items_type,
                                const gchar *attribute_key,
                                GError **error);

Convenient function to initialize a gxml_gom_hash_map_new() collection, using given element, items' type and name.

Parameters

self

the GXmlGomHashMap instance

 

element

 

 

items_type

 

 

attribute_key

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_hash_map_initialize_with_key ()

void
gxml_gom_hash_map_initialize_with_key (GXmlGomHashMap *self,
                                       GType items_type,
                                       const gchar *attribute_key,
                                       GError **error);

Convenient function to initialize a gxml_gom_hash_map_new() collection, using given element, items' type and name.

Using this method at construction time of derived classes.

Parameters

self

the GXmlGomHashMap instance

 

items_type

 

 

attribute_key

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_hash_map_get ()

GXmlDomElement *
gxml_gom_hash_map_get (GXmlGomHashMap *self,
                       const gchar *key);

Returns an GXmlDomElement in the collection using a string key.

Parameters

self

the GXmlGomHashMap instance

 

key

 

 

gxml_gom_hash_map_has_key ()

gboolean
gxml_gom_hash_map_has_key (GXmlGomHashMap *self,
                           const gchar *key);

Returns true if key is used in collection.

Parameters

self

the GXmlGomHashMap instance

 

key

 

 

gxml_gom_hash_map_get_keys ()

GList *
gxml_gom_hash_map_get_keys (GXmlGomHashMap *self);

Returns list of keys used in collection.

Parameters

self

the GXmlGomHashMap instance

 

gxml_gom_hash_map_new ()

GXmlGomHashMap *
gxml_gom_hash_map_new (void);

gxml_gom_hash_map_get_attribute_key ()

const gchar *
gxml_gom_hash_map_get_attribute_key (GXmlGomHashMap *self);

Get and return the current value of the "attribute-key" property.

An attribute's name in items to be added and used to retrieve elements as key.

Parameters

self

the GXmlGomHashMap instance to query

 

Returns

the value of the "attribute-key" property


gxml_gom_hash_map_set_attribute_key ()

void
gxml_gom_hash_map_set_attribute_key (GXmlGomHashMap *self,
                                     const gchar *value);

Set the value of the "attribute-key" property to value .

An attribute's name in items to be added and used to retrieve elements as key.

Parameters

self

the GXmlGomHashMap instance to modify

 

value

the new value of the "attribute-key" property

 

gxml_gom_hash_paired_map_initialize_element_with_keys ()

void
gxml_gom_hash_paired_map_initialize_element_with_keys
                               (GXmlGomHashPairedMap *self,
                                GXmlGomElement *element,
                                GType items_type,
                                const gchar *attribute_primary_key,
                                const gchar *attribute_secondary_key,
                                GError **error);

Convenient function to initialize a GXmlGomHashMap collection, using given element, items' type and name.

Parameters

self

the GXmlGomHashPairedMap instance

 

element

 

 

items_type

 

 

attribute_primary_key

 

 

attribute_secondary_key

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_hash_paired_map_initialize_with_keys ()

void
gxml_gom_hash_paired_map_initialize_with_keys
                               (GXmlGomHashPairedMap *self,
                                GType items_type,
                                const gchar *attribute_primary_key,
                                const gchar *attribute_secondary_key,
                                GError **error);

Convenient function to initialize a GXmlGomHashMap collection, using given element, items' type and name.

Using this method at construction time of derived classes.

Parameters

self

the GXmlGomHashPairedMap instance

 

items_type

 

 

attribute_primary_key

 

 

attribute_secondary_key

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_hash_paired_map_get ()

GXmlDomElement *
gxml_gom_hash_paired_map_get (GXmlGomHashPairedMap *self,
                              const gchar *primary_key,
                              const gchar *secondary_key);

Returns an GXmlDomElement in the collection using given string keys.

Parameters

self

the GXmlGomHashPairedMap instance

 

primary_key

 

 

secondary_key

 

 

gxml_gom_hash_paired_map_has_primary_key ()

gboolean
gxml_gom_hash_paired_map_has_primary_key
                               (GXmlGomHashPairedMap *self,
                                const gchar *key);

Returns true if key is used in collection as primery key.

Parameters

self

the GXmlGomHashPairedMap instance

 

key

 

 

gxml_gom_hash_paired_map_has_secondary_key ()

gboolean
gxml_gom_hash_paired_map_has_secondary_key
                               (GXmlGomHashPairedMap *self,
                                const gchar *pkey,
                                const gchar *key);

Returns true if key is used in collection as secondary key with pkey as primary.

Parameters

self

the GXmlGomHashPairedMap instance

 

pkey

 

 

key

 

 

gxml_gom_hash_paired_map_get_primary_keys ()

GList *
gxml_gom_hash_paired_map_get_primary_keys
                               (GXmlGomHashPairedMap *self);

Returns list of primary keys used in collection.

Parameters

self

the GXmlGomHashPairedMap instance

 

gxml_gom_hash_paired_map_get_secondary_keys ()

GList *
gxml_gom_hash_paired_map_get_secondary_keys
                               (GXmlGomHashPairedMap *self,
                                const gchar *pkey);

Returns list of secondary keys used in collection with pkey as primary key.

Parameters

self

the GXmlGomHashPairedMap instance

 

pkey

 

 

gxml_gom_hash_paired_map_new ()

GXmlGomHashPairedMap *
gxml_gom_hash_paired_map_new (void);

gxml_gom_hash_paired_map_get_attribute_primary_key ()

const gchar *
gxml_gom_hash_paired_map_get_attribute_primary_key
                               (GXmlGomHashPairedMap *self);

Get and return the current value of the "attribute-primary-key" property.

An attribute's name in items to be added and used to retrieve elements as primary key.

Parameters

self

the GXmlGomHashPairedMap instance to query

 

Returns

the value of the "attribute-primary-key" property


gxml_gom_hash_paired_map_set_attribute_primary_key ()

void
gxml_gom_hash_paired_map_set_attribute_primary_key
                               (GXmlGomHashPairedMap *self,
                                const gchar *value);

Set the value of the "attribute-primary-key" property to value .

An attribute's name in items to be added and used to retrieve elements as primary key.

Parameters

self

the GXmlGomHashPairedMap instance to modify

 

value

the new value of the "attribute-primary-key" property

 

gxml_gom_hash_paired_map_get_attribute_secondary_key ()

const gchar *
gxml_gom_hash_paired_map_get_attribute_secondary_key
                               (GXmlGomHashPairedMap *self);

Get and return the current value of the "attribute-secondary-key" property.

An attribute's name in items to be added and used to retrieve elements as secondary key.

Parameters

self

the GXmlGomHashPairedMap instance to query

 

Returns

the value of the "attribute-secondary-key" property


gxml_gom_hash_paired_map_set_attribute_secondary_key ()

void
gxml_gom_hash_paired_map_set_attribute_secondary_key
                               (GXmlGomHashPairedMap *self,
                                const gchar *value);

Set the value of the "attribute-secondary-key" property to value .

An attribute's name in items to be added and used to retrieve elements as secondary key.

Parameters

self

the GXmlGomHashPairedMap instance to modify

 

value

the new value of the "attribute-secondary-key" property

 

gxml_gom_collection_search ()

void
gxml_gom_collection_search (GXmlGomCollection *self,
                            GError **error);

Search and add references to all GXmlGomObject nodes as child of "element" with same, case insensitive, name of "items-name"

Parameters

self

the GXmlGomCollection instance

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_collection_get_item ()

GXmlDomElement *
gxml_gom_collection_get_item (GXmlGomCollection *self,
                              gint index,
                              GError **error);

Gets a child GXmlDomElement of "element" referenced in "nodes-index".

Parameters

self

the GXmlGomCollection instance

 

index

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_collection_append ()

void
gxml_gom_collection_append (GXmlGomCollection *self,
                            GXmlDomElement *node,
                            GError **error);

Adds a GXmlDomElement node to this collection. Depending on type of collection, this method will take information from node to initialize how to find it.

Parameters

self

the GXmlGomCollection instance

 

node

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_collection_initialize ()

void
gxml_gom_collection_initialize (GXmlGomCollection *self,
                                GType t,
                                GError **error);

Initialize collection to use a given GXmlGomElement derived type. Internally, this method create an instance of given type to initialize "items-type" and "items-name".

This method can be used at construction time of classes implementing GXmlGomCollection to initialize object type to refer in collection.

Parameters

self

the GXmlGomCollection instance

 

t

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_collection_create_item ()

GXmlGomElement *
gxml_gom_collection_create_item (GXmlGomCollection *self);

Creates a new instance of "items-type", with same "owner-document" than "element". New instance is not set as a child of collection's "element"; to do so, use gxml_gom_collection_append()

Returns: a new instance object or null if type is not a GXmlGomElement or no parent has been set

Parameters

self

the GXmlGomCollection instance

 

gxml_gom_collection_validate_append ()

gboolean
gxml_gom_collection_validate_append (GXmlGomCollection *self,
                                     gint index,
                                     GXmlDomElement *element,
                                     GError **error);

Validate if given node and index, should be added to collection.

Implementations should use this method to perform any action before element is added to collection, like setup internal pointers to given index, in order to get access to referenced node.

Return: true if node and index should be added to collection.

Parameters

self

the GXmlGomCollection instance

 

index

 

 

element

 

 

error

location to store the error occuring, or NULL to ignore

 

gxml_gom_collection_get_nodes_index ()

GQueue *
gxml_gom_collection_get_nodes_index (GXmlGomCollection *self);

Get and return the current value of the "nodes-index" property.

A list of child GXmlDomElement objects of "element"

Parameters

self

the GXmlGomCollection instance to query

 

Returns

the value of the "nodes-index" property


gxml_gom_collection_get_element ()

GXmlGomElement *
gxml_gom_collection_get_element (GXmlGomCollection *self);

Get and return the current value of the "element" property.

A GXmlGomElement with all child elements in collection.

Parameters

self

the GXmlGomCollection instance to query

 

Returns

the value of the "element" property


gxml_gom_collection_set_element ()

void
gxml_gom_collection_set_element (GXmlGomCollection *self,
                                 GXmlGomElement *value);

Set the value of the "element" property to value .

A GXmlGomElement with all child elements in collection.

Parameters

self

the GXmlGomCollection instance to modify

 

value

the new value of the "element" property

 

gxml_gom_collection_get_items_name ()

const gchar *
gxml_gom_collection_get_items_name (GXmlGomCollection *self);

Get and return the current value of the "items-name" property.

Local name of GXmlDomElement objects of "element", which could be contained in this collection.

Used when reading to add elements to collection.

Parameters

self

the GXmlGomCollection instance to query

 

Returns

the value of the "items-name" property


gxml_gom_collection_get_items_type ()

GType
gxml_gom_collection_get_items_type (GXmlGomCollection *self);

Get and return the current value of the "items-type" property.

A GType of GXmlDomElement child objects of "element", which could be contained in this collection.

Type should be an GXmlGomObject.

Parameters

self

the GXmlGomCollection instance to query

 

Returns

the value of the "items-type" property


gxml_gom_collection_set_items_type ()

void
gxml_gom_collection_set_items_type (GXmlGomCollection *self,
                                    GType value);

Set the value of the "items-type" property to value .

A GType of GXmlDomElement child objects of "element", which could be contained in this collection.

Type should be an GXmlGomObject.

Parameters

self

the GXmlGomCollection instance to modify

 

value

the new value of the "items-type" property

 

gxml_gom_collection_get_length ()

gint
gxml_gom_collection_get_length (GXmlGomCollection *self);

Get and return the current value of the "length" property.

Number of items referenced in "nodes-index"

Parameters

self

the GXmlGomCollection instance to query

 

Returns

the value of the "length" property


gxml_mappeable_element_get_map_key ()

gchar *
gxml_mappeable_element_get_map_key (GXmlMappeableElement *self);

Parameters

self

the GXmlMappeableElement instance

 

gxml_mappeable_element_pair_key_get_map_primary_key ()

gchar *
gxml_mappeable_element_pair_key_get_map_primary_key
                               (GXmlMappeableElementPairKey *self);

Parameters

self

the GXmlMappeableElementPairKey instance

 

gxml_mappeable_element_pair_key_get_map_secondary_key ()

gchar *
gxml_mappeable_element_pair_key_get_map_secondary_key
                               (GXmlMappeableElementPairKey *self);

Parameters

self

the GXmlMappeableElementPairKey instance

 

Types and Values

GXML_TYPE_BASE_COLLECTION

#define GXML_TYPE_BASE_COLLECTION (gxml_base_collection_get_type ())

The type for GXmlBaseCollection.


struct GXmlBaseCollection

struct GXmlBaseCollection {
	GObject parent_instance;
	GXmlBaseCollectionPrivate * priv;
	GQueue* _nodes_index;
	GXmlGomElement* _element;
	gchar* _items_name;
	GType _items_type;
};

Base class for collections implemeting GXmlGomCollection, priving basic infrastructure.

Collections properties should be initialized with current container element in order to be able to add new references to elements. Use gxml_base_collection_initialize_element() to set parent element and gxml_base_collection_search() to find elements for collection.

Members

GXmlBaseCollectionPrivate *priv;

   

GQueue *_nodes_index;

A collection of node's index refered. Don't modify it manually.

 

GXmlGomElement *_element;

Element used to refer of containier element. You should define it at construction time our set it as a construction property.

 

gchar *_items_name;

Local name of GXmlDomElement objects of "element", which could be contained in this collection.

Used when reading to add elements to collection. You can set it at construction time, by, for example, instantaiting a object of the type "items-type" then use "local-name"'s value.

 

GType _items_type;

Objects' type to be referenced by this collection and to deserialize objects. Derived classes, can initilize this value at constructor or as construct property.

Used when reading and at initialization time, to know "local-name" at runtime.

 

struct GXmlBaseCollectionClass

struct GXmlBaseCollectionClass {
	GObjectClass parent_class;
	gboolean (*validate_append) (GXmlBaseCollection* self, gint index, GXmlDomElement* element, GError** error);
};

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

Members

validate_append ()

virtual method called by gxml_base_collection_validate_append()

 

GXML_TYPE_GOM_ARRAY_LIST

#define GXML_TYPE_GOM_ARRAY_LIST (gxml_gom_array_list_get_type ())

The type for GXmlGomArrayList.


struct GXmlGomArrayList

struct GXmlGomArrayList {
	GXmlBaseCollection parent_instance;
	GXmlGomArrayListPrivate * priv;
};

A class impementing GXmlGomCollection to store references to child GXmlDomElement of "element", using an index.

1
2
3
4
5
6
7
8
9
10
11
12
13
public class YourObject : GomElement {
 [Description (nick="::Name")]
 public string name { get; set; }
}
public class YourList : GomArrayList {
 construct {
   try { initialize (typeof (YourObject)); }
   catch (GLib.Error e) {
     warning ("Initialization error for collection type: %s : %s"
          .printf (get_type ().name(), e.message));
   }
 }
}


struct GXmlGomArrayListClass

struct GXmlGomArrayListClass {
	GXmlBaseCollectionClass parent_class;
};

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

Members


GXML_TYPE_GOM_HASH_MAP

#define GXML_TYPE_GOM_HASH_MAP (gxml_gom_hash_map_get_type ())

The type for GXmlGomHashMap.


struct GXmlGomHashMap

struct GXmlGomHashMap {
	GXmlBaseCollection parent_instance;
	GXmlGomHashMapPrivate * priv;
	GHashTable* _hashtable;
	gchar* _attribute_key;
};

A class impementing GXmlGomCollection to store references to child GXmlDomElement of "element", using an attribute in items as key or gxml_mappeable_element_get_map_key() method if implemented by items to be added. If key is not defined in node, it is not added; but keeps it as a child node of actual "element".

If GXmlGomElement to be added is of type "items-type" and implements GXmlMappeableElement, you should set "attribute-key" to null in order to use returned value of gxml_mappeable_element_get_map_key() as key.

1
2
3
4
5
6
7
8
9
10
11
12
13
public class YourObject : GomElement {
 [Description (nick="::Name")]
 public string name { get; set; }
}
public class YourList : GomHashMap {
 construct {
   try { initialize_with_key (typeof (YourObject),"Name"); }
   catch (GLib.Error e) {
     warning ("Initialization error for collection type: %s : %s"
          .printf (get_type ().name(), e.message));
   }
 }
}

Members

GXmlGomHashMapPrivate *priv;

   

GHashTable *_hashtable;

A hashtable with all keys as string to node's index refered. Don't modify it manually.

 

gchar *_attribute_key;

Element's attribute name used to refer of container's element. You should define it at construction time our set it as a construction property.

 

struct GXmlGomHashMapClass

struct GXmlGomHashMapClass {
	GXmlBaseCollectionClass parent_class;
};

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

Members


GXML_TYPE_GOM_HASH_PAIRED_MAP

#define GXML_TYPE_GOM_HASH_PAIRED_MAP (gxml_gom_hash_paired_map_get_type ())

The type for GXmlGomHashPairedMap.


struct GXmlGomHashPairedMap

struct GXmlGomHashPairedMap {
	GXmlBaseCollection parent_instance;
	GXmlGomHashPairedMapPrivate * priv;
	GHashTable* _hashtable;
	gchar* _attribute_primary_key;
	gchar* _attribute_secondary_key;
};

A class impementing GXmlGomCollection to store references to child GXmlDomElement of "element", using two attributes in items as primary and secondary keys or gxml_mappeable_element_pair_key_get_map_primary_key() and gxml_mappeable_element_pair_key_get_map_secondary_key() methods if GXmlMappeableElementPairKey is implemented by items to be added. If one or both keys are not defined in node, it is not added; but keeps it as a child node of actual "element".

If GXmlGomElement to be added is of type "items-type" and implements GXmlMappeableElementPairKey, you should set "attribute-primary-key" and "attribute-secondary-key" to null in order to use returned value of gxml_mappeable_element_pair_key_get_map_primary_key() and gxml_mappeable_element_pair_key_get_map_secondary_key() as keys.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class YourObject : GomElement {
 [Description (nick="::Name")]
 public string name { get; set; }
 public string code { get; set; }
}
public class YourList : GomHashPairedMap {
 construct {
   try { initialize_with_key (typeof (YourObject),"Name"); }
   catch (GLib.Error e) {
     warning ("Initialization error for collection type: %s : %s"
          .printf (get_type ().name(), e.message));
   }
 }
}

Members

GXmlGomHashPairedMapPrivate *priv;

   

GHashTable *_hashtable;

A hashtable with all keys as string to node's index refered. Don't modify it manually.

 

gchar *_attribute_primary_key;

Element's attribute name used to refer of container's element as primery key. You should define it at construction time our set it as a construction property.

 

gchar *_attribute_secondary_key;

Element's attribute name used to refer of container's element as secondary key. You should define it at construction time our set it as a construction property.

 

struct GXmlGomHashPairedMapClass

struct GXmlGomHashPairedMapClass {
	GXmlBaseCollectionClass parent_class;
};

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

Members


GXmlGomCollection

typedef struct _GXmlGomCollection GXmlGomCollection;

An interface to keep references to GXmlDomElement in a "element" child nodes. Only GXmlGomObject are supported.


struct GXmlGomCollectionIface

struct GXmlGomCollectionIface {
	GTypeInterface parent_iface;
	void (*search) (GXmlGomCollection* self, GError** error);
	GXmlDomElement* (*get_item) (GXmlGomCollection* self, gint index, GError** error);
	void (*append) (GXmlGomCollection* self, GXmlDomElement* node, GError** error);
	void (*initialize) (GXmlGomCollection* self, GType t, GError** error);
	GXmlGomElement* (*create_item) (GXmlGomCollection* self);
	gboolean (*validate_append) (GXmlGomCollection* self, gint index, GXmlDomElement* element, GError** error);
	GQueue* (*get_nodes_index) (GXmlGomCollection* self);
	GXmlGomElement* (*get_element) (GXmlGomCollection* self);
	void (*set_element) (GXmlGomCollection* self, GXmlGomElement* value);
	const gchar* (*get_items_name) (GXmlGomCollection* self);
	GType (*get_items_type) (GXmlGomCollection* self);
	void (*set_items_type) (GXmlGomCollection* self, GType value);
	gint (*get_length) (GXmlGomCollection* self);
};

Interface for creating GXmlGomCollection implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

search ()

virtual method called by gxml_gom_collection_search()

 

get_item ()

virtual method called by gxml_gom_collection_get_item()

 

append ()

virtual method called by gxml_gom_collection_append()

 

initialize ()

virtual method called by gxml_gom_collection_initialize()

 

create_item ()

virtual method called by gxml_gom_collection_create_item()

 

validate_append ()

virtual method called by gxml_gom_collection_validate_append()

 

get_nodes_index ()

getter method for the abstract property "nodes-index"

 

get_element ()

getter method for the abstract property "element"

 

set_element ()

   

get_items_name ()

getter method for the abstract property "items-name"

 

get_items_type ()

getter method for the abstract property "items-type"

 

set_items_type ()

   

get_length ()

getter method for the abstract property "length"

 

GXmlMappeableElement

typedef struct _GXmlMappeableElement GXmlMappeableElement;

Inteface to be implemented by GXmlGomElement derived classes in order to provide a string to be used in GXmlGomHashMap as key.

If GXmlGomHashMap has set its "attribute-key" its value has precedence over this method.


struct GXmlMappeableElementIface

struct GXmlMappeableElementIface {
	GTypeInterface parent_iface;
	gchar* (*get_map_key) (GXmlMappeableElement* self);
};

Interface for creating GXmlMappeableElement implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

get_map_key ()

virtual method called by gxml_mappeable_element_get_map_key()

 

GXmlMappeableElementPairKey

typedef struct _GXmlMappeableElementPairKey GXmlMappeableElementPairKey;

Inteface to be implemented by GXmlGomElement derived classes in order to provide a string to be used in GXmlGomHashMap as key.

If GXmlGomHashMap has set its "attribute-key" its value has precedence over this method.


struct GXmlMappeableElementPairKeyIface

struct GXmlMappeableElementPairKeyIface {
	GTypeInterface parent_iface;
	gchar* (*get_map_primary_key) (GXmlMappeableElementPairKey* self);
	gchar* (*get_map_secondary_key) (GXmlMappeableElementPairKey* self);
};

Interface for creating GXmlMappeableElementPairKey implementations.

Members

GTypeInterface parent_iface;

the parent interface structure

 

get_map_primary_key ()

virtual method called by gxml_mappeable_element_pair_key_get_map_primary_key()

 

get_map_secondary_key ()

virtual method called by gxml_mappeable_element_pair_key_get_map_secondary_key()