DTNMA Reference Tools v2.2.0 - 5.ga116361
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
promote.h File Reference
#include "cace/ari/base.h"
+ Include dependency graph for promote.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  cace_amm_promote_state_t
 Bookkeeping for logic of type promotion. More...
 

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.
 
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.
 

Function Documentation

◆ cace_amm_promote_deinit()

void cace_amm_promote_deinit ( cace_amm_promote_state_t obj)

◆ cace_amm_promote_eqiv_lit_type()

◆ cace_amm_promote_init()

◆ cace_amm_promote_is_numeric()

bool cace_amm_promote_is_numeric ( cace_ari_type_t  typ)

Determine if given type is numeric.

Parameters
[in]typInput type.
Returns
true if numeric 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().

◆ cace_amm_promote_process()

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].

Parameters
[out]resultThe promotion type if the return is zero.
[in]lt_valThe left input value.
[in]rt_valThe right input value.
Returns
Zero if successful.

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().