Adaptive Framework  0.9.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
afw_object_type.h
Go to the documentation of this file.
1 // See the 'COPYING' file in the project root for licensing information.
2 /*
3  * Adaptive Framework Object Type
4  *
5  * Copyright (c) 2010-2023 Clemson University
6  *
7  */
8 
9 #ifndef __AFW_OBJECT_TYPE_H
10 #define __AFW_OBJECT_TYPE_H
11 
12 #include "afw_interface.h"
13 
28 
31  const afw_object_type_t *next;
32  const afw_utf8_t *adaptor_id;
33  const afw_utf8_t *object_type_id;
34  const afw_object_t *object_type_object;
35  const afw_object_t *property_types_object;
36  const afw_object_t *other_properties_object;
37  const afw_object_type_property_type_t *first_property_type;
38  const afw_object_type_property_type_t *other_properties;
39 };
40 
43 
44 
46  /* "dataType" or "objectType". */
47  const afw_utf8_t *data_type_parameter_type;
48  union {
49  const afw_object_type_t *object_type;
50  const afw_data_type_t *data_type;
51  };
52 };
53 
57  const afw_object_t *property_type_object;
58  const afw_utf8_t *property_name;
59 
63  const afw_data_type_t *data_type;
64  const afw_utf8_t *data_type_parameter;
65 
66  const afw_value_t *default_value;
67 
68  afw_boolean_t allow_write;
69  afw_boolean_t allow_query;
70  afw_boolean_t required;
71 };
72 
73 
82 const afw_object_type_t *
84  const afw_adaptor_t *adaptor,
85  const afw_object_t *object_type_object,
86  const afw_pool_t *p,
87  afw_xctx_t *xctx);
88 
89 
97 #define afw_object_type_get_property(object_type, property_name, xctx) \
98  afw_object_get_property((object_type)->object_type_object, \
99  property_name, xctx)
100 
101 
102 
110 #define afw_object_type_get_property_as_utf8(object_type_object, \
111  property_name, xctx) \
112  afw_object_old_get_property_as_utf8((object_type)->object_type_object, \
113  property_name, xctx)
114 
115 
129  const afw_object_type_t *object_type,
130  const afw_utf8_t *property_name,
131  afw_xctx_t *xctx);
132 
133 
144  const afw_object_type_t *object_type,
145  const afw_iterator_t * *iterator,
146  const afw_utf8_t * *property_name,
147  afw_xctx_t *xctx);
148 
149 
158 AFW_DECLARE(const afw_value_t *)
161  const afw_value_t *value,
162  const afw_pool_t *p,
163  afw_xctx_t *xctx);
164 
165 
175 AFW_DECLARE(const afw_value_t *)
177  const afw_object_type_t *object_type,
178  const afw_utf8_t *property_name,
179  const afw_value_t *value,
180  const afw_pool_t *p,
181  afw_xctx_t *xctx);
182 
183 
184 AFW_END_DECLARES
185 
188 #endif /* __AFW_OBJECT_TYPE_H */
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
struct afw_iterator_s afw_iterator_t
_Bool afw_boolean_t
Definition: afw_common.h:373
const afw_object_type_property_type_t * afw_object_type_property_type_get(const afw_object_type_t *object_type, const afw_utf8_t *property_name, afw_xctx_t *xctx)
Get property type object for property.
const afw_object_type_property_type_t * afw_object_type_property_type_get_next(const afw_object_type_t *object_type, const afw_iterator_t **iterator, const afw_utf8_t **property_name, afw_xctx_t *xctx)
Get next property type for object type.
const afw_value_t * afw_object_type_property_type_normalize(const afw_object_type_property_type_t *pt, const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Normalize a value based on property type.
const afw_object_type_t * afw_object_type_internal_create(const afw_adaptor_t *adaptor, const afw_object_t *object_type_object, const afw_pool_t *p, afw_xctx_t *xctx)
Create an object type.
const afw_value_t * afw_object_type_property_normalize(const afw_object_type_t *object_type, const afw_utf8_t *property_name, const afw_value_t *value, const afw_pool_t *p, afw_xctx_t *xctx)
Normalize a value based an object type and property name.
Interface afw_adaptor public struct.
Interface afw_data_type public struct.
Interface afw_object public struct.
Struct for afw_object_type_property_type_t.
const afw_utf8_t * context_type_id
Struct for afw_object_type_t.
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Definition: afw_common.h:545
Interface afw_value public struct.
Interface afw_xctx public struct.