19 #define AFW_IMPLEMENTATION_ID "model"
27 impl_on_object_type_ids[] = {
38 AFW_UTF8_LITERAL( "/afw/" #id "/current"),
60 static const afw_utf8_t impl_factory_description =
68 &impl_afw_adaptor_factory_inf,
70 &impl_factory_description
75 impl_adapt_object_from_adaptor(
86 impl_get_property_type_by_mapped_property_name(
95 impl_add_adapted_properties_from_adaptor(
104 impl_get_property_type_by_property_name(
113 impl_model_object_cb(
120 impl_get_property_type_by_mapped_property_name(
133 mapped_property_name))
135 *property_type = *pt;
136 *property_name = (*pt)->property_name;
144 ? mapped_property_name
151 impl_get_property_type_by_property_name(
164 *property_type = *pt;
165 *mapped_property_name = (*pt)->mapped_property_name;
180 impl_add_adapted_properties_from_adaptor(
198 ctx->property_level.model_property_type = *pt;
200 mapped_object, (*pt)->mapped_property_name, xctx);
202 use_default_processing =
true;
203 if ((*pt)->onGetProperty) {
206 if (value != ctx->useDefaultProcessing_value) {
209 use_default_processing =
false;
213 if (use_default_processing) {
214 value = ctx->property_level.mapped_value;
215 if (!value && (*pt)->default_value) {
223 (*pt)->property_name,
226 else if ((*pt)->required) {
248 impl_adapt_object_from_adaptor(
269 ctx = afw_model_internal_create_skeleton_context(
271 instance_skeleton__AdaptiveModelCurrentOnGetProperty_,
272 &afw_model_internal_context_current_property_from_mapped[0],
273 self, impl_request, model_object_type, p, xctx);
274 ctx->criteria = criteria;
275 ctx->mapped_object = mapped_object;
276 ctx->from_adaptor =
true;
279 ctx->object_id = object_id;
284 &self->adaptor->pub.adaptor_id,
286 ctx->object_id, xctx);
303 impl_add_adapted_properties_from_adaptor(
object,
304 model_object_type, mapped_object, ctx, xctx);
320 afw_model_internal_convert_property(
333 *to_property_name = from_property_name;
334 *to_value = from_value;
335 if (!object_type)
return;
338 switch (adapt_type) {
340 case afw_model_adapt_to_adaptor:
341 case afw_model_adapt_to_requestor:
342 impl_get_property_type_by_property_name(
343 &property_type, to_property_name,
344 object_type, from_property_name, xctx);
345 if (!property_type) {
349 property_type->
data_type,
false, p, xctx);
352 case afw_model_adapt_from_adaptor:
353 case afw_model_adapt_from_requestor:
354 impl_get_property_type_by_mapped_property_name(
355 &property_type, to_property_name,
356 object_type, from_property_name, xctx);
357 if (!property_type) {
361 property_type->
data_type,
false, p, xctx);
380 afw_model_internal_convert_property_name(
391 *to_property_name = from_property_name;
392 if (!object_type)
return;
395 switch (adapt_type) {
397 case afw_model_adapt_to_adaptor:
398 case afw_model_adapt_to_requestor:
399 impl_get_property_type_by_property_name(
400 &property_type, to_property_name,
401 object_type, from_property_name, xctx);
402 if (!property_type)
goto error;
405 case afw_model_adapt_from_adaptor:
406 case afw_model_adapt_from_requestor:
407 impl_get_property_type_by_mapped_property_name(
408 &property_type, to_property_name,
409 object_type, from_property_name, xctx);
410 if (!property_type)
goto error;
438 if (!select || !*select) {
443 for (i = 0; select[i]; i++);
446 for (i = 0; select[i]; i++) {
447 afw_model_internal_convert_property_name(
449 afw_model_adapt_to_adaptor,
466 if (!old_entry || old_entry == (
void *)1) {
470 for (entry = wa->anchor;
471 entry && old_entry != entry->old_entry;
472 entry = entry->next_entry);
476 entry->old_entry = old_entry;
477 entry->next_entry = wa->anchor;
481 entry->converted.op_name = old_entry->op_name;
482 entry->converted.op_id = old_entry->op_id;
483 entry->converted.alt_not = old_entry->alt_not;
484 entry->converted.alt_op_id = old_entry->alt_op_id;
485 entry->converted.property_name = old_entry->property_name;
486 entry->converted.value = old_entry->value;
487 entry->converted.op_specific = old_entry->op_specific;
490 old_entry->first_conjunctive_child);
492 old_entry->next_conjunctive_sibling);
496 old_entry->on_false);
499 if (!entry->converted.value)
501 if (old_entry->property_name) {
502 afw_model_internal_convert_property_name(
503 wa->model_object_type,
504 afw_model_adapt_to_adaptor,
505 &entry->converted.property_name,
506 old_entry->property_name,
514 afw_model_internal_convert_property(
515 wa->model_object_type,
516 afw_model_adapt_to_adaptor,
517 &entry->converted.property_name, &entry->converted.value,
518 old_entry->property_name, old_entry->value,
519 NULL , wa->p, wa->xctx);
522 entry->converted.value,
528 return &entry->converted;
533 impl_convert_first_sort(
551 from_entry = first_sort,
554 prev_entry = new_entry,
555 from_entry = from_entry->next)
560 prev_entry->next = new_entry;
565 new_entry->descending = from_entry->descending;
566 afw_model_internal_convert_property_name(
568 afw_model_adapt_to_adaptor,
569 &new_entry->property_name,
570 from_entry->property_name,
606 modified_x.
xctx = xctx;
608 modified_x.
argc = argc;
609 modified_x.
argv = argv;
614 mapped_object = NULL;
622 if (!mapped_object) {
628 object = impl_adapt_object_from_adaptor(
629 cb_ctx->session, cb_ctx->impl_request,
630 cb_ctx->model_object_type, cb_ctx->object_id,
675 modified_x.
xctx = xctx;
677 modified_x.
argc = argc;
678 modified_x.
argv = argv;
713 object = impl_adapt_object_from_adaptor(
714 cb_ctx->session, cb_ctx->impl_request,
715 cb_ctx->model_object_type, cb_ctx->object_id,
724 abort = cb_ctx->original_callback(
object, cb_ctx->original_context, xctx);
744 wa.model_object_type = model_object_type;
751 impl_convert_select(model_object_type, criteria->select,
755 impl_convert_first_sort(model_object_type, criteria->first_sort,
778 &impl_afw_adaptor_inf,
780 properties, p, xctx);
786 self->mapBackObject_signature = (
const afw_value_t *)
788 &afw_s_model_mapBackObject_signature, xctx);
791 &afw_s_model_mapObject_signature, xctx);
792 self->returnObject_signature = (
const afw_value_t *)
794 &afw_s_model_returnObject_signature, xctx);
804 &afw_s_modelLocationAdaptorId, p, xctx);
805 if (
afw_utf8_equal(self->model_location_adaptor_id, &adaptor->adaptor_id)) {
808 "modelLocationAdaptorId can not be the same as adaptorId",
813 for (obj = &self->instance_skeleton[0], i = 0;
814 i < afw_model_on_map_count;
818 impl_on_object_type_ids[i], xctx);
821 "Internal error afw_model_adaptor_create_cede_p()",
824 meta = obj->
pub.inf->rti.implementation_specific;
825 obj->
pub.meta.
id = &afw_s_current;
831 model_location_adaptor = NULL;
840 self->model_location_adaptor_id, xctx);
841 if (!model_location_adaptor->impl || !model_location_adaptor->impl->
model_location) {
845 " does not hold _AdaptiveModel_ objects",
852 &afw_s_modelId, p, xctx);
856 if (model_location_adaptor) {
865 &afw_s_mappedAdaptorId, xctx);
866 if (!self->mappedAdaptorId_value) {
868 &afw_s_mappedAdaptorId, xctx);
872 &afw_s_mappedAdaptorId, xctx);
874 self->mapped_adaptor_id =
876 if (
afw_utf8_equal(self->mapped_adaptor_id, &self->pub.adaptor_id)) {
878 &afw_s_mappedAdaptorId, xctx);
890 impl_afw_adaptor_factory_create_adaptor_cede_p (
928 session->pub.inf = &impl_afw_adaptor_session_inf;
929 session->pub.adaptor = instance;
930 session->pub.p = xctx->p;
931 session->adaptor =
self;
934 self->model_location_adaptor_id, xctx);
935 if (!session->model_location_adaptor) {
940 session->model = afw_model_location_get_model(
941 session->model_location_adaptor, self->model_id, xctx);
942 if (!session->model) {
982 if (self->model_location_adaptor) {
990 impl_AdaptiveObjectType_cb(
1001 if (
object && ctx->criteria) {
1009 return ctx->original_callback(
object, ctx->original_context, xctx);
1016 impl_model_object_cb(
1025 object = mapped_object;
1027 object = impl_adapt_object_from_adaptor(
1028 ctx->session, ctx->impl_request,
1029 ctx->model_object_type, ctx->object_id,
1036 return ctx->original_callback(
object, ctx->original_context, xctx);
1062 apr_hash_index_t *hi;
1069 cb_ctx.session =
self;
1070 cb_ctx.original_context = context;
1071 cb_ctx.original_callback = callback;
1072 cb_ctx.criteria = criteria;
1074 if (
afw_utf8_equal(object_type_id, &afw_s__AdaptiveObjectType_)) {
1078 self->model->model_object_types);
1080 hi = apr_hash_next(hi))
1083 apr_hash_this(hi, (
const void **)&
id.s, (apr_ssize_t *)&
id.len,
1084 (
void **)&model_object_type);
1085 impl_AdaptiveObjectType_cb(model_object_type, &cb_ctx, xctx);
1087 callback(NULL, context, xctx);
1092 object_type_id, xctx);
1093 if (!cb_ctx.model_object_type) {
1094 callback(NULL, context, xctx);
1098 use_default_processing =
true;
1099 if (cb_ctx.model_object_type->onRetrieveObjects) {
1103 use_default_processing =
false;
1108 ctx = afw_model_internal_create_skeleton_context(
1110 instance_skeleton__AdaptiveModelCurrentOnRetrieveObjects_,
1111 &afw_model_internal_context_current_retrieve_objects[0],
1112 self, impl_request, cb_ctx.model_object_type, p, xctx);
1114 &afw_s_a_current_colon_colon_mapBackObject,
1115 adaptor->mapBackObject_signature,
1118 &afw_s_a_current_colon_colon_returnObject,
1119 adaptor->returnObject_signature,
1121 ctx->mapped_object_type_id_value =
1123 ctx->criteria = criteria;
1126 cb_ctx.model_object_type->onRetrieveObjects,
1128 if (result == ctx->useDefaultProcessing_value) {
1129 use_default_processing =
true;
1132 callback(NULL, context, xctx);
1143 if (use_default_processing) {
1146 cb_ctx.model_object_type, criteria, p, xctx);
1150 cb_ctx.model_object_type->mapped_object_type_id,
1151 impl_request->
options, cb_ctx.criteria,
1153 &cb_ctx, impl_model_object_cb,
1154 adaptor_type_specific,
1188 cb_ctx.session =
self;
1189 cb_ctx.original_context = context;
1190 cb_ctx.original_callback = callback;
1192 if (
afw_utf8_equal(object_type_id, &afw_s__AdaptiveObjectType_)) {
1195 object = (cb_ctx.model_object_type)
1196 ? cb_ctx.model_object_type->object_type_object
1198 callback(
object, context, xctx);
1203 object_type_id, xctx);
1204 cb_ctx.object_id = object_id;
1205 if (!cb_ctx.model_object_type) {
1206 callback(NULL, context, xctx);
1211 use_default_processing =
true;
1212 if (cb_ctx.model_object_type->onGetObject) {
1217 use_default_processing =
false;
1222 ctx = afw_model_internal_create_skeleton_context(
1224 instance_skeleton__AdaptiveModelCurrentOnGetObject_,
1225 &afw_model_internal_context_current_get_object[0],
1226 self, impl_request, cb_ctx.model_object_type, p, xctx);
1228 &afw_s_a_current_colon_colon_mapBackObject,
1229 adaptor->mapBackObject_signature,
1231 ctx->mapped_object_type_id_value =
1233 ctx->object_id = object_id;
1236 cb_ctx.model_object_type->onGetObject,
1238 if (object_value == ctx->useDefaultProcessing_value) {
1239 use_default_processing =
true;
1250 "onGetObject returned invalid value", xctx);
1253 callback(
object, context, xctx);
1265 if (use_default_processing) {
1267 self->adaptor->mapped_adaptor_id,
1268 cb_ctx.model_object_type->mapped_object_type_id,
1269 object_id, NULL, NULL,
1271 adaptor_type_specific, p, xctx);
1273 cb_ctx.session =
self;
1274 cb_ctx.original_context = context;
1275 cb_ctx.original_callback = callback;
1276 impl_model_object_cb(mapped_object, &cb_ctx, xctx);
1307 &iterator, &property_name, xctx)))
1309 impl_get_property_type_by_property_name(
1310 &pt, &mapped_property_name,
1311 ctx->model_object_type, property_name, xctx);
1315 ctx->impl_request->request,
1316 property_name, xctx,
1322 mapped_value = value;
1324 ctx->property_level.model_property_type = pt;
1325 ctx->property_level.value = value;
1328 if (mapped_value == ctx->useDefaultProcessing_value) {
1329 mapped_value = value;
1331 ctx->property_level.model_property_type = NULL;
1332 ctx->property_level.value = NULL;
1336 mapped_property_name, mapped_value, xctx);
1344 if (ctx->process_initial_values) {
1345 pts = ctx->model_object_type->property_type;
1346 if (pts)
for (; *pts; pts++) {
1369 afw_model_internal_complete_ctx_default_add_object(
1376 ctx->mapped_object =
1381 ctx->current_variables =
1382 &afw_model_internal_context_current_for_initial_object_id[0];
1415 if (
afw_utf8_equal(object_type_id, &afw_s__AdaptiveObjectType_)) {
1416 AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
1421 mapped_object_id = NULL;
1425 ctx = afw_model_internal_create_to_adaptor_skeleton_context(
1427 &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnAddObject_,
1431 suggested_object_id,
1433 ctx->object = object;
1434 ctx->process_initial_values =
true;
1437 use_default_processing =
true;
1439 use_default_processing =
false;
1442 if (value == ctx->useDefaultProcessing_value) {
1443 use_default_processing =
true;
1454 if (use_default_processing) {
1455 afw_model_internal_complete_ctx_default_add_object(ctx, xctx);
1458 self->adaptor->mapped_adaptor_id,
1459 ctx->mapped_object_type_id,
1460 ctx->mapped_object_id,
1463 adaptor_type_specific,
1477 return mapped_object_id;
1499 for (entry = ctx->modify_entries; *entry; entry++, mapped_entry++)
1501 first_property_name_entry = ((*entry)->first_property_name_entry);
1502 if (!first_property_name_entry ||
1503 first_property_name_entry->next)
1506 "Model adaptor only supports modify at the entity level",
1516 if ((*entry)->type < 0 ||
1517 (*entry)->type >= afw_adaptor_modify_entry_type_invalid)
1526 impl_get_property_type_by_property_name(
1527 &model_property_type, &mapped_property_name, ctx->model_object_type,
1528 &(*entry)->first_property_name_entry->property_name, xctx);
1529 if (!model_property_type) {
1539 if ((*entry)->value) {
1540 value = (*entry)->value;
1542 ctx->property_level.model_property_type =
1543 model_property_type;
1544 ctx->property_level.value = value;
1580 if (
afw_utf8_equal(object_type_id, &afw_s__AdaptiveObjectType_)) {
1581 AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
1589 ctx = afw_model_internal_create_to_adaptor_skeleton_context(
1591 &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnModifyObject_,
1600 use_default_processing =
true;
1602 use_default_processing =
false;
1609 if (value == ctx->useDefaultProcessing_value) {
1610 use_default_processing =
true;
1615 if(use_default_processing) {
1619 self->adaptor->mapped_adaptor_id,
1620 ctx->mapped_object_type_id,
1621 ctx->mapped_object_id,
1623 journal_entry, adaptor_type_specific,
1641 afw_model_internal_complete_ctx_default_replace_object(
1673 if (
afw_utf8_equal(object_type_id, &afw_s__AdaptiveObjectType_)) {
1674 AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
1682 ctx = afw_model_internal_create_to_adaptor_skeleton_context(
1684 &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnReplaceObject_,
1690 ctx->object = replacement_object;
1693 use_default_processing =
true;
1695 use_default_processing =
false;
1698 if (value == ctx->useDefaultProcessing_value) {
1699 use_default_processing =
true;
1704 if (use_default_processing) {
1706 afw_model_internal_complete_ctx_default_replace_object(ctx, xctx);
1708 self->adaptor->mapped_adaptor_id,
1709 ctx->mapped_object_type_id,
1710 ctx->mapped_object_id,
1712 journal_entry, adaptor_type_specific,
1730 afw_model_internal_complete_ctx_default_delete_object(
1760 if (
afw_utf8_equal(object_type_id, &afw_s__AdaptiveObjectType_)) {
1761 AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
1769 ctx = afw_model_internal_create_to_adaptor_skeleton_context(
1771 &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnDeleteObject_,
1779 use_default_processing =
true;
1781 use_default_processing =
false;
1784 if (value == ctx->useDefaultProcessing_value) {
1785 use_default_processing =
true;
1790 if (use_default_processing) {
1792 afw_model_internal_complete_ctx_default_delete_object(ctx, xctx);
1794 ctx->mapped_object_type_id, ctx->mapped_object_id,
1795 journal_entry, NULL, xctx);
1834 impl_afw_adaptor_session_get_journal_interface (
1877 impl_afw_adaptor_session_get_object_type_cache_interface(
1885 &self->object_type_cache,
1886 &impl_afw_adaptor_object_type_cache_inf,
1887 instance,
true, xctx);
1889 return &
self->object_type_cache;
1898 impl_afw_adaptor_object_type_cache_get(
1909 *final_result =
false;
1911 if (!model->object_types_ht) {
1917 result = apr_hash_get(model->object_types_ht,
1918 object_type_id->s, object_type_id->len);
1931 impl_afw_adaptor_object_type_cache_set(
1943 if (!model->object_types_ht) {
1944 model->object_types_ht = apr_hash_make(
1948 apr_hash_set(model->object_types_ht,
1949 object_type->object_type_id->s,
1950 object_type->object_type_id->len,
Interface afw_interface implementation declares.
Interface afw_interface implementation declares.
AFW_DEFINE(const afw_object_t *)
Interface afw_interface implementation declares.
Interface afw_interface implementation declares.
#define AFW_DEFINE_INTERNAL(type)
Define an internal function for /src/afw/ source*.c files.
#define AFW_DEFINE_CONST_DATA(type)
Define a public afw variable.
Adaptive Framework Core Internal.
const afw_query_criteria_filter_entry_t * impl_get_converted_entry(impl_convert_entry_wa_t *wa, const afw_query_criteria_filter_entry_t *old_entry)
const afw_value_t * impl_execute_mapBackObject_thunk(const afw_value_function_thunk_t *thunk, afw_size_t argc, const afw_value_t *const *argv, const afw_pool_t *p, afw_xctx_t *xctx)
const afw_value_t * impl_execute_returnObject_thunk(const afw_value_function_thunk_t *thunk, afw_size_t argc, const afw_value_t *const *argv, const afw_pool_t *p, afw_xctx_t *xctx)
const afw_object_t * impl_afw_adaptor_get_additional_metrics(const afw_adaptor_t *instance, const afw_pool_t *p, afw_xctx_t *xctx)
void impl_afw_adaptor_destroy(const afw_adaptor_t *instance, afw_xctx_t *xctx)
const afw_adaptor_session_t * impl_afw_adaptor_create_adaptor_session(const afw_adaptor_t *instance, afw_xctx_t *xctx)
afw_adaptor_impl_throw_property_invalid(const afw_adaptor_t *adaptor, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Developers should call this for configuration property errors.
afw_adaptor_impl_throw_property_required(const afw_adaptor_t *adaptor, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Developers should call this for missing required configuration property.
#define AFW_ADAPTOR_IMPL_LOCK_WRITE_END
Macro to end an adaptor write lock section.
afw_adaptor_impl_object_type_cache_initialize(afw_adaptor_object_type_cache_t *object_type_cache, const afw_adaptor_object_type_cache_inf_t *inf, const afw_adaptor_session_t *session, afw_boolean_t all_object_types_immutable, afw_xctx_t *xctx)
Initialize object type cache instance.
#define AFW_ADAPTOR_IMPL_LOCK_READ_END
Macro to end an adaptor read lock section.
afw_adaptor_impl_create_cede_p(const afw_adaptor_inf_t *inf, afw_size_t instance_size, const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
Developers should call this in all create functions for afw_adaptor.
#define AFW_ADAPTOR_IMPL_LOCK_READ_BEGIN(adaptor)
Macro to begin an adaptor read lock section.
#define AFW_ADAPTOR_IMPL_LOCK_WRITE_BEGIN(adaptor)
Macro to begin an adaptor write lock section.
void impl_afw_adaptor_session_modify_object(const afw_adaptor_session_t *instance, const afw_adaptor_impl_request_t *impl_request, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_adaptor_modify_entry_t *const *entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
void impl_afw_adaptor_session_replace_object(const afw_adaptor_session_t *instance, const afw_adaptor_impl_request_t *impl_request, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *replacement_object, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
void impl_afw_adaptor_session_delete_object(const afw_adaptor_session_t *instance, const afw_adaptor_impl_request_t *impl_request, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
void impl_afw_adaptor_session_retrieve_objects(const afw_adaptor_session_t *instance, const afw_adaptor_impl_request_t *impl_request, const afw_utf8_t *object_type_id, const afw_query_criteria_t *criteria, void *context, afw_object_cb_t callback, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx)
const afw_adaptor_transaction_t * impl_afw_adaptor_session_begin_transaction(const afw_adaptor_session_t *instance, afw_xctx_t *xctx)
void impl_afw_adaptor_session_destroy(const afw_adaptor_session_t *instance, afw_xctx_t *xctx)
const afw_adaptor_impl_index_t * impl_afw_adaptor_session_get_index_interface(const afw_adaptor_session_t *instance, afw_xctx_t *xctx)
const afw_utf8_t * impl_afw_adaptor_session_add_object(const afw_adaptor_session_t *instance, const afw_adaptor_impl_request_t *impl_request, const afw_utf8_t *object_type_id, const afw_utf8_t *suggested_object_id, const afw_object_t *object, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
void impl_afw_adaptor_session_get_object(const afw_adaptor_session_t *instance, const afw_adaptor_impl_request_t *impl_request, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, void *context, afw_object_cb_t callback, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx)
const afw_adaptor_key_value_t * impl_afw_adaptor_session_get_key_value_interface(const afw_adaptor_session_t *instance, afw_xctx_t *xctx)
afw_adaptor_modify_entry_type_value(afw_adaptor_modify_entry_type_t type)
Convert entry type enum to value.
afw_adaptor_retrieve_objects(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_object_options_t *options, const afw_query_criteria_t *criteria, const afw_object_t *journal_entry, void *context, afw_object_cb_t callback, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx)
Retrieve objects.
afw_adaptor_replace_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *replacement_object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Replace object and remove from cache.
afw_adaptor_add_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *suggested_object_id, const afw_object_t *object, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Call adaptor to add object and remove from cache.
afw_adaptor_release(const afw_adaptor_t *instance, afw_xctx_t *xctx)
Release an adaptor accessed by afw_adaptor_get_reference().
afw_adaptor_session_get_cached(const afw_utf8_t *adaptor_id, afw_boolean_t begin_transaction, afw_xctx_t *xctx)
Get/create an active cached session for adaptor_id.
afw_adaptor_modify_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_list_t *entries, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Modify object and remove from cache.
afw_adaptor_get_reference(const afw_utf8_t *adaptor_id, afw_xctx_t *xctx)
Get an adaptor and make sure it is started.
afw_adaptor_get_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_options_t *options, const afw_query_criteria_t *criteria, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, const afw_pool_t *p, afw_xctx_t *xctx)
Get and cache object.
afw_adaptor_delete_object(const afw_utf8_t *adaptor_id, const afw_utf8_t *object_type_id, const afw_utf8_t *object_id, const afw_object_t *journal_entry, const afw_object_t *adaptor_type_specific, afw_xctx_t *xctx)
Delete object from cache and via adaptor.
afw_adaptor_modify_entries_to_list(const afw_adaptor_modify_entry_t *const *entries, const afw_pool_t *p, afw_xctx_t *xctx)
Create a list from modify entries in specified pool.
#define afw_value_is_boolean(A_VALUE)
Macro to determine if value is evaluated boolean.
afw_value_create_list(const afw_list_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type list value.
#define afw_value_is_list(A_VALUE)
Macro to determine if value is evaluated list.
afw_data_type_list
Data type struct for list.
#define afw_value_is_object(A_VALUE)
Macro to determine if value is evaluated object.
afw_value_create_object(const afw_object_t *internal, const afw_pool_t *p, afw_xctx_t *xctx)
Create function for unmanaged data type object value.
#define afw_value_is_string(A_VALUE)
Macro to determine if value is evaluated string.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
afw_boolean_t(* afw_object_cb_t)(const afw_object_t *object, void *context, afw_xctx_t *xctx)
Typedef for afw_adaptor_session_object callback.
#define AFW_UTF8_LITERAL(A_STRING)
String literal initializer.
#define AFW_UTF8_CONTEXTUAL_LABEL_FMT
Format string used for source location.
struct afw_iterator_s afw_iterator_t
#define AFW_UTF8_FMT_OPTIONAL_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify optional arg.
struct afw_model_internal_s afw_model_t
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
apr_size_t afw_size_t
size_t.
const afw_value_function_definition_t * afw_environment_get_function(const afw_utf8_t *function_id, afw_xctx_t *xctx)
Get the function instance associated with function id.
const afw_object_inf_t * afw_environment_get_runtime_object_map_inf(const afw_utf8_t *object_type_id, afw_xctx_t *xctx)
Get the interface associated with a runtime object map.
#define AFW_FINALLY
Always executed regardless of error.
#define AFW_CATCH_UNHANDLED
Catch an unhandled error that occurs in a AFW_TRY block.
#define AFW_ENDTRY
Ends an AFW try block.
#define AFW_TRY
Begin an AFW TRY block.
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
#define AFW_ERROR_THROWN
Access the thrown error. See AFW_TRY.
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
#define afw_list_create_generic(p, xctx)
Create an value list in memory.
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.
#define AFW_LOG_FZ(priority, xctx, format_z,...)
Log an message to environment's log using a printf style format and parameters.
#define afw_memory_clear(to)
Clear preallocated memory for sizeof(*(to)).
afw_model_internal_create_basic_to_adaptor_mapped_object(afw_model_internal_context_t *ctx, afw_xctx_t *xctx)
afw_model_internal_complete_ctx_default_modify_object(afw_model_internal_context_t *ctx, afw_xctx_t *xctx)
afw_model_internal_convert_query_criteria(const afw_model_object_type_t *model_object_type, const afw_query_criteria_t *criteria, const afw_pool_t *p, afw_xctx_t *xctx)
Convert query criteria based on model.
afw_model_adaptor_create_cede_p(const afw_object_t *properties, const afw_pool_t *p, afw_xctx_t *xctx)
Create a model adaptor.
afw_adaptor_factory_model
afw_model_get_object_type(const afw_model_t *model, const afw_utf8_t *object_type_id, afw_xctx_t *xctx)
Get the model object type for an object type id from model.
enum afw_model_adapt_e afw_model_adapt_t
Typedef for model adapt type enum.
#define afw_object_get_property(instance, property_name, xctx)
Call method get_property 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.
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_managed(p, xctx)
Create an empty entity object in its own pool.
#define afw_object_create(p, xctx)
Create an empty unmanaged object in memory.
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.
#define afw_object_create_and_cede_p(p, xctx)
Create an empty entity object in memory in specified pool and cede control of the pool to the object.
#define afw_pool_malloc(instance, size, xctx)
Call method malloc of interface afw_pool.
#define afw_pool_get_apr_pool(instance)
Call method get_apr_pool of interface afw_pool.
#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.
afw_query_criteria_test_object(const afw_object_t *obj, const afw_query_criteria_t *criteria, const afw_pool_t *p, afw_xctx_t *xctx)
Test object against query criteria.
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_one_and_only(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Return value from one entry list or single value.
#define afw_value_evaluate(value, p, xctx)
Evaluate value if needed using specific pool.
afw_value_as_utf8(const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
afw_value_false
Adaptive value false.
#define afw_value_is_nullish(A_VALUE)
Determine if value is undefined or null.
afw_value_convert(const afw_value_t *value, const afw_data_type_t *to_data_type, afw_boolean_t required, const afw_pool_t *p, afw_xctx_t *xctx)
Convert a value to a value/data type.
#define afw_value_function_thunk_create(name, like_function_value, execute, ctx, p, xctx)
Create a function thunk value.
afw_value_true
Adaptive value true.
afw_xctx_get_qualifier_stack_top(afw_xctx_t *xctx)
Get qualifier stack top.
afw_xctx_set_qualifier_stack_top(int top, afw_xctx_t *xctx)
Set stack top index.
#define afw_xctx_calloc_type(type, xctx)
Macro to allocate cleared memory to hold type in xctx's pool.
Interface afw_adaptor_factory public struct.
Interface afw_adaptor_impl_index public struct.
Internal request info used by afw_adaptor_impl*() functions.
const afw_object_options_t * options
Object options.
const afw_model_location_t * model_location
Model location struct if this adaptor is a model location.
const afw_utf8_t * source_location
Source location associated with this adaptor.
Interface afw_adaptor_journal public struct.
Interface afw_adaptor_key_value public struct.
Interface afw_adaptor_object_type_cache public struct.
Interface afw_adaptor public struct.
Interface afw_adaptor_session public struct.
Interface afw_adaptor_transaction public struct.
Function execute parameter.
const afw_value_t *const * argv
This is the function parameters.
afw_xctx_t * xctx
The execution context (xctx) of caller.
const afw_value_function_definition_t * function
The evaluated function definition.
const afw_pool_t * p
Pool for result.
afw_size_t argc
This is the argv count not counting argv[0].
Interface afw_list public struct.
Internal struct used by afw_model* functions.
const afw_list_t * mapped_entries
Mapped entries for modify.
const afw_value_t * modify_entries_value
Original entries for modify as list value.
const afw_adaptor_modify_entry_t *const * modify_entries
Original entries for modify.
Struct for afw_model_object_type_t property_type_other member.
const afw_utf8_t * object_type_id
Object type id.
const afw_model_property_type_t ** property_type
NULL terminated list of property types for this object type.
const afw_value_t * mapped_object_type_id_value
mappedObjectType value.
const afw_object_t * object_type_object
Property type object.
const afw_value_t * onReplaceObject
onReplaceObject or NULL.
const afw_value_t * onGetInitialObjectId
onGetInitialObjectId or NULL.
const afw_value_t * onDeleteObject
onDeleteObject or NULL.
const afw_value_t * onAddObject
onAddObject or NULL.
const afw_value_t * onModifyObject
onModifyObject or NULL.
const afw_model_property_type_t * property_type_other
Property type for other properties.
const afw_value_t * onSetProperty
onSetProperty value or NULL if value from object used asis.
afw_boolean_t allow_write
allowRead.
const afw_value_t * onGetInitialValue
initial value or NULL if value from object used asis.
const afw_data_type_t * data_type
Data type or NULL if not restricted.
const afw_utf8_t * mapped_property_name
Mapped property name.
const afw_value_t * mapped_property_name_value
Mapped property name as adaptive value.
Property name path struct.
Interface afw_object public struct.
Struct for afw_object_type_t.
Interface afw_pool public struct.
Parsed filter entry from query string.
Struct for runtime objects.
NFC normalized UTF-8 string.
struct for data type boolean values.
Struct for function thunk value.
void * ctx
ctx passed on create.
const afw_utf8_t * name
name.
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.