Adaptive Framework
0.9.0
|
Files | |
file | afw_context.h |
Adaptive Framework Context. | |
Data Structures | |
struct | afw_context_cb_variable_meta_s |
Struct used in afw_context_cb_variable_s. More... | |
struct | afw_context_cb_variable_s |
Struct passed to afw_context_type_register_cb_variables() More... | |
Functions | |
void | afw_context_push_cb_variables (const afw_utf8_t *qualifier_id, const afw_context_cb_variable_t *const *variables, void *data, const afw_pool_t *p, afw_xctx_t *xctx) |
Push NULL terminated list of variable callback structs. More... | |
const afw_object_t * | afw_context_type_create (const afw_utf8_t *context_type_id, const afw_pool_t *p, afw_xctx_t *xctx) |
Create a context type object. More... | |
const afw_object_t * | afw_context_type_insure_qualifier_definitions_object_exists (const afw_object_t *context_type_object, afw_xctx_t *xctx) |
Insure qualifier definitions object exists. More... | |
const afw_object_t * | afw_context_type_insure_variable_definitions_object_exists (const afw_object_t *context_type_object, const afw_utf8_t *qualifier_id, afw_xctx_t *xctx) |
Insure variable definitions object exists for qualifier id. More... | |
void | afw_context_qualifier_definitions_merge (const afw_object_t *qualifier_definitions, const afw_object_t *definitions_to_add, afw_boolean_t replace_duplicates, afw_xctx_t *xctx) |
Merge qualifier definitions. More... | |
void | afw_context_type_register_cb_variables (const afw_utf8_t *context_type_id, const afw_utf8_t *qualifier_id, const afw_utf8_octet_t *description_z, const afw_context_cb_variable_t *const *variables, int include_mask, afw_xctx_t *xctx) |
Register context type id for array of current variable callbacks. More... | |
void | afw_context_variable_definition_add_z (const afw_object_t *variable_definitions, const afw_utf8_t *variable_name, const afw_utf8_t *source, const afw_value_inf_t *value_inf, const afw_utf8_z_t *label_z, const afw_utf8_z_t *description_z, const afw_utf8_z_t *data_type_parameter_z, const afw_utf8_z_t *data_type_parameter_formatted_z, afw_xctx_t *xctx) |
Add variable definition using 0 terminated label and description. More... | |
void | afw_context_variable_definitions_add (const afw_object_t *variable_definitions, const afw_object_t *definitions_to_add, afw_boolean_t replace_duplicates, afw_xctx_t *xctx) |
Add variable definitions. More... | |
void | afw_context_variable_definitions_add_based_on_object (const afw_object_t *variable_definitions, const afw_object_t *object, afw_xctx_t *xctx) |
Add variable definitions based on object. More... | |
void | afw_context_variable_definitions_add_based_on_object_type_id (const afw_object_t *variable_definitions, const afw_utf8_t *object_type_id, afw_boolean_t include_evaluated, afw_xctx_t *xctx) |
Add variable definitions based on object type id. More... | |
void | afw_context_variable_definitions_compile_and_add_based_on_object (const afw_object_t *context_type_object, const afw_object_t *object, const afw_utf8_t *qualifier_id, const afw_utf8_t *source_location, afw_xctx_t *xctx) |
Compile and add variable definitions based on AdaptiveHybridProperties object. More... | |
void | afw_context_variable_definitions_compile_and_add_based_on_qualifiers_object (const afw_object_t *context_type_object, const afw_object_t *objects, const afw_utf8_t *source_location, afw_xctx_t *xctx) |
Compile and add variable definitions based on AdaptiveHybridProperties object. More... | |
Adaptive Framework Context.
void afw_context_push_cb_variables | ( | const afw_utf8_t * | qualifier_id, |
const afw_context_cb_variable_t *const * | variables, | ||
void * | data, | ||
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Push NULL terminated list of variable callback structs.
qualifier_id | for variables. |
variables | NULL terminated list. |
data | to pass to callbacks. Usually ctx. |
p | to use. |
xctx | of caller. |
Definition at line 47 of file afw_context.c.
void afw_context_qualifier_definitions_merge | ( | const afw_object_t * | qualifier_definitions, |
const afw_object_t * | definitions_to_add, | ||
afw_boolean_t | replace_duplicates, | ||
afw_xctx_t * | xctx | ||
) |
Merge qualifier definitions.
qualifier_definitions | preallocated object. |
definitions_to_add. | |
replace_duplicates | true will replace variables with same name. |
xctx | of caller. |
Definition at line 277 of file afw_context.c.
const afw_object_t* afw_context_type_create | ( | const afw_utf8_t * | context_type_id, |
const afw_pool_t * | p, | ||
afw_xctx_t * | xctx | ||
) |
Create a context type object.
context_type_id. | |
p | to use for context. |
xctx | of caller. |
The returned object is unmanaged and will last for the life of the pool.
Definition at line 64 of file afw_context.c.
const afw_object_t* afw_context_type_insure_qualifier_definitions_object_exists | ( | const afw_object_t * | context_type_object, |
afw_xctx_t * | xctx | ||
) |
Insure qualifier definitions object exists.
context_type_object. | |
xctx | of caller. |
If there is already an object associated with the qualifier, it is returned; otherwise, a new empty one is created and added to qualifierDefinitions object.
Definition at line 85 of file afw_context.c.
const afw_object_t* afw_context_type_insure_variable_definitions_object_exists | ( | const afw_object_t * | context_type_object, |
const afw_utf8_t * | qualifier_id, | ||
afw_xctx_t * | xctx | ||
) |
Insure variable definitions object exists for qualifier id.
context_type_object. | |
qualifier_id. | |
xctx | of caller. |
If there is already an object associated with the qualifier, it is returned; otherwise, a new empty one is created and added to qualifierDefinitions object.
Definition at line 109 of file afw_context.c.
void afw_context_type_register_cb_variables | ( | const afw_utf8_t * | context_type_id, |
const afw_utf8_t * | qualifier_id, | ||
const afw_utf8_octet_t * | description_z, | ||
const afw_context_cb_variable_t *const * | variables, | ||
int | include_mask, | ||
afw_xctx_t * | xctx | ||
) |
Register context type id for array of current variable callbacks.
context_type_id | to register. |
qualifier_id | of variables. |
description_z | of context. |
variables | is a NULL terminated array of afw_context_cb_variable_t *. |
include_mask | logical anded with entry's include_mask determines if entry should be included. |
xctx | of caller. |
The returned object is unmanaged and will last for the life of the pool.
Definition at line 135 of file afw_context.c.
void afw_context_variable_definition_add_z | ( | const afw_object_t * | variable_definitions, |
const afw_utf8_t * | variable_name, | ||
const afw_utf8_t * | source, | ||
const afw_value_inf_t * | value_inf, | ||
const afw_utf8_z_t * | label_z, | ||
const afw_utf8_z_t * | description_z, | ||
const afw_utf8_z_t * | data_type_parameter_z, | ||
const afw_utf8_z_t * | data_type_parameter_formatted_z, | ||
afw_xctx_t * | xctx | ||
) |
Add variable definition using 0 terminated label and description.
variable_definitions | object. |
variable_name | |
source | to include in definition. Will be "internal" if NULL. |
value_inf | |
label_z | |
description_z | |
data_type_parameter_z | or NULL |
data_type_parameter_formatted_z | or NULL |
xctx | of caller. |
Definition at line 190 of file afw_context.c.
void afw_context_variable_definitions_add | ( | const afw_object_t * | variable_definitions, |
const afw_object_t * | definitions_to_add, | ||
afw_boolean_t | replace_duplicates, | ||
afw_xctx_t * | xctx | ||
) |
Add variable definitions.
variable_definitions | object. |
definitions_to_add. | |
replace_duplicates | true will replace variables with same name. |
xctx | of caller. |
Definition at line 251 of file afw_context.c.
void afw_context_variable_definitions_add_based_on_object | ( | const afw_object_t * | variable_definitions, |
const afw_object_t * | object, | ||
afw_xctx_t * | xctx | ||
) |
Add variable definitions based on object.
variable_definitions | preallocated object. |
object | used as basis for new definitions. |
xctx | of caller. |
See afw_xctx_push_qualifier() for use pattern.
Any object properties that have a data type whose value must be compiled will be ignored, so compile the property that should be included before this call. These compiled values will use annotation (if present) and then the property type associatedPropertyType to produce the variable definition.
Definition at line 315 of file afw_context.c.
void afw_context_variable_definitions_add_based_on_object_type_id | ( | const afw_object_t * | variable_definitions, |
const afw_utf8_t * | object_type_id, | ||
afw_boolean_t | include_evaluated, | ||
afw_xctx_t * | xctx | ||
) |
Add variable definitions based on object type id.
variable_definitions | preallocated object. |
object_type_id. | |
include_evaluated | determines if variables with an evaluated data type should be included. |
xctx | of caller. |
See afw_xctx_push_qualifier() for use pattern.
Definition at line 433 of file afw_context.c.
void afw_context_variable_definitions_compile_and_add_based_on_object | ( | const afw_object_t * | context_type_object, |
const afw_object_t * | object, | ||
const afw_utf8_t * | qualifier_id, | ||
const afw_utf8_t * | source_location, | ||
afw_xctx_t * | xctx | ||
) |
Compile and add variable definitions based on AdaptiveHybridProperties object.
context_type_object. | |
object | used as basis for new definitions. |
qualifier_id. | |
source_location | to associate with compiled string or NULL. |
xctx | of caller. |
Definition at line 513 of file afw_context.c.
void afw_context_variable_definitions_compile_and_add_based_on_qualifiers_object | ( | const afw_object_t * | context_type_object, |
const afw_object_t * | objects, | ||
const afw_utf8_t * | source_location, | ||
afw_xctx_t * | xctx | ||
) |
Compile and add variable definitions based on AdaptiveHybridProperties object.
context_type_object. | |
objects | used as basis for new definitions. |
source_location | to associate with compiled string or NULL. |
xctx | of caller. |
Definition at line 542 of file afw_context.c.