18 #define impl_afw_object_get_meta \
19 afw_object_impl_internal_get_meta
21 #define impl_afw_object_get_property_meta \
22 afw_object_impl_internal_get_property_meta
24 #define impl_afw_object_get_next_property_meta \
25 afw_object_impl_internal_get_next_property_meta
29 #define AFW_IMPLEMENTATION_ID "properties_callback"
34 #define IMPL_ASSERT_MUTABLE(instance, xctx) \
35 if (!(instance)->p) {\
36 AFW_THROW_ERROR_Z(general, \
37 "Can not set meta in a const object", xctx); \
53 self->pub.inf = &impl_afw_object_inf;
55 self->setter.inf = &impl_afw_object_setter_inf;
58 self->callbacks = &callbacks[0];
59 self->end = &callbacks[count];
117 for (e = self->callbacks; e < self->end; e++)
120 result = e->get(
self, property_name, xctx);
145 *property_name = NULL;
152 for (e = self->callbacks; e < self->end; e++)
154 result = e->get(
self, e->property_name, xctx);
158 *property_name = e->property_name;
195 return (self->immutable) ? NULL : &
self->setter;
209 self->immutable =
true;
226 if (!self->immutable) {
227 for (e = self->callbacks; e < self->end; e++)
233 e->set(self->data, property_name, value, xctx);
239 AFW_OBJECT_ERROR_PROPERTY_IMMUTABLE(property_name);
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
Interface afw_interface implementation declares.
struct afw_iterator_s afw_iterator_t
apr_size_t afw_size_t
size_t.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
const afw_object_setter_t * impl_afw_object_get_setter(const afw_object_t *instance, afw_xctx_t *xctx)
void impl_afw_object_add_reference(const afw_object_t *instance, afw_xctx_t *xctx)
const afw_value_t * impl_afw_object_get_next_property(const afw_object_t *instance, const afw_iterator_t **iterator, const afw_utf8_t **property_name, afw_xctx_t *xctx)
void impl_afw_object_release(const afw_object_t *instance, afw_xctx_t *xctx)
const afw_value_t * impl_afw_object_get_property(const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
afw_boolean_t impl_afw_object_has_property(const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
afw_size_t impl_afw_object_get_count(const afw_object_t *instance, afw_xctx_t *xctx)
void impl_afw_object_setter_set_immutable(const afw_object_setter_t *instance, afw_xctx_t *xctx)
void impl_afw_object_setter_set_property(const afw_object_setter_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
afw_object_create_properties_callback(void *data, afw_size_t count, const afw_object_properties_callback_entry_t callbacks[], const afw_pool_t *p, afw_xctx_t *xctx)
Create a mutable composite of unmutable objects.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
afw_boolean_t afw_utf8_equal(const afw_utf8_t *s1, const afw_utf8_t *s2)
Check to see if a string equals another string.
Struct for afw_object_properties_callback_entry_t.
Interface afw_object public struct.
Interface afw_object_setter public struct.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_value public struct.
Interface afw_xctx public struct.