Data Structures | |
struct | _Eina_Value_Hash |
Used to store the hash and its subtype. More... | |
Typedefs | |
typedef struct _Eina_Value_Hash | Eina_Value_Hash |
Value type for EINA_VALUE_TYPE_HASH. More... | |
Functions | |
EINA_API Eina_Value * | eina_value_hash_new (const Eina_Value_Type *subtype, unsigned int buckets_power_size) |
Creates generic value storage of type hash. More... | |
static Eina_Bool | eina_value_hash_setup (Eina_Value *value, const Eina_Value_Type *subtype, unsigned int buckets_power_size) |
Initializes generic value storage of type hash. More... | |
static unsigned int | eina_value_hash_population (const Eina_Value *value) |
Queries number of elements in value of hash type. More... | |
static Eina_Bool | eina_value_hash_del (Eina_Value *value, const char *key) |
Removes element at given position in value of hash type. More... | |
static Eina_Bool | eina_value_hash_set (Eina_Value *value, const char *key,...) |
Sets the generic value in an hash member. More... | |
static Eina_Bool | eina_value_hash_get (const Eina_Value *value, const char *key,...) |
Gets the generic value from an hash member. More... | |
static Eina_Bool | eina_value_hash_vset (Eina_Value *value, const char *key, va_list args) |
Sets the generic value in an hash member. More... | |
static Eina_Bool | eina_value_hash_vget (const Eina_Value *value, const char *key, va_list args) |
Gets the generic value from an hash member. More... | |
static Eina_Bool | eina_value_hash_pset (Eina_Value *value, const char *key, const void *ptr) |
Sets the generic value in an hash member from pointer. More... | |
static Eina_Bool | eina_value_hash_pget (const Eina_Value *value, const char *key, void *ptr) |
Gets the generic value to pointer from an hash member. More... | |
EINA_API Eina_Value * eina_value_hash_new | ( | const Eina_Value_Type * | subtype, |
unsigned int | buckets_power_size | ||
) |
Creates generic value storage of type hash.
[in] | subtype | How to manage this hash members. |
[in] | buckets_power_size | How to allocate hash buckets (2 ^ buckets_power_size), if zero then a sane value is chosen. |
NULL
on failure.Creates a new generic value storage of type hash. The members are managed using the description specified by subtype.
On failure, NULL
is returned.
References eina_mempool_free(), eina_mempool_malloc(), EINA_SAFETY_ON_FALSE_RETURN_VAL, eina_value_hash_setup(), and eina_value_type_check().
|
inlinestatic |
Initializes generic value storage of type hash.
[in] | value | Value object |
[in] | subtype | How to manage this hash members. |
[in] | buckets_power_size | How to allocate hash buckets (2 ^ buckets_power_size), if zero then a sane value is chosen. |
Initializes new generic value storage of type hash with the given subtype.
This is the same as calling eina_value_set() with EINA_VALUE_TYPE_HASH followed by eina_value_pset() with the Eina_Value_Hash description configured.
On failure, EINA_FALSE is returned.
Referenced by eina_value_hash_new().
|
inlinestatic |
Queries number of elements in value of hash type.
[in] | value | value object. |
|
inlinestatic |
Removes element at given position in value of hash type.
[in,out] | value | value object. |
[in] | key | key to find the member |
|
inlinestatic |
Sets the generic value in an hash member.
[in,out] | value | Source value object |
[in] | key | Key to find the member |
[in] | ... | Variable arguments of data to set |
The variable argument is dependent on chosen subtype. The list for basic types:
|
inlinestatic |
Gets the generic value from an hash member.
[in] | value | Source value object |
[in] | key | Key to find the member |
[out] | ... |
The value is returned in the variable argument parameter, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
The variable argument is dependent on chosen subtype. The list for basic types:
|
inlinestatic |
Sets the generic value in an hash member.
[in,out] | value | Source value object |
[in] | key | Key to find the member |
[in] | args | Variable argument |
|
inlinestatic |
Gets the generic value from an hash member.
[in] | value | Source value object |
[in] | key | Key to find the member |
[out] | args | Variable argument |
The value is returned in the variable argument parameter, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
|
inlinestatic |
Sets the generic value in an hash member from pointer.
[in,out] | value | Source value object |
[in] | key | Key to find the member |
[in] | ptr | Pointer to specify the contents. |
The pointer type is dependent on chosen value type. The list for basic types:
|
inlinestatic |
Gets the generic value to pointer from an hash member.
[in] | value | Source value object |
[in] | key | Key to find the member |
[out] | ptr | Pointer to receive the contents. |
The value is returned in pointer contents, the actual value is type-dependent, but usually it will be what is stored inside the object. There shouldn't be any memory allocation, thus the contents should not be freed.
The pointer type is dependent on chosen value type. The list for basic types: