10 #define __AFW_LIST_H__
29 #define AFW_LIST_ERROR_OBJECT_IMMUTABLE \
30 AFW_THROW_ERROR_Z(read_only, "List immutable", xctx)
64 #define afw_list_of_create(data_type, p, xctx) \
65 afw_list_create_with_options(0, data_type, p, xctx)
81 #define afw_list_create_generic(p, xctx) \
82 afw_list_create_with_options(0, NULL, p, xctx)
241 const void *
internal;
276 #define AFW_LIST_INITIALIZE_WRAPPER_FOR_ARRAY( \
277 instance, _internal, _indirect, _data_type, _count) \
278 (instance)->inf = &afw_list_wrapper_for_array_inf; \
279 (instance)->p = NULL; \
280 (instance)->internal = _internal; \
281 (instance)->indirect = _indirect; \
282 (instance)->data_type = _data_type; \
283 (instance)->count = _count
297 #define AFW_LIST_INITIALIZE_WRAPPER_FOR_ARRAY_P(instance, \
298 _internal, _indirect, _data_type, _count, _p) \
299 (instance)->inf = &afw_list_wrapper_for_array_inf; \
300 (instance)->p = _p; \
301 (instance)->internal = _internal; \
302 (instance)->indirect = _indirect; \
303 (instance)->data_type = _data_type; \
304 (instance)->count = _count
373 const void *
internal,
415 const void *
internal,
454 #define afw_list_is_immutable(list, xctx) \
455 (afw_list_get_setter(list, xctx) == NULL)
AFW_DEFINE(const afw_object_t *)
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
AFW_DECLARE_CONST_DATA(afw_utf8_t) afw_s_200
afw_utf8_t for string 200
struct afw_iterator_s afw_iterator_t
apr_size_t afw_size_t
size_t.
void afw_list_remove_all_values(const afw_list_t *instance, afw_xctx_t *xctx)
Call method remove_all_values of interface afw_list_setter.
const afw_list_t * afw_list_const_create_null_terminated_array_of_objects(const afw_object_t *const *objects, const afw_pool_t *p, afw_xctx_t *xctx)
Create an immutable list from NULL terminated array of objects.
const afw_data_type_t * afw_list_determine_data_type_and_set_immutable(const afw_list_t *instance, afw_xctx_t *xctx)
Set list to immutable and determine data type of entries.
afw_list_create_wrapper_for_array(const void *array, afw_boolean_t indirect, const afw_data_type_t *data_type, afw_size_t count, const afw_pool_t *p, afw_xctx_t *xctx)
Create a immutable list wrapper for an array.
void afw_list_set_value_by_index(const afw_list_t *instance, afw_size_t index, const afw_value_t *value, afw_xctx_t *xctx)
Call method set_value_by_index of interface afw_list_setter.
void afw_list_remove_value(const afw_list_t *instance, const afw_value_t *value, afw_xctx_t *xctx)
Call method remove_value of interface afw_list_setter.
afw_list_wrapper_for_array_inf
inf for afw_list_wrapper_for_array afw_list implementation.
const afw_list_t * afw_list_create_or_clone(const afw_list_t *list, const afw_data_type_t *data_type, afw_boolean_t clone_values, const afw_pool_t *p, afw_xctx_t *xctx)
Create a clone of a list in memory.
void afw_list_remove_internal(const afw_list_t *instance, const afw_data_type_t *data_type, const void *internal, afw_xctx_t *xctx)
Call method remove of interface afw_list_setter.
const afw_list_t * afw_list_const_create_null_terminated_array_of_values(const afw_value_t *const *values, const afw_pool_t *p, afw_xctx_t *xctx)
Create an immutable list from NULL terminated array of values.
const afw_list_t * afw_list_convert_to_list_of_strings(const afw_list_t *list, const afw_pool_t *p, afw_xctx_t *xctx)
Convert a list to a list of strings.
afw_list_of_utf8_get_next(const afw_list_t *instance, const afw_iterator_t **iterator, afw_xctx_t *xctx)
Get next value from list whose data type cType is afw_utf8_t.
const afw_list_t * afw_list_of_create_from_value(const afw_data_type_t *data_type, const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Create a typed list from a value.
void afw_list_add_internal(const afw_list_t *instance, const afw_data_type_t *data_type, const void *internal, afw_xctx_t *xctx)
Call method add of interface afw_list_setter.
const afw_list_t * afw_list_const_create_array_of_objects(const afw_object_t *const *objects, afw_size_t count, const afw_pool_t *p, afw_xctx_t *xctx)
Create an immutable list from an array of objects.
const afw_list_t * afw_list_const_create_array_of_values(const afw_value_t *const *values, afw_size_t count, const afw_pool_t *p, afw_xctx_t *xctx)
Create an immutable list from an array of values.
void afw_list_add_value(const afw_list_t *instance, const afw_value_t *value, afw_xctx_t *xctx)
Call method add_value of interface afw_list_setter.
const afw_list_t * afw_list_create_with_options(int options, const afw_data_type_t *data_type, const afw_pool_t *p, afw_xctx_t *xctx)
Create an list in memory with options.
struct afw_list_wrapper_for_array_self_s afw_list_wrapper_for_array_self_t
Self for immutable list wrapper for a array.
void afw_list_set_immutable(const afw_list_t *instance, afw_xctx_t *xctx)
Set a list to immutable if not already.
Interface afw_data_type public struct.
Interface afw_list_inf_s struct.
Interface afw_list public struct.
Self for immutable list wrapper for a array.
Interface afw_object public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_value public struct.
Interface afw_xctx public struct.