|
DTNMA Reference Tools v2.1.0 - 13.gc5c0bac
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains definitions for AMM typing of ARI values. More...
Include dependency graph for typing.h:
This graph shows which files directly or indirectly include this file:Data Structures | |
| struct | cace_amm_type_builtin_s |
| Configuration for a built-in type. More... | |
| struct | cace_amm_type_t |
| Descriptor for each built-in (ARI type) and semantic type within the AMM. More... | |
Macros | |
| #define | CACE_AMM_ERR_CONVERT_NULLFUNC 2 |
| #define | CACE_AMM_ERR_CONVERT_BADVALUE 3 |
| #define | CACE_AMM_ERR_CONVERT_NOCHOICE 4 |
| #define | CACE_AMM_ERR_CONVERT_FAILED_CONSTRAINT 5 |
| #define | CACE_AMM_TYPE_INIT_INVALID |
| #define | M_OPL_cace_amm_type_t() |
| M*LIB OPLIST for the cace_amm_type_t. | |
Typedefs | |
| typedef void(* | cace_amm_semtype_deinit_f) (void *semtype) |
Enumerations | |
| enum | cace_amm_type_match_res_t { CACE_AMM_TYPE_MATCH_NOINFO , CACE_AMM_TYPE_MATCH_NEGATIVE , CACE_AMM_TYPE_MATCH_POSITIVE , CACE_AMM_TYPE_MATCH_UNDEFINED } |
| Result status for type matching. More... | |
| enum | cace_amm_type_class_t { CACE_AMM_TYPE_INVALID , CACE_AMM_TYPE_BUILTIN , CACE_AMM_TYPE_USE , CACE_AMM_TYPE_ULIST , CACE_AMM_TYPE_DLIST , CACE_AMM_TYPE_UMAP , CACE_AMM_TYPE_TBLT , CACE_AMM_TYPE_UNION , CACE_AMM_TYPE_SEQ } |
| Possible classes of AMM types. More... | |
Functions | |
| void | cace_amm_type_init (cace_amm_type_t *type) |
| Initialize a type object to a default, invalid state. | |
| void | cace_amm_type_deinit (cace_amm_type_t *type) |
| Free any resources associated with a semantic type. | |
| void | cace_amm_type_init_set (cace_amm_type_t *type, const cace_amm_type_t *src) |
| void | cace_amm_type_set (cace_amm_type_t *type, const cace_amm_type_t *src) |
| void | cace_amm_type_reset (cace_amm_type_t *type) |
| Reset to the default invalid state. | |
| static cace_amm_type_match_res_t | cace_amm_type_match_pos_neg (bool cond) |
| Return either a positive or negative match depending on a condition. | |
| const cace_amm_type_t * | cace_amm_type_get_builtin (cace_ari_type_t ari_type) |
| Get a built-in type object. | |
| bool | cace_amm_type_is_valid (const cace_amm_type_t *type) |
| Determine if a type object is valid. | |
| bool | cace_amm_type_get_name (const cace_amm_type_t *type, cace_ari_t *name) |
| Get an ARI name for a type object. | |
| int | cace_amm_type_set_name (cace_amm_type_t *type, const cace_ari_t *name, const struct cace_amm_obj_store_s *store) |
| Set a type object from an ARI name. | |
| cace_amm_type_match_res_t | cace_amm_type_match (const cace_amm_type_t *type, const cace_ari_t *ari) |
| Determine if a type (built-in or semantic) matches a specific value. | |
| int | cace_amm_type_convert (const cace_amm_type_t *type, cace_ari_t *out, const cace_ari_t *in) |
| Force a value to be converted to a specific type (built-in or semantic). | |
| bool | cace_amm_builtin_validate (const cace_ari_t *ari) |
| Validate that typed literals agree with their values. | |
| bool | cace_amm_ari_is_truthy (const cace_ari_t *in) |
| Determine if the given ARI object is truthy. | |
This file contains definitions for AMM typing of ARI values.
| #define CACE_AMM_ERR_CONVERT_BADVALUE 3 |
| #define CACE_AMM_ERR_CONVERT_FAILED_CONSTRAINT 5 |
| #define CACE_AMM_ERR_CONVERT_NOCHOICE 4 |
| #define CACE_AMM_ERR_CONVERT_NULLFUNC 2 |
| #define CACE_AMM_TYPE_INIT_INVALID |
| #define M_OPL_cace_amm_type_t | ( | ) |
M*LIB OPLIST for the cace_amm_type_t.
| typedef void(* cace_amm_semtype_deinit_f) (void *semtype) |
Possible classes of AMM types.
Result status for type matching.
| bool cace_amm_ari_is_truthy | ( | const cace_ari_t * | in | ) |
Determine if the given ARI object is truthy.
| in | Object to check for truthiness |
References cace_ari_lit_t::ari_type, cace_ari_prim_val_u::as_bool, cace_ari_prim_val_u::as_data, cace_ari_prim_val_u::as_float64, cace_ari_prim_val_u::as_int64, cace_ari_t::as_lit, cace_ari_prim_val_u::as_timespec, cace_ari_prim_val_u::as_uint64, CACE_ARI_PRIM_BOOL, CACE_ARI_PRIM_BSTR, CACE_ARI_PRIM_FLOAT64, CACE_ARI_PRIM_INT64, CACE_ARI_PRIM_NULL, CACE_ARI_PRIM_OTHER, CACE_ARI_PRIM_TIMESPEC, CACE_ARI_PRIM_TSTR, CACE_ARI_PRIM_UINT64, CACE_ARI_PRIM_UNDEFINED, CACE_ARI_TYPE_AC, CACE_ARI_TYPE_AM, CACE_ARI_TYPE_ARITYPE, CACE_ARI_TYPE_EXECSET, CACE_ARI_TYPE_RPTSET, CACE_ARI_TYPE_TBL, cace_ari_t::is_ref, cace_data_t::len, cace_ari_lit_t::prim_type, result, and cace_ari_lit_t::value.
Referenced by builtin_bool_convert(), refda_adm_ietf_dtnma_agent_oper_tbl_filter(), refda_alarms_compress(), refda_alarms_mgr_state(), refda_alarms_purge(), and refda_exec_run_sbr().
| bool cace_amm_builtin_validate | ( | const cace_ari_t * | ari | ) |
Validate that typed literals agree with their values.
This performs comparisons of valid cace_ari_lit_t::prim_type and valid cace_ari_lit_t::value within each ARI type.
References cace_amm_builtin_validate_visit_ari(), cace_ari_visit(), CHKFALSE, and cace_ari_visitor_t::visit_ari.
Referenced by check_decoding(), and test_cace_ari_cbor_decode_invalid().
| int cace_amm_type_convert | ( | const cace_amm_type_t * | type, |
| cace_ari_t * | out, | ||
| const cace_ari_t * | in | ||
| ) |
Force a value to be converted to a specific type (built-in or semantic).
| [in] | type | The type to convert to. |
| [out] | out | The converted value (valid if the return is zero). This struct must already be initialized. |
| [in] | in | The value to convert. This struct must be initialized. |
References CACE_AMM_ERR_CONVERT_NULLFUNC, CACE_LOG_DEBUG, CHKERR1, and CHKRET.
Referenced by ari_numeric_add(), cace_amm_actual_param_set_populate(), cace_amm_semtype_dlist_convert(), cace_amm_semtype_seq_convert_it(), cace_amm_semtype_tblt_convert(), cace_amm_semtype_ulist_convert(), cace_amm_semtype_umap_convert(), cace_amm_semtype_union_convert(), cace_amm_semtype_use_convert(), cace_ari_equal(), cace_numeric_binary_comparison_operator(), cace_numeric_binary_operator(), cace_numeric_integer_binary_operator(), check_convert(), normalize_key(), refda_adm_ietf_dtnma_agent_ctrl_wait_cond_check(), refda_eval_condition(), refda_eval_oper(), and refda_oper_eval_ctx_populate().
| void cace_amm_type_deinit | ( | cace_amm_type_t * | type | ) |
Free any resources associated with a semantic type.
| [in,out] | type | The object to de-initialize. |
References CACE_AMM_TYPE_BUILTIN, CACE_AMM_TYPE_INIT_INVALID, CACE_AMM_TYPE_INVALID, CACE_FREE, and CHKVOID.
Referenced by cace_amm_formal_param_deinit(), cace_amm_named_type_deinit(), cace_amm_semtype_seq_deinit(), cace_amm_semtype_ulist_deinit(), cace_amm_semtype_umap_deinit(), cace_amm_type_reset(), refda_amm_const_desc_deinit(), refda_amm_ctrl_desc_deinit(), refda_amm_edd_desc_deinit(), refda_amm_oper_desc_deinit(), refda_amm_typedef_desc_deinit(), refda_amm_var_desc_deinit(), test_amm_type_match_semtype_dlist_2item(), test_amm_type_match_semtype_dlist_seq_minmax(), test_amm_type_match_semtype_tblt_1(), test_amm_type_match_semtype_ulist_1(), test_amm_type_match_semtype_umap_1(), test_amm_type_match_semtype_union_1(), test_amm_type_match_semtype_use_1(), and test_amm_type_set_name_builtin().
| const cace_amm_type_t * cace_amm_type_get_builtin | ( | cace_ari_type_t | ari_type | ) |
Get a built-in type object.
| ari_type | The associated literal type to lookup. |
References cace_amm_builtin_dict, cace_amm_builtin_dict_ctrl, cace_amm_builtin_dict_init(), and CACE_LOG_WARNING.
Referenced by ari_numeric_add(), cace_amm_builtin_validate_lit(), cace_amm_type_set_name_aritype(), cace_amm_type_set_use_builtin(), cace_ari_equal(), cace_numeric_binary_comparison_operator(), cace_numeric_binary_operator(), cace_numeric_integer_binary_operator(), normalize_key(), refda_adm_ietf_dtnma_agent_ctrl_wait_cond_check(), refda_binding_semtype_use(), refda_eval_condition(), test_amm_type_convert_bool(), test_amm_type_convert_byte(), test_amm_type_convert_ident(), test_amm_type_convert_int(), test_amm_type_convert_namespace(), test_amm_type_convert_null(), test_amm_type_convert_object(), test_amm_type_convert_real64(), test_amm_type_convert_td(), test_amm_type_convert_tp(), test_amm_type_get_name_builtin(), test_amm_type_match_ident(), test_amm_type_match_int(), test_amm_type_match_namespace(), test_amm_type_match_null(), test_amm_type_match_object(), and test_refda_exec_target().
| bool cace_amm_type_get_name | ( | const cace_amm_type_t * | type, |
| cace_ari_t * | name | ||
| ) |
Get an ARI name for a type object.
This is the inverse of cace_amm_type_set_name().
| [in] | type | The type to name. |
| [out] | name | The generated name. |
References cace_ari_set_undefined(), and CHKFALSE.
Referenced by cace_amm_actual_param_set_populate(), cace_amm_semtype_dlist_name(), cace_amm_semtype_seq_name(), cace_amm_semtype_tblt_match(), cace_amm_semtype_tblt_name(), cace_amm_semtype_ulist_name(), cace_amm_semtype_umap_name(), cace_amm_semtype_union_convert(), cace_amm_semtype_union_name(), cace_amm_semtype_use_name(), refda_adm_ietf_dtnma_agent_edd_const_list(), refda_adm_ietf_dtnma_agent_edd_var_list(), refda_edd_prod_check_result(), and test_amm_type_get_name_builtin().
| void cace_amm_type_init | ( | cace_amm_type_t * | type | ) |
Initialize a type object to a default, invalid state.
| [out] | type | The type to initialize. |
References CACE_AMM_TYPE_INIT_INVALID, and CHKVOID.
Referenced by cace_amm_formal_param_init(), cace_amm_named_type_init(), cace_amm_semtype_seq_init(), cace_amm_semtype_ulist_init(), cace_amm_semtype_umap_init(), refda_amm_ctrl_desc_init(), refda_amm_edd_desc_init(), refda_amm_oper_desc_init(), refda_amm_typedef_desc_init(), refda_amm_var_desc_init(), test_amm_type_match_semtype_dlist_2item(), test_amm_type_match_semtype_dlist_seq_minmax(), test_amm_type_match_semtype_tblt_1(), test_amm_type_match_semtype_ulist_1(), test_amm_type_match_semtype_umap_1(), test_amm_type_match_semtype_union_1(), and test_amm_type_match_semtype_use_1().
| void cace_amm_type_init_set | ( | cace_amm_type_t * | type, |
| const cace_amm_type_t * | src | ||
| ) |
| bool cace_amm_type_is_valid | ( | const cace_amm_type_t * | type | ) |
Determine if a type object is valid.
References CACE_AMM_TYPE_INVALID, and CHKFALSE.
Referenced by refda_binding_ctrl(), refda_ctrl_exec_ctx_check_result(), refda_eval_oper(), and refda_valprod_edd_run().
| cace_amm_type_match_res_t cace_amm_type_match | ( | const cace_amm_type_t * | type, |
| const cace_ari_t * | ari | ||
| ) |
Determine if a type (built-in or semantic) matches a specific value.
| [in] | type | The type to check against. |
| [in] | ari | The value to check. This struct must be initialized. |
References CACE_AMM_TYPE_MATCH_NEGATIVE, CACE_LOG_DEBUG, and CHKRET.
Referenced by cace_amm_builtin_validate_lit(), cace_amm_semtype_dlist_match(), cace_amm_semtype_seq_match_it(), cace_amm_semtype_tblt_match(), cace_amm_semtype_ulist_match(), cace_amm_semtype_umap_match(), cace_amm_semtype_union_convert(), cace_amm_semtype_union_match(), cace_amm_semtype_use_match(), check_match(), refda_adm_ietf_dtnma_agent_ctrl_ensure_const(), refda_adm_ietf_dtnma_agent_ctrl_ensure_var(), refda_ctrl_exec_ctx_check_result(), refda_edd_prod_check_result(), refda_exec_proc_exp_item(), refda_reporting_rptt_lit(), refda_reporting_rptt_val(), and test_refda_exec_target().
|
inlinestatic |
Return either a positive or negative match depending on a condition.
References CACE_AMM_TYPE_MATCH_NEGATIVE, and CACE_AMM_TYPE_MATCH_POSITIVE.
Referenced by builtin_bool_match(), builtin_byte_match(), builtin_bytestr_match(), builtin_common_objref_match(), builtin_idseg_match(), builtin_int_match(), builtin_literal_match(), builtin_null_match(), builtin_real32_match(), builtin_real64_match(), builtin_textstr_match(), builtin_uint_match(), builtin_uvast_match(), builtin_vast_match(), and cace_amm_semtype_use_match().
| void cace_amm_type_reset | ( | cace_amm_type_t * | type | ) |
Reset to the default invalid state.
| [in,out] | type | The object to reset. |
References cace_amm_type_deinit().
Referenced by cace_amm_type_set_dlist(), cace_amm_type_set_name(), cace_amm_type_set_seq(), cace_amm_type_set_tblt_size(), cace_amm_type_set_ulist(), cace_amm_type_set_umap(), cace_amm_type_set_union_size(), and cace_amm_type_set_use().
| void cace_amm_type_set | ( | cace_amm_type_t * | type, |
| const cace_amm_type_t * | src | ||
| ) |
| int cace_amm_type_set_name | ( | cace_amm_type_t * | type, |
| const cace_ari_t * | name, | ||
| const struct cace_amm_obj_store_s * | store | ||
| ) |
Set a type object from an ARI name.
This is the inverse of cace_amm_type_get_name().
| [in,out] | type | The type to replace based on the name. |
| [in] | name | The input type name. |
| [in] | store | Object store for reference lookup. |