17 #define impl_afw_object_get_meta \
18 afw_object_impl_internal_get_meta
20 #define impl_afw_object_get_property_meta \
21 afw_object_impl_internal_get_property_meta
23 #define impl_afw_object_get_next_property_meta \
24 afw_object_impl_internal_get_next_property_meta
28 #define AFW_IMPLEMENTATION_ID "object_meta"
33 #define IMPL_ASSERT_META_MUTABLE(instance, xctx) \
34 if (!(instance)->p) {\
35 AFW_THROW_ERROR_Z(general, \
36 "Can not set meta in a const object", xctx); \
50 meta_self->pub.p =
self->p;
51 meta_self->pub.inf = &impl_afw_object_inf;
53 meta_self->pub.meta.
id = &afw_s_a_meta_key;
55 meta_self->setter.inf = &impl_afw_object_setter_inf;
56 meta_self->setter.object = (
const afw_object_t *)meta_self;
57 meta_self->delta = delta;
79 &afw_s_objectTypes, xctx);
82 &afw_s_objectTypes, xctx);
85 object_type->meta.
id, object_type, xctx);
99 if (!from->meta.meta_object) {
103 if (self->meta.meta_object) {
107 impl_set_meta_object(
151 if (existing_parent_paths) {
183 &afw_s_parentPaths, xctx);
187 "Expecting parentPaths to be a list of anyURI",
203 if (instance->meta.embedding_object) {
205 "afw_object_meta_get_object_id() called for embedded object",
208 return instance->meta.id;
219 if (!instance->meta.embedding_object) {
221 "afw_object_meta_get_property_name() called for entity object",
224 return instance->meta.id;
240 path = instance->meta.object_uri;
246 if (!path && instance->p && instance->meta.embedding_object) {
249 self->meta.object_uri = path;
272 if (!instance->meta.meta_object && !instance->p) {
279 instance->meta.meta_object,
280 &afw_s_propertyTypes, xctx);
281 if (!property_types) {
283 meta, &afw_s_propertyTypes, xctx);
284 ((
afw_object_t *)property_types)->meta.object_type_uri =
285 &afw_s__AdaptiveMetaPropertyTypes_;
289 property_name, xctx);
290 if (!property_type) {
292 instance->meta.meta_object,
293 &afw_s_otherProperties, xctx);
298 property_name, property_type, xctx);
302 property_name, xctx);
305 &afw_s__AdaptiveMetaPropertyType_;
308 return property_type;
337 if (self->meta.meta_object) {
353 &afw_s_parentPaths, parent_paths, xctx);
361 if (!parsed_path->first_property_name) {
368 if (!instance->meta.object_type_uri) {
370 &afw_s_objectType, xctx);
371 if (!object_type_id &&
372 instance->meta.embedding_object &&
373 instance->meta.embedding_object->meta.meta_object)
376 meta, &afw_s_propertyTypes, xctx);
377 if (property_types) {
379 property_types, instance->meta.
id, xctx);
382 property_type, &afw_s_dataTypeParameter, xctx);
386 if (object_type_id) {
392 impl_set_meta_object(
self, meta, xctx);
404 if (instance->meta.meta_object) {
408 IMPL_ASSERT_META_MUTABLE(instance, xctx);
411 result = impl_set_meta_object(
426 if (!instance->meta.meta_object) {
430 if (instance->meta.meta_object->inf != &impl_afw_object_inf) {
444 if (!instance->meta.meta_object) {
448 if (instance->meta.meta_object->inf != &impl_afw_object_inf) {
467 IMPL_ASSERT_META_MUTABLE(instance, xctx);
472 meta_object->object_type = object_type;
484 IMPL_ASSERT_META_MUTABLE(instance, xctx);
486 ((
afw_object_t *)instance)->meta.object_type_uri = object_type_id;
520 IMPL_ASSERT_META_MUTABLE(instance, xctx);
524 object_type_id =
afw_utf8_clone(object_type_id, instance->p, xctx);
527 self->meta.object_type_uri = object_type_id;
528 self->meta.id = object_id;
530 adaptor_id, object_type_id, object_id, instance->p, xctx);
531 self->meta.object_uri = path;
548 IMPL_ASSERT_META_MUTABLE(instance, xctx);
552 &adaptor_id, &object_type_id, &object_id,
554 self->meta.object_type_uri = object_type_id;
555 self->meta.id = object_id;
556 self->meta.object_uri = path;
597 &afw_s_errors, errors, xctx);
617 if (instance->meta.meta_object) {
620 &afw_s_hasErrors, xctx);
681 impl_log_errors(errors, source_location, xctx);
686 &afw_s_propertyTypes, xctx);
687 if (property_types) {
690 property_types, &iterator, &property_name, xctx)))
693 &afw_s_errors, xctx);
700 impl_log_errors(errors, property_source_location, xctx);
708 &iterator, &property_name, xctx)))
721 property_source_location, xctx);
737 xctx->env->flag_index_response_error_hasAdditionalDetail, xctx))
763 property_name, xctx);
765 &afw_s_errors, xctx);
770 &afw_s_errors, errors, xctx);
792 if (!property_name) {
802 xctx->env->flag_index_response_error_hasAdditionalDetail, xctx))
812 else if (index >= 0) {
849 impl_afw_object_add_reference(
890 if (!result &&
afw_utf8_equal(property_name, &afw_s_properties)) {
894 if (!result && self->object_type && self->object_type->object_type_object) {
896 property_name, xctx);
912 impl_afw_object_get_next_property(
927 if (!self->object_type || !self->object_type->object_type_object)
931 *property_name = NULL;
944 self->object_type->object_type_object,
945 &i->iterator, &next_property_name, xctx);
949 *property_name = NULL;
962 *property_name = next_property_name;
970 self->delta, &i->iterator, property_name, xctx);
978 impl_afw_object_has_property(
996 impl_afw_object_get_setter(
1003 return &
self->setter;
1036 self->pub.meta.embedding_object,
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
Interface afw_interface implementation declares.
Interface afw_interface implementation declares.
afw_data_type_anyURI
Data type struct for anyURI.
#define afw_value_is_list_of_anyURI(A_VALUE)
Macro to determine if value is evaluated list of anyURI.
afw_list_of_anyURI_add(const afw_list_t *instance, const afw_utf8_t *value, afw_xctx_t *xctx)
Add value from list of anyURI.
afw_value_allocate_list(const afw_pool_t *p, afw_xctx_t *xctx)
Allocate function for unmanaged data type list value.
#define afw_object_old_get_property_as_list(object, property_name, xctx)
Get property function for data type list value.
afw_object_set_property_as_list(const afw_object_t *object, const afw_utf8_t *property_name, const afw_list_t *internal, afw_xctx_t *xctx)
Set property function for data type list values.
#define afw_value_is_object(A_VALUE)
Macro to determine if value is evaluated object.
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.
#define afw_object_old_get_next_property_as_object(object, iterator, property_name, xctx)
Get next property function for data type object value.
afw_value_create_string(const afw_utf8_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type string value.
#define afw_object_old_get_property_as_string(object, property_name, xctx)
Get property function for data type string value.
afw_data_type_string
Data type struct for string.
#define afw_list_of_string_get_next(list, iterator, xctx)
Get next value from list of string.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
#define AFW_UTF8_Z_LEN
String is NUL (0) terminate.
#define AFW_UTF8_CONTEXTUAL_LABEL_FMT
Format string used for source location.
struct afw_iterator_s afw_iterator_t
#define AFW_INTEGER_FMT
Format string specifier used for afw_integer_t.
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
apr_size_t afw_size_t
size_t.
apr_int64_t afw_integer_t
typedef for big signed int.
afw_error_to_utf8(const afw_error_t *error, const afw_pool_t *p, afw_xctx_t *xctx)
Convert error to utf8.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
#define afw_flag_is_active(flag_index, xctx)
Determine if flag for flag index is set in xctx.
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.
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.
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.
#define afw_list_of_create(data_type, p, xctx)
Create an list of a specific data type in memory.
#define AFW_LOG_FZ(priority, xctx, format_z,...)
Log an message to environment's log using a printf style format and parameters.
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_get_property(instance, property_name, xctx)
Call method get_property of interface afw_object.
#define afw_object_add_reference(instance, xctx)
Call method add_reference of interface afw_object.
#define afw_object_get_next_property(instance, iterator, property_name, xctx)
Call method get_next_property of interface afw_object.
#define afw_object_has_property(instance, property_name, xctx)
Call method has_property of interface afw_object.
#define afw_object_release(instance, xctx)
Call method release of interface afw_object.
#define afw_object_get_setter(instance, xctx)
Call method get_setter of interface afw_object.
afw_object_path_parse(const afw_utf8_t *path, const afw_utf8_t *current_path, const afw_object_options_t *default_options, const afw_pool_t *p, afw_xctx_t *xctx)
Parse an object value path in specific pool.
afw_object_path_make_for_embedded(const afw_object_t *embedded_object, const afw_pool_t *p, afw_xctx_t *xctx)
Construct the path for an embedded object.
afw_object_path_make(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_pool_t *p, afw_xctx_t *xctx)
Construct an object path in a specified pool.
afw_object_path_parse_simple(const afw_utf8_t *path, const afw_utf8_t **adaptor_id, const afw_utf8_t **object_type_id, const afw_utf8_t **object_id, const afw_pool_t *p, afw_xctx_t *xctx)
Parse simple path into ids.
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)
#define AFW_OBJECT_ASSERT_ENTITY(instance, xctx)
Asserts that an object is an entity.
afw_object_create_clone(const afw_object_t *object, const afw_pool_t *p, afw_xctx_t *xctx)
Clone an object to a specified pool.
afw_object_old_get_property_as_utf8(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_pool_t *p, afw_xctx_t *xctx)
Get an object's property value as a string in specified pool.
#define afw_object_create(p, xctx)
Create an empty unmanaged object in memory.
const afw_object_t * afw_object_get_entity(const afw_object_t *object, afw_xctx_t *xctx)
Get entity for object.
afw_object_old_get_property_as_boolean_deprecated(const afw_object_t *instance, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Get an object's property value as a boolean.
afw_object_set_property(const afw_object_t *instance, const afw_utf8_t *property_name, const afw_value_t *value, afw_xctx_t *xctx)
Set the value of an object's property.
const afw_object_t * 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_calloc_type(instance, type, xctx)
Macro to allocate cleared memory to hold type in pool.
#define afw_utf8_create_copy(s, len, p, xctx)
Make a utf-8 sting from chars in pool specified.
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.
const afw_utf8_t * afw_utf8_clone(const afw_utf8_t *string, const afw_pool_t *p, afw_xctx_t *xctx)
Clone a utf-8 string into a specific pool.
afw_utf8_printf(const afw_pool_t *p, afw_xctx_t *xctx, const afw_utf8_z_t *format,...)
Create a utf-8 string using a c format string in specified pool.
#define AFW_VALUE_ASSERT_IS_ANYURI_OR_STRING(A_VALUE, A_SCOPE)
Throw and error if A_VALUE is not anyURI or string.
afw_value_false
Adaptive value false.
afw_value_true
Adaptive value true.
#define afw_xctx_calloc_type(type, xctx)
Macro to allocate cleared memory to hold type in xctx's pool.
Adaptive Framework Error.
Interface afw_list public struct.
Typedef for parsed object path.
Interface afw_object public struct.
Interface afw_object_setter public struct.
Struct for afw_object_type_t.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
struct for data type anyURI values.
struct for data type list values.
struct for data type object values.
Interface afw_value public struct.
struct for data type string values.
Interface afw_xctx public struct.