|
DTNMA Reference Tools v2.2.0 - 5.ga116361
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
Include dependency graph for promote.c:Functions | |
| cace_ari_type_t | cace_amm_promote_eqiv_lit_type (const cace_ari_lit_t *lit) |
| Determine the equivalent built-in type of the provided literal-value. | |
| bool | cace_amm_promote_is_numeric (cace_ari_type_t typ) |
| Determine if given type is numeric. | |
| void | cace_amm_promote_init (cace_amm_promote_state_t *obj) |
| Initialize the struct. | |
| void | cace_amm_promote_deinit (cace_amm_promote_state_t *obj) |
| De-initialize the struct. | |
| static int | cace_amm_promote_valtype (cace_ari_type_t *result, const cace_ari_t *val) |
| static int | cace_amm_promote_numeric_rank (cace_ari_type_t typ) |
| For the numeric types, provide a rank ordering. | |
| static int | cace_amm_promote_type (cace_ari_type_t *result, const cace_ari_t *lt_val, const cace_ari_t *rt_val) |
| Implement the numeric type promotion procedure from Section 6.11.2.1 of the AMM [draft-ietf-dtn-amm] by choosing the least compatible type between two values. | |
| int | cace_amm_promote_process (cace_amm_promote_state_t *obj, const cace_ari_t *lt_val, const cace_ari_t *rt_val) |
| Determine the numeric type which is the least common promotion type. | |
| void cace_amm_promote_deinit | ( | cace_amm_promote_state_t * | obj | ) |
De-initialize the struct.
Only the optional storage is touched.
References cace_ari_deinit(), CHKVOID, cace_amm_promote_state_t::lt_prom, and cace_amm_promote_state_t::rt_prom.
Referenced by ari_numeric_add(), cace_numeric_binary_operator(), cace_numeric_compare_operator(), and cace_numeric_integer_binary_operator().
| cace_ari_type_t cace_amm_promote_eqiv_lit_type | ( | const cace_ari_lit_t * | lit | ) |
Determine the equivalent built-in type of the provided literal-value.
| [in] | lit | The input value. |
References cace_ari_lit_t::ari_type, cace_ari_prim_val_u::as_int64, 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_TSTR, CACE_ARI_PRIM_UINT64, CACE_ARI_TYPE_BOOL, CACE_ARI_TYPE_BYTE, CACE_ARI_TYPE_BYTESTR, CACE_ARI_TYPE_INT, CACE_ARI_TYPE_NULL, CACE_ARI_TYPE_REAL64, CACE_ARI_TYPE_TEXTSTR, CACE_ARI_TYPE_UINT, CACE_ARI_TYPE_UVAST, CACE_ARI_TYPE_VAST, cace_ari_lit_t::has_ari_type, cace_ari_lit_t::prim_type, and cace_ari_lit_t::value.
Referenced by cace_amm_promote_type(), cace_numeric_binary_operator(), numeric_add_timespec(), numeric_div_timespec(), numeric_mul_timespec(), and numeric_sub_timespec().
| void cace_amm_promote_init | ( | cace_amm_promote_state_t * | obj | ) |
Initialize the struct.
References cace_ari_init(), CHKVOID, cace_amm_promote_state_t::lt_prom, and cace_amm_promote_state_t::rt_prom.
Referenced by ari_numeric_add(), cace_numeric_binary_operator(), cace_numeric_compare_operator(), and cace_numeric_integer_binary_operator().
| bool cace_amm_promote_is_numeric | ( | cace_ari_type_t | typ | ) |
Determine if given type is numeric.
| [in] | typ | Input type. |
References CACE_ARI_TYPE_BYTE, CACE_ARI_TYPE_INT, CACE_ARI_TYPE_REAL32, CACE_ARI_TYPE_REAL64, CACE_ARI_TYPE_UINT, CACE_ARI_TYPE_UVAST, and CACE_ARI_TYPE_VAST.
Referenced by cace_amm_promote_type().
|
static |
For the numeric types, provide a rank ordering.
References CACE_ARI_TYPE_BYTE, CACE_ARI_TYPE_INT, CACE_ARI_TYPE_REAL32, CACE_ARI_TYPE_REAL64, CACE_ARI_TYPE_UINT, CACE_ARI_TYPE_UVAST, and CACE_ARI_TYPE_VAST.
Referenced by cace_amm_promote_type().
| int cace_amm_promote_process | ( | cace_amm_promote_state_t * | obj, |
| const cace_ari_t * | lt_val, | ||
| const cace_ari_t * | rt_val | ||
| ) |
Determine the numeric type which is the least common promotion type.
This is done in accordance with Section 6.11.2.1 of [amm].
| [out] | result | The promotion type if the return is zero. |
| [in] | lt_val | The left input value. |
| [in] | rt_val | The right input value. |
References cace_amm_promote_type(), cace_amm_promote_valtype(), cace_amm_type_convert(), cace_amm_type_get_builtin(), cace_ari_type_to_name(), CACE_LOG_DEBUG, cace_log_is_enabled_for(), cace_amm_promote_state_t::common, cace_amm_promote_state_t::lt_prom, cace_amm_promote_state_t::lt_use, cace_amm_promote_state_t::lt_val, cace_amm_promote_state_t::rt_prom, cace_amm_promote_state_t::rt_use, and cace_amm_promote_state_t::rt_val.
Referenced by ari_numeric_add(), cace_numeric_binary_operator(), cace_numeric_compare_operator(), and cace_numeric_integer_binary_operator().
|
static |
Implement the numeric type promotion procedure from Section 6.11.2.1 of the AMM [draft-ietf-dtn-amm] by choosing the least compatible type between two values.
References cace_ari_lit_t::ari_type, cace_ari_t::as_lit, cace_amm_promote_eqiv_lit_type(), cace_amm_promote_is_numeric(), cace_amm_promote_numeric_rank(), cace_amm_promote_valtype(), CACE_ARI_TYPE_INT, CACE_ARI_TYPE_UVAST, CACE_ARI_TYPE_VAST, CACE_LOG_DEBUG, CHKERR1, cace_ari_lit_t::has_ari_type, and cace_ari_t::is_ref.
Referenced by cace_amm_promote_process().
|
static |
References cace_ari_lit_t::ari_type, cace_ari_objpath_t::ari_type, cace_ari_t::as_lit, cace_ari_t::as_ref, CACE_LOG_WARNING, cace_ari_lit_t::has_ari_type, cace_ari_objpath_t::has_ari_type, cace_ari_t::is_ref, and cace_ari_ref_t::objpath.
Referenced by cace_amm_promote_process(), and cace_amm_promote_type().