Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_function_model.c
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * afw_function_execute_* functions for model
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
14 #include "afw_internal.h"
15 
16 
17 
18 static const afw_value_string_t
19 impl_value_add_object = {
21  AFW_UTF8_LITERAL("add_object")
22 };
23 
24 static const afw_value_string_t
25 impl_value_delete_object = {
27  AFW_UTF8_LITERAL("delete_object")
28 };
29 
30 static const afw_value_string_t
31 impl_value_modify_object = {
33  AFW_UTF8_LITERAL("modify_object")
34 };
35 
36 static const afw_value_string_t
37 impl_value_replace_object = {
39  AFW_UTF8_LITERAL("replace_object")
40 };
41 
42 
43 static void
44 impl_get_self_and_model(
46  const afw_model_t * *model,
47  const afw_value_string_t *adaptorId_value,
48  const afw_value_string_t *modelId_value,
49  afw_xctx_t *xctx)
50 {
51  const afw_adaptor_session_t *session;
52 
53  session = afw_adaptor_session_get_cached(&adaptorId_value->internal,
54  false, xctx);
56  &session->inf->rti.implementation_id,
57  "adaptor_impl"))
58  {
59  session =
60  ((afw_adaptor_impl_session_t *)session)->wrapped_session;
61  }
63  if (!afw_utf8_equal(
64  &(*self)->pub.inf->rti.implementation_id,
65  &afw_s_model))
66  {
67  AFW_THROW_ERROR_FZ(general, xctx,
68  "%" AFW_UTF8_FMT " is not a model adaptor",
69  AFW_UTF8_FMT_ARG(&adaptorId_value->internal));
70  }
71 
72  *model = (*self)->model;
73 
75  if (modelId_value) {
76  AFW_THROW_ERROR_Z(general, "modelId is not implemented", xctx);
77  }
78 }
79 
80 
81 
82 /*
83  * Adaptive function: model_default_add_object_action
84  *
85  * afw_function_execute_model_default_add_object_action
86  *
87  * See afw_function_bindings.h for more information.
88  *
89  * This function returns a _AdaptiveAction_ object for the default action
90  * performed if a onAdd parameter is not specified on the associated
91  * _AdaptiveModelObjectType_. The action is not performed, but be aware that
92  * functions called while producing the _AdaptiveAction_ object may cause side
93  * effects. This function can be called as part of a onAdd expression or for
94  * testing.
95  *
96  * This function is not pure, so it may return a different result
97  * given exactly the same parameters.
98  *
99  * Declaration:
100  *
101  * ```
102  * function model_default_add_object_action(
103  * adaptorId: string,
104  * objectType: string,
105  * object: object,
106  * objectId?: string,
107  * modelId?: string,
108  * context?: (object _AdaptiveContextType_)
109  * ): (object _AdaptiveAction_);
110  * ```
111  *
112  * Parameters:
113  *
114  * adaptorId - (string) This is the adaptorId of a model adaptor. Variable
115  * custom::adaptorId can be used to access this value in model
116  * expressions.
117  *
118  * objectType - (string) This is the adaptive object type of object being
119  * added. Variable custom::objectType can be used to access this value in
120  * model expressions.
121  *
122  * object - (object) This is the object to add. Variable custom::object can
123  * be used to access this value in model expressions.
124  *
125  * objectId - (optional string) This is the optional preferred objectId of
126  * object to add. The adaptor may ignore this. Variable custom::objectId
127  * can be used to access this value in model expressions.
128  *
129  * modelId - (optional string) This specifics a modelId of model to use for
130  * producing results. If not specified, the adaptor's current model will
131  * be used.
132  *
133  * context - (optional object _AdaptiveContextType_) This specifies
134  * additional context information available to model expressions.
135  *
136  * Returns:
137  *
138  * (object _AdaptiveAction_) The default action object.
139  */
140 const afw_value_t *
143 {
144  afw_xctx_t *xctx = x->xctx;
147  const afw_utf8_t *object_id;
148  const afw_object_t *context;
149  const afw_value_string_t *adaptorId_value;
150  const afw_value_string_t *objectType_value;
151  const afw_value_string_t *string_value;
152  const afw_value_string_t *modelId_value;
153  const afw_value_object_t *object_value;
154  const afw_object_t *result;
155  const afw_model_t *model;
156  int top;
157 
158  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(adaptorId_value, 1, string);
159  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectType_value, 2, string);
161 
162  object_id = NULL;
165  object_id = &string_value->internal;
166  }
167 
168  modelId_value = NULL;
170  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(modelId_value, 5, string);
171  }
172 
173  context = NULL;
176  context = object_value->internal;
177  }
178 
179  /* _AdaptiveObjectType_ objects are immutable in model adaptor. */
180  if (afw_utf8_equal(&objectType_value->internal, &afw_s__AdaptiveObjectType_)) {
181  AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
182  }
183 
184  /* Save top for qualifier stack. */
186  ctx = NULL;
187 
188  AFW_TRY {
189 
190  if (context) {
191  afw_xctx_push_qualifiers_object(context, false, x->p, xctx);
192  }
193 
194  /* Get session self and model. */
195  impl_get_self_and_model(&self, &model, adaptorId_value, modelId_value, xctx);
196 
197  /* Prime context for "to adaptor". */
198  ctx = afw_model_internal_create_to_adaptor_skeleton_context(
199  self,
200  &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnAddObject_,
201  model,
202  NULL,
203  &objectType_value->internal,
204  object_id,
205  xctx);
206  ctx->object = object_value->internal;
207  ctx->process_initial_values = true;
208 
209  /* Complete ctx for default add object. */
210  afw_model_internal_complete_ctx_default_add_object(ctx, xctx);
211  }
212 
213  /* Always restore top for qualifier stack to entry value. */
214  AFW_FINALLY{
216  }
217 
218  AFW_ENDTRY;
219 
220  result = afw_object_create(x->p, xctx);
221  afw_object_set_property(result, &afw_s_function,
222  (const afw_value_t *)&impl_value_add_object, xctx);
223  afw_object_set_property_as_string(result, &afw_s_adaptorId,
224  self->adaptor->mapped_adaptor_id, xctx);
225  afw_object_set_property_as_string(result, &afw_s_objectType,
226  ctx->mapped_object_type_id, xctx);
227  if (ctx->mapped_object_id) {
228  afw_object_set_property_as_string(result, &afw_s_objectId,
229  ctx->mapped_object_id, xctx);
230  }
231  afw_object_set_property_as_object(result, &afw_s_object,
232  ctx->mapped_object, xctx);
233 
234  return afw_value_create_object(result, x->p, xctx);
235 }
236 
237 
238 
239 /*
240  * Adaptive function: model_default_delete_object_action
241  *
242  * afw_function_execute_model_default_delete_object_action
243  *
244  * See afw_function_bindings.h for more information.
245  *
246  * This function returns a _AdaptiveAction_ object for the default action
247  * performed if a onDeleteObject parameter is not specified on the associated
248  * _AdaptiveModelObjectType_. The action is not performed, but be aware that
249  * functions called while producing the _AdaptiveAction_ object may cause side
250  * effects. This function can be called as part of a onDelete expression or for
251  * testing.
252  *
253  * This function is not pure, so it may return a different result
254  * given exactly the same parameters.
255  *
256  * Declaration:
257  *
258  * ```
259  * function model_default_delete_object_action(
260  * adaptorId: string,
261  * objectType: string,
262  * objectId: string,
263  * modelId?: string,
264  * context?: (object _AdaptiveContextType_)
265  * ): (object _AdaptiveAction_);
266  * ```
267  *
268  * Parameters:
269  *
270  * adaptorId - (string) This is the adaptorId of a model adaptor. Variable
271  * custom::adaptorId can be used to access this value in model
272  * expressions.
273  *
274  * objectType - (string) This is the adaptive object type of object being
275  * deleted. Variable custom::objectType can be used to access this value
276  * in model expressions.
277  *
278  * objectId - (string) This is the objectId of object to delete. Variable
279  * custom::object can be used to access this value in model expressions.
280  *
281  * modelId - (optional string) This specifics a modelId of model to use for
282  * producing results. If not specified, the adaptor's current model will
283  * be used.
284  *
285  * context - (optional object _AdaptiveContextType_) This specifies
286  * additional context information available to model expressions.
287  *
288  * Returns:
289  *
290  * (object _AdaptiveAction_) The default action object.
291  */
292 const afw_value_t *
295 {
296  afw_xctx_t *xctx = x->xctx;
299  const afw_object_t *context;
300  const afw_value_string_t *adaptorId_value;
301  const afw_value_string_t *objectType_value;
302  const afw_value_string_t *objectId_value;
303  const afw_value_string_t *modelId_value;
304  const afw_value_object_t *context_value;
305  const afw_object_t *result;
306  const afw_model_t *model;
307  int top;
308 
309  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(adaptorId_value, 1, string);
310  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectType_value, 2, string);
311  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectId_value, 3, string);
312 
313  modelId_value = NULL;
315  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(modelId_value, 5, string);
316  }
317 
318 
319  context = NULL;
321  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(context_value, 6, object);
322  context = context_value->internal;
323  }
324 
325  /* _AdaptiveObjectType_ objects are immutable in model adaptor. */
326  if (afw_utf8_equal(&objectType_value->internal, &afw_s__AdaptiveObjectType_)) {
327  AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
328  }
329 
330  /* Save top for qualifier stack. */
332  ctx = NULL;
333 
334  AFW_TRY {
335 
336  if (context) {
337  afw_xctx_push_qualifiers_object(context, false, x->p, xctx);
338  }
339 
340  /* Get session self and model. */
341  impl_get_self_and_model(&self, &model, adaptorId_value, modelId_value, xctx);
342 
343  /* Prime context for "to adaptor". */
344  ctx = afw_model_internal_create_to_adaptor_skeleton_context(
345  self,
346  &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnDeleteObject_,
347  model,
348  NULL,
349  &objectType_value->internal,
350  &objectId_value->internal,
351  xctx);
352 
353  /* Complete ctx for default add object. */
354  afw_model_internal_complete_ctx_default_delete_object(ctx, xctx);
355  }
356 
357  /* Always restore top for qualifier stack to entry value. */
358  AFW_FINALLY{
360  }
361 
362  AFW_ENDTRY;
363 
364  result = afw_object_create(x->p, xctx);
365  afw_object_set_property(result, &afw_s_function,
366  (const afw_value_t *)&impl_value_delete_object, xctx);
367  afw_object_set_property_as_string(result, &afw_s_adaptorId,
368  self->adaptor->mapped_adaptor_id, xctx);
369  afw_object_set_property_as_string(result, &afw_s_objectType,
370  ctx->mapped_object_type_id, xctx);
371  afw_object_set_property_as_string(result, &afw_s_objectId,
372  ctx->mapped_object_id, xctx);
373 
374  return afw_value_create_object(result, x->p, xctx);
375 }
376 
377 
378 
379 /*
380  * Adaptive function: model_default_modify_object_action
381  *
382  * afw_function_execute_model_default_modify_object_action
383  *
384  * See afw_function_bindings.h for more information.
385  *
386  * This function returns a _AdaptiveAction_ object for the default action
387  * performed if a onModifyObject parameter is not specified on the associated
388  * _AdaptiveModelObjectType_. The action is not performed, but be aware that
389  * functions called while producing the _AdaptiveAction_ object may cause side
390  * effects. This function can be called as part of a onModify expression or for
391  * testing.
392  *
393  * This function is not pure, so it may return a different result
394  * given exactly the same parameters.
395  *
396  * Declaration:
397  *
398  * ```
399  * function model_default_modify_object_action(
400  * adaptorId: string,
401  * objectType: string,
402  * objectId: string,
403  * entries: list,
404  * modelId?: string,
405  * context?: (object _AdaptiveContextType_)
406  * ): (object _AdaptiveAction_);
407  * ```
408  *
409  * Parameters:
410  *
411  * adaptorId - (string) This is the adaptorId of a model adaptor. Variable
412  * custom::adaptorId can be used to access this value in model
413  * expressions.
414  *
415  * objectType - (string) This is the adaptive object type of object being
416  * modified. Variable custom::objectType can be used to access this value
417  * in model expressions.
418  *
419  * objectId - (string) This is the objectId of object to modify. Variable
420  * custom::objectId can be used to access this value in model
421  * expressions.
422  *
423  * entries - (list) This is a list of modifications. Variable custom::actions
424  * can be used to access this value in model expressions. Entries are of
425  * the form:
426  *
427  * [
428  * "add_value",
429  * "property name" or ["property name", ... ],
430  * value
431  * ]
432  *
433  * [
434  * "remove_property",
435  * "property name" or ["property name", ... ]
436  * ]
437  *
438  * [
439  * "remove_value",
440  * "property name" or ["property name", ... ],
441  * value
442  * ]
443  *
444  * [
445  * "set_property",
446  * "property name" or ["property name", ... ],
447  * value
448  * ].
449  *
450  * modelId - (optional string) This specifics a modelId of model to use for
451  * producing results. If not specified, the adaptor's current model will
452  * be used.
453  *
454  * context - (optional object _AdaptiveContextType_) This specifies
455  * additional context information available to model expressions.
456  *
457  * Returns:
458  *
459  * (object _AdaptiveAction_) The default action object.
460  */
461 const afw_value_t *
464 {
465  afw_xctx_t *xctx = x->xctx;
468  const afw_object_t *context;
469  const afw_value_string_t *adaptorId_value;
470  const afw_value_string_t *objectType_value;
471  const afw_value_string_t *objectId_value;
472  const afw_value_list_t *entries_value;
473  const afw_value_string_t *modelId_value;
474  const afw_value_object_t *context_value;
475  const afw_object_t *result;
476  const afw_model_t *model;
477  int top;
478 
479  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(adaptorId_value, 1, string);
480  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectType_value, 2, string);
481  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectId_value, 3, string);
483 
484  modelId_value = NULL;
486  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(modelId_value, 5, string);
487  }
488 
489  context = NULL;
491  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(context_value, 6, object);
492  context = context_value->internal;
493  }
494 
495  /* _AdaptiveObjectType_ objects are immutable in model adaptor. */
496  if (afw_utf8_equal(&objectType_value->internal, &afw_s__AdaptiveObjectType_)) {
497  AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
498  }
499 
500  /* Save top for qualifier stack. */
502  ctx = NULL;
503 
504  AFW_TRY {
505 
506  if (context) {
507  afw_xctx_push_qualifiers_object(context, false, x->p, xctx);
508  }
509 
510  /* Get session self and model. */
511  impl_get_self_and_model(&self, &model, adaptorId_value, modelId_value, xctx);
512 
513  /* Prime context for "to adaptor". */
514  ctx = afw_model_internal_create_to_adaptor_skeleton_context(
515  self,
516  &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnModifyObject_,
517  model,
518  NULL,
519  &objectType_value->internal,
520  &objectId_value->internal,
521  xctx);
522 
524  ctx->modify_entries_value = (const afw_value_t *)entries_value;
525 
526  /* Complete ctx for default modify object. */
528  }
529 
530  /* Always restore top for qualifier stack to entry value. */
531  AFW_FINALLY{
533  }
534 
535  AFW_ENDTRY;
536 
537  result = afw_object_create(x->p, xctx);
538  afw_object_set_property(result, &afw_s_function,
539  (const afw_value_t *)&impl_value_modify_object, xctx);
540  afw_object_set_property_as_string(result, &afw_s_adaptorId,
541  self->adaptor->mapped_adaptor_id, xctx);
542  afw_object_set_property_as_string(result, &afw_s_objectType,
543  ctx->mapped_object_type_id, xctx);
544  afw_object_set_property_as_string(result, &afw_s_objectId,
545  ctx->mapped_object_id, xctx);
546  afw_object_set_property_as_list(result, &afw_s_entries,
547  ctx->mapped_entries, xctx);
548 
549  return afw_value_create_object(result, x->p, xctx);
550 }
551 
552 
553 
554 /*
555  * Adaptive function: model_default_replace_object_action
556  *
557  * afw_function_execute_model_default_replace_object_action
558  *
559  * See afw_function_bindings.h for more information.
560  *
561  * This function returns a _AdaptiveAction_ object for the default action
562  * performed if a onReplaceObject parameter is not specified on the associated
563  * _AdaptiveModelObjectType_. The action is not performed, but be aware that
564  * functions called while producing the _AdaptiveAction_ object may cause side
565  * effects. This function can be called as part of a onReplace expression or
566  * for testing.
567  *
568  * This function is not pure, so it may return a different result
569  * given exactly the same parameters.
570  *
571  * Declaration:
572  *
573  * ```
574  * function model_default_replace_object_action(
575  * adaptorId: string,
576  * objectType: string,
577  * objectId: string,
578  * object: object,
579  * modelId?: string,
580  * context?: (object _AdaptiveContextType_)
581  * ): (object _AdaptiveAction_);
582  * ```
583  *
584  * Parameters:
585  *
586  * adaptorId - (string) This is the adaptorId of a model adaptor. Variable
587  * custom::adaptorId can be used to access this value in model
588  * expressions.
589  *
590  * objectType - (string) This is the adaptive object type of object being
591  * replaced. Variable custom::objectType can be used to access this value
592  * in model expressions.
593  *
594  * objectId - (string) The objectId of object to replace. Variable
595  * custom::objectId can be used to access this value in model
596  * expressions.
597  *
598  * object - (object) This is the object to replace. Variable custom::object
599  * can be used to access this value in model expressions.
600  *
601  * modelId - (optional string) This specifics a modelId of model to use for
602  * producing results. If not specified, the adaptor's current model will
603  * be used.
604  *
605  * context - (optional object _AdaptiveContextType_) This specifies
606  * additional context information available to model expressions.
607  *
608  * Returns:
609  *
610  * (object _AdaptiveAction_) The default action object.
611  */
612 const afw_value_t *
615 {
616  afw_xctx_t *xctx = x->xctx;
619  const afw_object_t *context;
620  const afw_value_string_t *adaptorId_value;
621  const afw_value_string_t *objectType_value;
622  const afw_value_string_t *objectId_value;
623  const afw_value_object_t *object_value;
624  const afw_value_string_t *modelId_value;
625  const afw_value_object_t *context_value;
626  const afw_object_t *result;
627  const afw_model_t *model;
628  int top;
629 
630  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(adaptorId_value, 1, string);
631  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectType_value, 2, string);
632  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(objectId_value, 3, string);
634 
635  modelId_value = NULL;
637  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(modelId_value, 5, string);
638  }
639 
640  context = NULL;
642  AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(context_value, 6, object);
643  context = context_value->internal;
644  }
645 
646  /* _AdaptiveObjectType_ objects are immutable in model adaptor. */
647  if (afw_utf8_equal(&objectType_value->internal, &afw_s__AdaptiveObjectType_)) {
648  AFW_OBJECT_ERROR_OBJECT_IMMUTABLE;
649  }
650 
651  /* Save top for qualifier stack. */
653  ctx = NULL;
654 
655  AFW_TRY {
656 
657  if (context) {
658  afw_xctx_push_qualifiers_object(context, false, x->p, xctx);
659  }
660 
661  /* Get session self and model. */
662  impl_get_self_and_model(&self, &model, adaptorId_value, modelId_value, xctx);
663 
664  /* Prime context for "to adaptor". */
665  ctx = afw_model_internal_create_to_adaptor_skeleton_context(
666  self,
667  &self->adaptor->instance_skeleton__AdaptiveModelCurrentOnReplaceObject_,
668  model,
669  NULL,
670  &objectType_value->internal,
671  &objectId_value->internal,
672  xctx);
673 
675  ctx->object_value = (const afw_value_t *)object_value;
676 
677  /* Complete ctx for default add object. */
678  afw_model_internal_complete_ctx_default_replace_object(ctx, xctx);
679  }
680 
681  /* Always restore top for qualifier stack to entry value. */
682  AFW_FINALLY{
684  }
685 
686  AFW_ENDTRY;
687 
688  result = afw_object_create(x->p, xctx);
689  afw_object_set_property(result, &afw_s_function,
690  (const afw_value_t *)&impl_value_replace_object, xctx);
691  afw_object_set_property_as_string(result, &afw_s_adaptorId,
692  self->adaptor->mapped_adaptor_id, xctx);
693  afw_object_set_property_as_string(result, &afw_s_objectType,
694  ctx->mapped_object_type_id, xctx);
695  afw_object_set_property_as_string(result, &afw_s_objectId,
696  ctx->mapped_object_id, xctx);
697  afw_object_set_property_as_list(result, &afw_s_entries,
698  ctx->mapped_entries, xctx);
699 
700  return afw_value_create_object(result, x->p, xctx);
701 }
702 
703 
704 
705 /*
706  * Adaptive function: model_mapBackObject_signature
707  *
708  * afw_function_execute_model_mapBackObject_signature
709  *
710  * See afw_function_bindings.h for more information.
711  *
712  * This is the function signature for current:mapBackObject used by
713  * onGetObjects and onRetrieveObjects. Calling this directly will throw a "Do
714  * not call directly" error.
715  *
716  * This function is not pure, so it may return a different result
717  * given exactly the same parameters.
718  *
719  * Declaration:
720  *
721  * ```
722  * function model_mapBackObject_signature(
723  * mappedObject: object
724  * ): object;
725  * ```
726  *
727  * Parameters:
728  *
729  * mappedObject - (object) This is the object to map back.
730  *
731  * Returns:
732  *
733  * (object) This is the mappedObject mapped back from mapped adaptor object.
734  */
735 const afw_value_t *
738 {
739  AFW_THROW_ERROR_Z(general, "Do not call directly", x->xctx);
740 }
741 
742 
743 
744 /*
745  * Adaptive function: model_mapObject_signature
746  *
747  * afw_function_execute_model_mapObject_signature
748  *
749  * See afw_function_bindings.h for more information.
750  *
751  * This is the function signature for current:mapObject used by onAddObject.
752  * onDeleteObject, onModifyObject, and onReplaceObject. Calling this directly
753  * will throw a "Do not call directly" error.
754  *
755  * This function is not pure, so it may return a different result
756  * given exactly the same parameters.
757  *
758  * Declaration:
759  *
760  * ```
761  * function model_mapObject_signature(
762  * object: object
763  * ): object;
764  * ```
765  *
766  * Parameters:
767  *
768  * object - (object) This is the object to map.
769  *
770  * Returns:
771  *
772  * (object) This is the object mapped to mappedAdaptor object.
773  */
774 const afw_value_t *
777 {
778  AFW_THROW_ERROR_Z(general, "Do not call directly", x->xctx);
779 }
780 
781 
782 
783 /*
784  * Adaptive function: model_returnObject_signature
785  *
786  * afw_function_execute_model_returnObject_signature
787  *
788  * See afw_function_bindings.h for more information.
789  *
790  * This is the function signature for current:returnObject used by onGetObjects
791  * and onRetrieveObjects. Calling this directly will throw a "Do not call
792  * directly" error.
793  *
794  * This function is not pure, so it may return a different result
795  * given exactly the same parameters.
796  *
797  * Declaration:
798  *
799  * ```
800  * function model_returnObject_signature(
801  * object: object,
802  * userData?: boolean
803  * ): boolean;
804  * ```
805  *
806  * Parameters:
807  *
808  * object - (object) This is the object to return.
809  *
810  * userData - (optional boolean) If this is present and true, the object will
811  * be mapped its mapped adaptor's object type to the model adaptor's
812  * object type.
813  *
814  * Returns:
815  *
816  * (boolean) This will return true if no more objects can be returned for any
817  * reason including a limit exceeded, connection closed, or server
818  * stopping.
819  */
820 const afw_value_t *
823 {
824  AFW_THROW_ERROR_Z(general, "Do not call directly", x->xctx);
825 }
Adaptive Framework Core Internal.
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.
Definition: afw_adaptor.c:375
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.
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.
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.
afw_value_evaluated_string_inf
Unmanaged evaluated value inf for data type string.
afw_object_set_property_as_string(const afw_object_t *object, const afw_utf8_t *property_name, const afw_utf8_t *internal, afw_xctx_t *xctx)
Set property function for data type string values.
#define AFW_UTF8_FMT_ARG(A_STRING)
Convenience Macro for use with AFW_UTF8_FMT to specify arg.
Definition: afw_common.h:605
#define AFW_UTF8_LITERAL(A_STRING)
String literal initializer.
Definition: afw_common.h:582
struct afw_model_internal_s afw_model_t
#define AFW_UTF8_FMT
Format string specifier used for afw_utf8_t.
Definition: afw_common.h:588
#define AFW_FINALLY
Always executed regardless of error.
Definition: afw_error.h:702
#define AFW_ENDTRY
Ends an AFW try block.
Definition: afw_error.h:727
#define AFW_TRY
Begin an AFW TRY block.
Definition: afw_error.h:634
#define AFW_THROW_ERROR_FZ(code, xctx, format_z,...)
Macro used to set error and 0 rv in xctx and throw it.
Definition: afw_error.h:319
#define AFW_THROW_ERROR_Z(code, message_z, xctx)
Macro used to set error and 0 rv in xctx and throw it.
Definition: afw_error.h:283
#define AFW_FUNCTION_EVALUATE_REQUIRED_DATA_TYPE_PARAMETER(A_RESULT, A_N, A_TYPE)
Evaluate an arg for a particular data type.
Definition: afw_function.h:328
#define AFW_FUNCTION_PARAMETER_IS_PRESENT(A_N)
Determine if a specific parameter value is present.
Definition: afw_function.h:242
const afw_value_t * afw_function_execute_model_default_delete_object_action(afw_function_execute_t *x)
Adaptive Function model_default_delete_object_action
const afw_value_t * afw_function_execute_model_default_modify_object_action(afw_function_execute_t *x)
Adaptive Function model_default_modify_object_action
const afw_value_t * afw_function_execute_model_default_add_object_action(afw_function_execute_t *x)
Adaptive Function model_default_add_object_action
const afw_value_t * afw_function_execute_model_returnObject_signature(afw_function_execute_t *x)
Adaptive Function model_returnObject_signature
const afw_value_t * afw_function_execute_model_mapBackObject_signature(afw_function_execute_t *x)
Adaptive Function model_mapBackObject_signature
const afw_value_t * afw_function_execute_model_default_replace_object_action(afw_function_execute_t *x)
Adaptive Function model_default_replace_object_action
const afw_value_t * afw_function_execute_model_mapObject_signature(afw_function_execute_t *x)
Adaptive Function model_mapObject_signature
afw_model_internal_complete_ctx_default_modify_object(afw_model_internal_context_t *ctx, afw_xctx_t *xctx)
#define afw_object_create(p, xctx)
Create an empty unmanaged object in memory.
Definition: afw_object.h:948
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.
Definition: afw_object.c:46
afw_boolean_t afw_utf8_equal_utf8_z(const afw_utf8_t *s1, const afw_utf8_z_t *s2_z)
Check to see if a string equals a utf8_z string.
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_xctx_get_qualifier_stack_top(afw_xctx_t *xctx)
Get qualifier stack top.
Definition: afw_xctx.c:316
afw_xctx_push_qualifiers_object(const afw_object_t *context_object, afw_boolean_t secure, const afw_pool_t *p, afw_xctx_t *xctx)
Push qualifiers object on to stack.
Definition: afw_xctx.c:336
afw_xctx_set_qualifier_stack_top(int top, afw_xctx_t *xctx)
Set stack top index.
Definition: afw_xctx.c:325
Internal session info used by afw_adaptor_impl*() functions.
Interface afw_adaptor_session public struct.
Function execute parameter.
Definition: afw_function.h:53
afw_xctx_t * xctx
The execution context (xctx) of caller.
Definition: afw_function.h:62
const afw_pool_t * p
Pool for result.
Definition: afw_function.h:59
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.
Interface afw_object public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
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.