16 #define impl_afw_object_get_meta \
17 afw_object_impl_internal_get_meta
19 #define impl_afw_object_get_property_meta \
20 afw_object_impl_internal_get_property_meta
22 #define impl_afw_object_get_next_property_meta \
23 afw_object_impl_internal_get_next_property_meta
26 #define AFW_IMPLEMENTATION_ID "memory"
46 self->pub.inf = &impl_afw_object_inf;
50 self->reference_count = (
self->unmanaged) ? 0 : 1;
51 self->setter.inf = &impl_afw_object_setter_inf;
70 if (embedding_object->inf != &impl_afw_object_inf) {
72 "Embedding object is not afw_memory object", xctx);
81 self->pub.inf = &impl_afw_object_inf;
83 self->pub.meta.embedding_object = embedding_object;
84 self->pub.meta.id = property_name;
85 self->managed_by_entity =
true;
86 self->reference_count = 1;
87 self->setter.inf = &impl_afw_object_setter_inf;
89 self->clone_on_set = embedder->clone_on_set;
93 embedding_object, property_name, (
const afw_object_t *)
self, xctx);
111 property_name, xctx);
115 property_name, xctx);
136 if (self->unmanaged)
return;
142 if (self->managed_by_entity) {
162 impl_afw_object_add_reference(
171 if (self->unmanaged)
return;
177 if (self->managed_by_entity) {
223 for (value = NULL, e = self->first_property; e; e = e->next) {
240 impl_afw_object_get_next_property(
252 e =
self->first_property;
262 for (; e && !e->value; e = e->next);
271 *property_name = NULL;
278 *property_name = e->name;
289 impl_afw_object_has_property(
309 impl_afw_object_get_setter (
317 return (self->immutable) ? NULL : &
self->setter;
335 self->immutable =
true;
355 AFW_OBJECT_IMPL_ASSERT_SELF_MUTABLE;
357 for (e = self->first_property,final_e = NULL; e; e = e->next) {
367 e->name = (property_name) ? property_name : &afw_s_a_empty_string;
378 e->value = (
self->clone_on_set)
385 self->first_property = e;
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
Interface afw_interface implementation declares.
afw_integer_t afw_atomic_integer_decrement(AFW_ATOMIC afw_integer_t *mem)
Integer atomic decrement.
afw_integer_t afw_atomic_integer_increment(AFW_ATOMIC afw_integer_t *mem)
Integer atomic increment.
afw_object_set_property_as_object(const afw_object_t *object, const afw_utf8_t *property_name, const afw_object_t *internal, afw_xctx_t *xctx)
Set property function for data type object values.
#define afw_object_old_get_property_as_object(object, property_name, xctx)
Get property function for data type object value.
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.
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_size_t impl_afw_object_get_count(const afw_object_t *instance, afw_xctx_t *xctx)
#define afw_object_add_reference(instance, xctx)
Call method add_reference of interface afw_object.
#define afw_object_release(instance, xctx)
Call method release of interface afw_object.
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)
#define AFW_OBJECT_MEMORY_OPTION_unmanaged
Object should be unmanaged.
#define AFW_OBJECT_GET_ENTITY(entity, object)
Macro to get entity for object.
afw_object_insure_embedded_exists(const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Insure embedded object exists creating if necessary.
afw_object_create_with_options(int options, const afw_pool_t *p, afw_xctx_t *xctx)
Create an empty entity object with options.
#define AFW_OBJECT_MEMORY_OPTION_IS(options_mask, option)
Test memory object option mask option.
#define AFW_OBJECT_MEMORY_OPTION_cede_p
Object cedes control of the specified pool.
afw_object_create_embedded(const afw_object_t *embedding_object, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Create an empty embedded object in a memory object.
#define afw_pool_release(instance, xctx)
Call method release of interface afw_pool.
#define afw_pool_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
const afw_pool_t * afw_pool_create(const afw_pool_t *parent, afw_xctx_t *xctx)
Create a new 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.
afw_value_clone(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Clone a value to specified pool.
Struct for name/value list entry.
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.