Data Structures | |
struct | _Eina_Value_Array |
Used to store the array and its subtype. More... | |
Macros | |
#define | EINA_VALUE_ARRAY_FOREACH(Array, Length, It, Value) |
Definition for the macro to iterate over an array contained in an Eina_Value. More... | |
Typedefs | |
typedef struct _Eina_Value_Array | Eina_Value_Array |
Value type for EINA_VALUE_TYPE_ARRAY. More... | |
Functions | |
EINA_API Eina_Value * | eina_value_array_new (const Eina_Value_Type *subtype, unsigned int step) |
Creates generic value storage of type array. More... | |
static Eina_Bool | eina_value_array_setup (Eina_Value *value, const Eina_Value_Type *subtype, unsigned int step) |
Initializes generic value storage of type array. More... | |
static unsigned int | eina_value_array_count (const Eina_Value *value) |
Queries number of elements in value of array type. More... | |
static Eina_Bool | eina_value_array_remove (Eina_Value *value, unsigned int position) |
Removes element at given position in value of array type. More... | |
static Eina_Bool | eina_value_array_set (Eina_Value *value, unsigned int position,...) |
Sets the generic value in an array member. More... | |
static Eina_Bool | eina_value_array_get (const Eina_Value *value, unsigned int position,...) |
Gets the generic value from an array member. More... | |
static Eina_Bool | eina_value_array_insert (Eina_Value *value, unsigned int position,...) |
Inserts a generic value in an array member position. More... | |
static Eina_Bool | eina_value_array_append (Eina_Value *value,...) |
Appends a generic value in an array. More... | |
static Eina_Bool | eina_value_array_vset (Eina_Value *value, unsigned int position, va_list args) |
Sets a generic value to an array member. More... | |
static Eina_Bool | eina_value_array_vget (const Eina_Value *value, unsigned int position, va_list args) |
Gets the generic value from an array member. More... | |
static Eina_Bool | eina_value_array_vinsert (Eina_Value *value, unsigned int position, va_list args) |
Inserts a generic value to an array member position. More... | |
static Eina_Bool | eina_value_array_vappend (Eina_Value *value, va_list args) |
Appends a generic value to an array. More... | |
static Eina_Bool | eina_value_array_pset (Eina_Value *value, unsigned int position, const void *ptr) |
Sets a generic value to an array member from a pointer. More... | |
static Eina_Bool | eina_value_array_pget (const Eina_Value *value, unsigned int position, void *ptr) |
Retrieves a generic value into a pointer from an array member. More... | |
static Eina_Bool | eina_value_array_pinsert (Eina_Value *value, unsigned int position, const void *ptr) |
Inserts a generic value to an array member position from a pointer. More... | |
static Eina_Bool | eina_value_array_pappend (Eina_Value *value, const void *ptr) |
Appends a generic value to an array from a pointer. More... | |
static Eina_Bool | eina_value_array_value_get (const Eina_Value *src, unsigned int position, Eina_Value *dst) |
Retrieves a value from the array as an Eina_Value copy. More... | |
#define EINA_VALUE_ARRAY_FOREACH | ( | Array, | |
Length, | |||
It, | |||
Value | |||
) |
Definition for the macro to iterate over an array contained in an Eina_Value.
[in] | Array | The list to iterate over. |
[in] | Length | Contain the length of the array |
[out] | It | Contain the current position walked over |
[out] | Value | Contain the value at the current position. |
This macro iterates over array
from the first element to the last. value
is the data related to the current element.
It can be used like in the following example:
array
and v must be a pointer to an Eina_Value Value type for EINA_VALUE_TYPE_ARRAY.
EINA_API Eina_Value * eina_value_array_new | ( | const Eina_Value_Type * | subtype, |
unsigned int | step | ||
) |
Creates generic value storage of type array.
[in] | subtype | How to manage this array members. |
[in] | step | How to grow the members array. |
NULL
on failure.Create a new generic value storage of type array. 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_array_setup(), and eina_value_type_check().
|
inlinestatic |
Initializes generic value storage of type array.
[out] | value | Value object |
[in] | subtype | How to manage array members. |
[in] | step | How to grow the members array. |
Initializes new generic value storage of type array with the given subtype.
This is the same as calling eina_value_set() with EINA_VALUE_TYPE_ARRAY followed by eina_value_pset() with the Eina_Value_Array description configured.
On failure, EINA_FALSE is returned.
Referenced by eina_promise_all_array(), eina_promise_all_iterator(), and eina_value_array_new().
|
inlinestatic |
Queries number of elements in value of array type.
[in] | value | value object. |
|
inlinestatic |
Removes element at given position in value of array type.
[in,out] | value | value object. |
[in] | position | index of the member |
|
inlinestatic |
Sets the generic value in an array member.
[in,out] | value | Source value object |
[in] | position | Index of the member |
The variable argument is dependent on chosen subtype. The list for basic types:
|
inlinestatic |
Gets the generic value from an array member.
[in] | value | Source value object |
[in] | position | Index of the member |
The value is returned in the variable argument parameter, and 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 |
Inserts a generic value in an array member position.
[in] | value | Source value object |
[in] | position | Index of the member |
[in] | ... | Variable arguments of data to insert |
The variable argument is dependent on chosen subtype. The list for basic types:
|
inlinestatic |
Appends a generic value in an array.
[in,out] | value | Source value object |
[in] | ... | Variable arguments |
The variable argument is dependent on chosen subtype. The list for basic types:
Referenced by eina_promise_all_array(), and eina_promise_all_iterator().
|
inlinestatic |
Sets a generic value to an array member.
[in,out] | value | Source value object |
[in] | position | Index of the member |
[in] | args | Variable argument |
|
inlinestatic |
Gets the generic value from an array member.
[in] | value | Source value object |
[in] | position | Index of 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 |
Inserts a generic value to an array member position.
[in,out] | value | Source value object |
[in] | position | Index of the member |
[in] | args | Variable argument |
|
inlinestatic |
Appends a generic value to an array.
[in,out] | value | Source value object |
[in] | args | Variable argument |
|
inlinestatic |
Sets a generic value to an array member from a pointer.
[in,out] | value | Source value object |
[in] | position | Index of the member |
[in] | ptr | Pointer to specify the contents. |
The pointer type is dependent on chosen value type. The list for basic types:
|
inlinestatic |
Retrieves a generic value into a pointer from an array member.
[in] | value | Source value object |
[in] | position | Index of 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:
|
inlinestatic |
Inserts a generic value to an array member position from a pointer.
[in,out] | value | Source value object |
[in] | position | Index of the member |
[in] | ptr | Pointer to specify the contents. |
The pointer type is dependent on chosen value type. The list for basic types:
|
inlinestatic |
Appends a generic value to an array from a pointer.
[in,out] | value | Source value object |
[in] | ptr | Pointer to specify the contents. |
The pointer type is dependent on chosen value type. The list for basic types:
|
inlinestatic |
Retrieves a value from the array as an Eina_Value copy.
[in] | src | Source value object |
[in] | position | Index of the member |
[out] | dst | Where to return the array member |
The argument dst is considered uninitialized and it's set to the type of the member.