Trees | Indices | Help |
---|
|
A container with items identified by a GQuark
Container
is a general-purpose container, it can
hold atomic types, strings and objects. However, objects must implement
the Serializable
interface, because the container
itself is serializable.
A new container can be created with Container.new
(), items can be stored with function
like Container.set_double(), read with Container.get_double(), and removed with Container.remove() or Container.remove_by_prefix(). A presence of a value can
be tested with Container.contains(), convenience functions for reading
(updating) a value only if it is present like Container.gis_double
(), are available too.
Container
takes ownership of stored non-atomic
items. For strings, this means you cannot store static strings (use
g_strdup() to duplicate them), and must not free stored dynamic strings,
as the container will free them itself when they are removed or when the
container is finalized. For objects, this means it takes a reference on
the object (released when the object is removed or the container is
finalized), so you usually want to g_object_unref() objects after storing
them to a container.
Items in a Container
can be identified by a
GQuark
or the corresponding string. While
GQuark
's are atomic values and allow faster acces,
they are less convenient for casual usage -- each
GQuark
key function like Container.set_double() thus has a string-key counterpart
Container.set_double_by_name().
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
Creates a new
|
Gets the number of items in a container.
|
Returns the type of value in
|
Returns
|
Removes a value identified by
|
Removes a values whose key start with
|
Copies a items from one place in container to another place. The copies are shallow, objects are not physically duplicated, only
referenced in
|
Makes a value in When
|
Calls The function is called
|
Stores a boolean into
|
Returns the boolean in
|
Stores an unsigned character into
|
Returns the unsigned character in
|
Stores a 32bit integer into
|
Returns the 32bit integer in
|
Stores an enum into Note enums are treated as 32bit integers.
|
Returns the enum in Note enums are treated as 32bit integers.
|
Stores a 64bit integer into
|
Returns the 64bit integer in
|
Stores a double into
|
Returns the double in
|
Returns the string in The returned string must be treated as constant and never freed or modified.
|
Stores an object into The container claims ownership on the object, i.e. its reference count is incremented. The object must implement
|
Returns the object in The returned object doesn't have its reference count increased, use
g_object_ref() if you want to access it even when
|
Gets all quark keys of a container.
Since: 2.7 |
Duplicates a container keeping only values under given prefixes. Like Container.duplicate(), this method creates a deep copy, that is contained object are physically duplicated too, not just referenced again.
|
Creates a text representation of Note only simple data types are supported as serialization of compound objects is not controllable.
|
Expands to
|
Removes a value identified by name Expands to
|
Makes a value in container See Container.rename() for details.
|
Stores a boolean into container
|
Stores a double into container
|
Stores an enum into container Note enums are treated as 32bit integers.
|
Stores a 32bit integer into container
|
Stores a 64bit integer into container
|
Stores an object into container See Container.set_object() for details.
|
Stores an unsigned character into container
|
Gets the boolean in container
|
Gets the double in container
|
Gets the enum in container Note enums are treated as 32bit integers.
|
Gets the 32bit integer in container
|
Gets the 64bit integer in container
|
Gets the unsigned character in container
|
Gets the object in container The returned object doesn't have its reference count increased, use
g_object_ref() if you want to access it even when
|
Gets the string in container The returned string must be treated as constant and never freed or modified.
|
Convenience macro doing gwy_serializable_duplicate() with all the necessary typecasting.
|
Stores a string into container The container makes a copy of the string, so it can be used on static strings.
Since: 2.38 |
Stores a string into The container makes a copy of the string, so it can be used on static strings.
Since: 2.38 |
Gets all string keys of a container.
Since: 2.7 |
Gets the value in container
|
Returns the value in
|
Inserts or updates several values in
|
Inserts or updates several values in
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 | http://epydoc.sourceforge.net |