Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_function_value.c
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework Adaptive Functions for category Value
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
14 #include "afw_internal.h"
15 
16 
17 
18 /*
19  * Adaptive function: meta
20  *
21  * afw_function_execute_meta
22  *
23  * See afw_function_bindings.h for more information.
24  *
25  * This function returns an object containing meta information for an adaptive
26  * value.
27  *
28  * This function is pure, so it will always return the same result
29  * given exactly the same parameters and has no side effects.
30  *
31  * Declaration:
32  *
33  * ```
34  * function meta(
35  * value: any
36  * ): object;
37  * ```
38  *
39  * Parameters:
40  *
41  * value - (any dataType) This is the adaptive value whose meta object is to
42  * be returned.
43  *
44  * Returns:
45  *
46  * (object) An object containing the meta information for the adaptive value.
47  * The objectType of this object is normally _AdaptiveValueMeta_ or one
48  * of its descendants.
49  */
50 const afw_value_t *
53 {
54  const afw_value_t *result;
55 
56  result = afw_value_get_evaluated_meta(x->argv[1], x->p, x->xctx);
57 
58  return result;
59 }
60 
61 
62 
63 /*
64  * Adaptive function: metas
65  *
66  * afw_function_execute_metas
67  *
68  * See afw_function_bindings.h for more information.
69  *
70  * This function returns a list of the result of calling meta() for each value
71  * in a list or object adaptive value.
72  *
73  * This function is pure, so it will always return the same result
74  * given exactly the same parameters and has no side effects.
75  *
76  * Declaration:
77  *
78  * ```
79  * function metas(
80  * value: any
81  * ): object;
82  * ```
83  *
84  * Parameters:
85  *
86  * value - (any dataType) This is an adaptive list or object.
87  *
88  * Returns:
89  *
90  * (object) An list containing the result of calling meta() of each value in
91  * list or object adaptive value.
92  */
93 const afw_value_t *
96 {
97  const afw_value_t *result;
98  const afw_value_t *value;
99 
101 
102  result = afw_value_get_evaluated_metas(value, x->p, x->xctx);
103 
104  return result;
105 }
Adaptive Framework Core Internal.
#define AFW_FUNCTION_EVALUATE_REQUIRED_PARAMETER(A_RESULT, A_N)
Evaluate an required parameter.
Definition: afw_function.h:295
const afw_value_t * afw_function_execute_metas(afw_function_execute_t *x)
Adaptive Function metas
const afw_value_t * afw_function_execute_meta(afw_function_execute_t *x)
Adaptive Function meta
#define afw_value_get_evaluated_meta(instance, p, xctx)
Call method get_evaluated_meta of interface afw_value.
#define afw_value_get_evaluated_metas(instance, p, xctx)
Call method get_evaluated_metas of interface afw_value.
Function execute parameter.
Definition: afw_function.h:53
const afw_value_t *const * argv
This is the function parameters.
Definition: afw_function.h:86
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
Interface afw_value public struct.