Abstracts generic data storage and access to it in an extensible and efficient way. More...
Data Structures | |
union | _Eina_Value_Union |
All possible value types. More... | |
Typedefs | |
typedef struct _Eina_Value | Eina_Value |
Store generic values. More... | |
typedef struct _Eina_Value_Type | Eina_Value_Type |
Describes the data contained by the value. More... | |
typedef union _Eina_Value_Union | Eina_Value_Union |
Union of all known value types. More... | |
Abstracts generic data storage and access to it in an extensible and efficient way.
It comes with pre-defined types for numbers, array, list, hash, blob and structs. It is able to convert between data types, including to string.
It is meant for simple data types, providing uniform access and release functions, useful to exchange data preserving their types. For more complex hierarchical data, with properties and children, reference counting, inheritance and interfaces,
Examples of usage of the Eina_Value API:
Store generic values.
Describes the data contained by the value.
Union of all known value types.
This is only used to specify the minimum payload memory for Eina_Value.
const Eina_Value_Type* EINA_VALUE_TYPE_UCHAR |
manages unsigned char type.
const Eina_Value_Type* EINA_VALUE_TYPE_USHORT |
manages unsigned short type.
const Eina_Value_Type* EINA_VALUE_TYPE_UINT |
manages unsigned int type.
const Eina_Value_Type* EINA_VALUE_TYPE_ULONG |
manages unsigned long type.
const Eina_Value_Type* EINA_VALUE_TYPE_TIMESTAMP |
manages unsigned long type used for timestamps.
const Eina_Value_Type* EINA_VALUE_TYPE_UINT64 |
manages unsigned integer of 64 bits type.
Referenced by evas_object_evas_get(), and evas_object_image_source_events_get().
const Eina_Value_Type* EINA_VALUE_TYPE_CHAR |
const Eina_Value_Type* EINA_VALUE_TYPE_SHORT |
manages short type.
const Eina_Value_Type* EINA_VALUE_TYPE_INT |
manages int type.
Referenced by evas_object_evas_get(), evas_object_text_ellipsis_get(), evas_object_textblock_size_native_get(), and evas_object_textgrid_update_add().
const Eina_Value_Type* EINA_VALUE_TYPE_LONG |
manages long type.
const Eina_Value_Type* EINA_VALUE_TYPE_INT64 |
manages integer of 64 bits type.
const Eina_Value_Type* EINA_VALUE_TYPE_FLOAT |
manages float type.
const Eina_Value_Type* EINA_VALUE_TYPE_DOUBLE |
const Eina_Value_Type* EINA_VALUE_TYPE_STRINGSHARE |
manages stringshared string type.
const Eina_Value_Type* EINA_VALUE_TYPE_STRING |
manages string type.
Referenced by edje_object_add(), evas_object_evas_get(), evas_object_image_source_events_get(), evas_object_text_ellipsis_get(), evas_object_textblock_size_native_get(), and evas_object_textgrid_update_add().
const Eina_Value_Type* EINA_VALUE_TYPE_ARRAY |
manages array type.
Use the value get/set for arrays:
eina_value_set() takes an Eina_Value_Array where just subtype
and step
are used. If there is an array
, it will be copied (including each item) and its contents must be properly configurable as subtype
expects. eina_value_pset() takes a pointer to an Eina_Value_Array. For your convenience, use eina_value_array_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Array, it's an exact copy of the current structure in use by value, no copies are done.
const Eina_Value_Type* EINA_VALUE_TYPE_LIST |
manages list type.
Use the value get/set for lists:
eina_value_set() takes an Eina_Value_List where just subtype
is used. If there is an list
, it will be copied (including each item) and its contents must be properly configurable as subtype
expects. eina_value_pset() takes a pointer to an Eina_Value_List. For your convenience, use eina_value_list_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_List, it's an exact copy of the current structure in use by value, no copies are done.
const Eina_Value_Type* EINA_VALUE_TYPE_HASH |
manages hash type.
Use the value get/set for hashes:
eina_value_set() takes an Eina_Value_Hash where just subtype
and buckets_power_size
are used. If there is an hash
, it will be copied (including each item) and its contents must be properly configurable as subtype
expects. eina_value_pset() takes a pointer to an Eina_Value_Hash. For your convenience, use eina_value_hash_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Hash, it's an exact copy of the current structure in use by value, no copies are done.
subtype->value_size
. If your subtype
is an integer, add as data malloc(sizeof(int)). If your subtype
is an string, add as data malloc(sizeof(char*)) and this data value must point to strdup(string)!const Eina_Value_Type* EINA_VALUE_TYPE_TIMEVAL |
manages 'struct timeval' type
eina_value_set() takes a "struct timeval" from sys/time.h. eina_value_pset() takes a pointer to "struct timeval".
eina_value_get() and eina_value_pget() takes a pointer to "struct timeval" and it's an exact copy of value.
const Eina_Value_Type* EINA_VALUE_TYPE_BLOB |
manages blob of bytes type, see Eina_Value_Blob
eina_value_set() takes an Eina_Value_Blob eina_value_pset() takes a pointer to Eina_Value_Blob.
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Blob and it's an exact copy of value, no allocations are made.
Memory is untouched unless you provide ops
(operations) pointer.
const Eina_Value_Type* EINA_VALUE_TYPE_STRUCT |
manages struct type.
Use the value get/set for structs:
eina_value_set() takes an Eina_Value_Struct where just desc
is used. If there is an memory
, it will be copied (including each member) and its contents must be properly configurable as desc
expects. eina_value_pset() takes a pointer to an Eina_Value_Struct. For your convenience, use eina_value_struct_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Struct, it's an exact copy of the current structure in use by value, no copies are done.
EINA_VALUE_TYPE_UCHAR = NULL |
EINA_VALUE_TYPE_USHORT = NULL |
EINA_VALUE_TYPE_UINT = NULL |
EINA_VALUE_TYPE_ULONG = NULL |
EINA_VALUE_TYPE_TIMESTAMP = NULL |
manages unsigned long type used for timestamps.
EINA_VALUE_TYPE_UINT64 = NULL |
manages unsigned integer of 64 bits type.
Referenced by evas_object_evas_get(), and evas_object_image_source_events_get().
EINA_VALUE_TYPE_CHAR = NULL |
manages char type.
Referenced by evas_object_evas_get().
EINA_VALUE_TYPE_SHORT = NULL |
EINA_VALUE_TYPE_INT = NULL |
manages int type.
Referenced by evas_object_evas_get(), evas_object_text_ellipsis_get(), evas_object_textblock_size_native_get(), and evas_object_textgrid_update_add().
EINA_VALUE_TYPE_LONG = NULL |
EINA_VALUE_TYPE_INT64 = NULL |
EINA_VALUE_TYPE_FLOAT = NULL |
EINA_VALUE_TYPE_DOUBLE = NULL |
EINA_VALUE_TYPE_STRINGSHARE = NULL |
EINA_VALUE_TYPE_STRING = NULL |
manages string type.
Referenced by edje_object_add(), evas_object_evas_get(), evas_object_image_source_events_get(), evas_object_text_ellipsis_get(), evas_object_textblock_size_native_get(), and evas_object_textgrid_update_add().
EINA_VALUE_TYPE_ARRAY = NULL |
manages array type.
Use the value get/set for arrays:
eina_value_set() takes an Eina_Value_Array where just subtype
and step
are used. If there is an array
, it will be copied (including each item) and its contents must be properly configurable as subtype
expects. eina_value_pset() takes a pointer to an Eina_Value_Array. For your convenience, use eina_value_array_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Array, it's an exact copy of the current structure in use by value, no copies are done.
EINA_VALUE_TYPE_LIST = NULL |
manages list type.
Use the value get/set for lists:
eina_value_set() takes an Eina_Value_List where just subtype
is used. If there is an list
, it will be copied (including each item) and its contents must be properly configurable as subtype
expects. eina_value_pset() takes a pointer to an Eina_Value_List. For your convenience, use eina_value_list_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_List, it's an exact copy of the current structure in use by value, no copies are done.
EINA_VALUE_TYPE_HASH = NULL |
manages hash type.
Use the value get/set for hashes:
eina_value_set() takes an Eina_Value_Hash where just subtype
and buckets_power_size
are used. If there is an hash
, it will be copied (including each item) and its contents must be properly configurable as subtype
expects. eina_value_pset() takes a pointer to an Eina_Value_Hash. For your convenience, use eina_value_hash_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Hash, it's an exact copy of the current structure in use by value, no copies are done.
subtype->value_size
. If your subtype
is an integer, add as data malloc(sizeof(int)). If your subtype
is an string, add as data malloc(sizeof(char*)) and this data value must point to strdup(string)!EINA_VALUE_TYPE_TIMEVAL = NULL |
manages 'struct timeval' type
eina_value_set() takes a "struct timeval" from sys/time.h. eina_value_pset() takes a pointer to "struct timeval".
eina_value_get() and eina_value_pget() takes a pointer to "struct timeval" and it's an exact copy of value.
EINA_VALUE_TYPE_BLOB = NULL |
manages blob of bytes type, see Eina_Value_Blob
eina_value_set() takes an Eina_Value_Blob eina_value_pset() takes a pointer to Eina_Value_Blob.
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Blob and it's an exact copy of value, no allocations are made.
Memory is untouched unless you provide ops
(operations) pointer.
EINA_VALUE_TYPE_STRUCT = NULL |
manages struct type.
Use the value get/set for structs:
eina_value_set() takes an Eina_Value_Struct where just desc
is used. If there is an memory
, it will be copied (including each member) and its contents must be properly configurable as desc
expects. eina_value_pset() takes a pointer to an Eina_Value_Struct. For your convenience, use eina_value_struct_setup().
eina_value_get() and eina_value_pget() takes a pointer to Eina_Value_Struct, it's an exact copy of the current structure in use by value, no copies are done.