GTypeValueTable

value_init () Default initialize values contents by poking values directly into the value->data array. The data array of the GValue passed into this function was zero-filled with memset(), so no care has to be taken to free any old contents. E.g. for the implementation of a string value that may never be NULL, the implementation might look like: value_free () Free any old contents that might be left in the data array of the passed in value. No resources may remain allocated through the GValue contents after this function returns. E.g. for our above string type: value_copy () dest_value is a GValue with zero-filled data section and src_value is a properly setup GValue of same or derived type. The purpose of this function is to copy the contents of src_value into dest_value in a way, that even after src_value has been freed, the contents of dest_value remain valid. String type example: value_peek_pointer () If the value contents fit into a pointer, such as objects or strings, return this pointer, so the caller can peek at the current contents. To extend on our above string example: const gchar *collect_format; A string format describing how to collect the contents of this value bit-by-bit. Each character in the format represents an argument to be collected, and the characters themselves indicate the type of the argument. Currently supported arguments are: 'i' - Integers. passed as collect_values[].v_int. 'l' - Longs. passed as collect_values[].v_long. 'd' - Doubles. passed as collect_values[].v_double. 'p' - Pointers. passed as collect_values[].v_pointer. It should be noted that for variable argument list construction, ANSI C promotes every type smaller than an integer to an int, and floats to doubles. So for collection of short int or char, 'i' needs to be used, and for collection of floats 'd'. collect_value () The collect_value() function is responsible for converting the values collected from a variable argument list into contents suitable for storage in a GValue. This function should setup value similar to value_init(); e.g. for a string value that does not allow NULL pointers, it needs to either spew an error, or do an implicit conversion by storing an empty string. The value passed in to this function has a zero-filled data array, so just like for value_init() it is guaranteed to not contain any old contents that might need freeing. n_collect_values is exactly the string length of collect_format, and collect_values is an array of unions GTypeCValue with length n_collect_values, containing the collected values according to collect_format. collect_flags is an argument provided as a hint by the caller. It may contain the flag G_VALUE_NOCOPY_CONTENTS indicating, that the collected value contents may be considered "static" for the duration of the value lifetime. Thus an extra copy of the contents stored in collect_values is not required for assignment to value. For our above string example, we continue with: It should be noted, that it is generally a bad idea to follow the G_VALUE_NOCOPY_CONTENTS hint for reference counted types. Due to reentrancy requirements and reference count assertions performed by the signal emission code, reference counts should always be incremented for reference counted contents stored in the value->data array. To deviate from our string example for a moment, and taking a look at an exemplary implementation for collect_value() of GObject: The reference count for valid objects is always incremented, regardless of collect_flags. For invalid objects, the example const gchar *lcopy_format; lcopy_value ()

Members

Variables

collectFormat
char* collectFormat;
Undocumented in source.
collectValue
char* function(GValue* value, uint nCollectValues, GTypeCValue* collectValues, uint collectFlags) collectValue;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
lcopyFormat
char* lcopyFormat;
Undocumented in source.
lcopyValue
char* function(GValue* value, uint nCollectValues, GTypeCValue* collectValues, uint collectFlags) lcopyValue;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
valueCopy
void function(GValue* srcValue, GValue* destValue) valueCopy;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
valueFree
void function(GValue* value) valueFree;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
valueInit
void function(GValue* value) valueInit;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.
valuePeekPointer
void* function(GValue* value) valuePeekPointer;
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Meta