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

Data Structures

struct  refda_oper_eval_ctx_t
 Context for OPER evaluation activities. More...
 

Functions

void refda_oper_eval_ctx_init (refda_oper_eval_ctx_t *obj)
 
void refda_oper_eval_ctx_deinit (refda_oper_eval_ctx_t *obj)
 
int refda_oper_eval_ctx_populate (refda_oper_eval_ctx_t *obj, const cace_amm_lookup_t *deref, const refda_amm_oper_desc_t *oper, refda_eval_ctx_t *eval)
 Populate a context based on an object reference ARI and a target object's formal parameters.
 
bool refda_oper_eval_ctx_has_aparam_undefined (const refda_oper_eval_ctx_t *ctx)
 Determine if any actual parameter is undefined.
 
const cace_ari_trefda_oper_eval_ctx_get_aparam_index (const refda_oper_eval_ctx_t *ctx, size_t index)
 Access an actual parameter by index.
 
const cace_ari_trefda_oper_eval_ctx_get_aparam_name (const refda_oper_eval_ctx_t *ctx, const char *name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Access an actual parameter by name.
 
bool refda_oper_eval_ctx_has_operand_undefined (const refda_oper_eval_ctx_t *ctx)
 Determine if any operand value is undefined.
 
const cace_ari_trefda_oper_eval_ctx_get_operand_index (const refda_oper_eval_ctx_t *ctx, size_t index)
 Access an operand by index.
 
const cace_ari_trefda_oper_eval_ctx_get_operand_name (const refda_oper_eval_ctx_t *ctx, const char *name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Access an operand by name.
 
void refda_oper_eval_ctx_set_result_copy (refda_oper_eval_ctx_t *ctx, const cace_ari_t *value)
 Set the result for an operator evaluation, which marks it as finished.
 
void refda_oper_eval_ctx_set_result_move (refda_oper_eval_ctx_t *ctx, cace_ari_t *value)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Set the result with move semantics.
 

Function Documentation

◆ refda_oper_eval_ctx_deinit()

◆ refda_oper_eval_ctx_get_aparam_index()

◆ refda_oper_eval_ctx_get_aparam_name()

const cace_ari_t * refda_oper_eval_ctx_get_aparam_name ( const refda_oper_eval_ctx_t ctx,
const char *  name 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Access an actual parameter by name.

References cace_amm_lookup_t::aparams, CHKNULL, refda_oper_eval_ctx_t::deref, and cace_ari_itemized_t::named.

◆ refda_oper_eval_ctx_get_operand_index()

const cace_ari_t * refda_oper_eval_ctx_get_operand_index ( const refda_oper_eval_ctx_t ctx,
size_t  index 
)

Access an operand by index.

Parameters
[in]ctxThe evaluation context.
indexThe index of the parameter. Index zero is the bottom-most operand popped from the stack.
Returns
The value of that parameter or a NULL pointer if there is no such parameter.

References CHKNULL, refda_oper_eval_ctx_t::operands, and cace_ari_itemized_t::ordered.

Referenced by refda_adm_ietf_dtnma_agent_oper_add(), refda_adm_ietf_dtnma_agent_oper_bit_and(), refda_adm_ietf_dtnma_agent_oper_bit_not(), refda_adm_ietf_dtnma_agent_oper_bit_or(), refda_adm_ietf_dtnma_agent_oper_bit_xor(), refda_adm_ietf_dtnma_agent_oper_bool_and(), refda_adm_ietf_dtnma_agent_oper_bool_not(), refda_adm_ietf_dtnma_agent_oper_bool_or(), refda_adm_ietf_dtnma_agent_oper_bool_xor(), refda_adm_ietf_dtnma_agent_oper_compare_eq(), refda_adm_ietf_dtnma_agent_oper_compare_ge(), refda_adm_ietf_dtnma_agent_oper_compare_gt(), refda_adm_ietf_dtnma_agent_oper_compare_le(), refda_adm_ietf_dtnma_agent_oper_compare_lt(), refda_adm_ietf_dtnma_agent_oper_compare_ne(), refda_adm_ietf_dtnma_agent_oper_convert_type(), refda_adm_ietf_dtnma_agent_oper_divide(), refda_adm_ietf_dtnma_agent_oper_is_model_odm(), refda_adm_ietf_dtnma_agent_oper_is_not_undefined(), refda_adm_ietf_dtnma_agent_oper_is_org_private(), refda_adm_ietf_dtnma_agent_oper_is_same_ns(), refda_adm_ietf_dtnma_agent_oper_is_same_object(), refda_adm_ietf_dtnma_agent_oper_is_truthy(), refda_adm_ietf_dtnma_agent_oper_is_undefined(), refda_adm_ietf_dtnma_agent_oper_list_get(), refda_adm_ietf_dtnma_agent_oper_map_get(), refda_adm_ietf_dtnma_agent_oper_match_model_int_range(), refda_adm_ietf_dtnma_agent_oper_match_object_int_range(), refda_adm_ietf_dtnma_agent_oper_match_object_type(), refda_adm_ietf_dtnma_agent_oper_match_org_int_range(), refda_adm_ietf_dtnma_agent_oper_match_regexp(), refda_adm_ietf_dtnma_agent_oper_match_type(), refda_adm_ietf_dtnma_agent_oper_multiply(), refda_adm_ietf_dtnma_agent_oper_negate(), refda_adm_ietf_dtnma_agent_oper_predicate_all(), refda_adm_ietf_dtnma_agent_oper_predicate_any(), refda_adm_ietf_dtnma_agent_oper_predicate_none(), refda_adm_ietf_dtnma_agent_oper_remainder(), refda_adm_ietf_dtnma_agent_oper_strict_eq(), refda_adm_ietf_dtnma_agent_oper_strict_ne(), refda_adm_ietf_dtnma_agent_oper_sub(), refda_adm_ietf_dtnma_agent_oper_tbl_filter(), refda_adm_ietf_dtnma_agent_oper_tbl_get(), refda_adm_ietf_dtnma_agent_oper_unary_eval(), and test_reporting_oper_add().

◆ refda_oper_eval_ctx_get_operand_name()

const cace_ari_t * refda_oper_eval_ctx_get_operand_name ( const refda_oper_eval_ctx_t ctx,
const char *  name 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Access an operand by name.

References CHKNULL, cace_ari_itemized_t::named, and refda_oper_eval_ctx_t::operands.

◆ refda_oper_eval_ctx_has_aparam_undefined()

◆ refda_oper_eval_ctx_has_operand_undefined()

◆ refda_oper_eval_ctx_init()

◆ refda_oper_eval_ctx_populate()

int refda_oper_eval_ctx_populate ( refda_oper_eval_ctx_t obj,
const cace_amm_lookup_t deref,
const refda_amm_oper_desc_t oper,
refda_eval_ctx_t eval 
)

Populate a context based on an object reference ARI and a target object's formal parameters.

Parameters
[out]objThe context to initialize.
[in]derefThe lookup dereference.
[in]operThe OPER descriptor to evaluate with.
[in,out]evalThe evaluation state to pop operands from. The result must outlive this context.
Returns
Zero if successful.

References cace_amm_type_convert(), cace_amm_type_is_seq(), cace_ari_deinit(), CACE_ARI_INIT_UNDEFINED, cace_ari_itemized_reset(), CACE_ARI_TEXT_ENC_OPTS_DEFAULT, cace_ari_text_encode(), CACE_LOG_DEBUG, cace_log_is_enabled_for(), CACE_LOG_WARNING, CHKERR1, refda_oper_eval_ctx_t::deref, refda_oper_eval_ctx_t::evalctx, cace_amm_named_type_t::name, cace_ari_itemized_t::named, refda_oper_eval_ctx_t::oper, refda_amm_oper_desc_t::operand_types, refda_oper_eval_ctx_t::operands, cace_ari_itemized_t::ordered, refda_eval_ctx_t::stack, and cace_amm_named_type_t::typeobj.

Referenced by refda_eval_oper().

◆ refda_oper_eval_ctx_set_result_copy()

void refda_oper_eval_ctx_set_result_copy ( refda_oper_eval_ctx_t ctx,
const cace_ari_t value 
)

Set the result for an operator evaluation, which marks it as finished.

Parameters
[in,out]ctxThe context to update.
[in]valueThe value to use as the evaluation result and push on the stack.

References cace_ari_set_copy(), and refda_oper_eval_ctx_t::result.

Referenced by refda_adm_ietf_dtnma_agent_oper_list_get(), refda_adm_ietf_dtnma_agent_oper_map_get(), refda_adm_ietf_dtnma_agent_oper_ref(), and refda_adm_ietf_dtnma_agent_oper_tbl_get().

◆ refda_oper_eval_ctx_set_result_move()

void refda_oper_eval_ctx_set_result_move ( refda_oper_eval_ctx_t ctx,
cace_ari_t value 
)

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Set the result with move semantics.

References cace_ari_set_move(), CHKVOID, and refda_oper_eval_ctx_t::result.

Referenced by refda_adm_ietf_dtnma_agent_oper_add(), refda_adm_ietf_dtnma_agent_oper_bit_and(), refda_adm_ietf_dtnma_agent_oper_bit_not(), refda_adm_ietf_dtnma_agent_oper_bit_or(), refda_adm_ietf_dtnma_agent_oper_bit_xor(), refda_adm_ietf_dtnma_agent_oper_bool_and(), refda_adm_ietf_dtnma_agent_oper_bool_not(), refda_adm_ietf_dtnma_agent_oper_bool_or(), refda_adm_ietf_dtnma_agent_oper_bool_xor(), refda_adm_ietf_dtnma_agent_oper_compare_eq(), refda_adm_ietf_dtnma_agent_oper_compare_ge(), refda_adm_ietf_dtnma_agent_oper_compare_gt(), refda_adm_ietf_dtnma_agent_oper_compare_le(), refda_adm_ietf_dtnma_agent_oper_compare_lt(), refda_adm_ietf_dtnma_agent_oper_compare_ne(), refda_adm_ietf_dtnma_agent_oper_convert_type(), refda_adm_ietf_dtnma_agent_oper_divide(), refda_adm_ietf_dtnma_agent_oper_eval(), refda_adm_ietf_dtnma_agent_oper_is_model_odm(), refda_adm_ietf_dtnma_agent_oper_is_not_undefined(), refda_adm_ietf_dtnma_agent_oper_is_org_private(), refda_adm_ietf_dtnma_agent_oper_is_same_ns(), refda_adm_ietf_dtnma_agent_oper_is_same_object(), refda_adm_ietf_dtnma_agent_oper_is_truthy(), refda_adm_ietf_dtnma_agent_oper_is_undefined(), refda_adm_ietf_dtnma_agent_oper_match_model_int_range(), refda_adm_ietf_dtnma_agent_oper_match_object_int_range(), refda_adm_ietf_dtnma_agent_oper_match_object_type(), refda_adm_ietf_dtnma_agent_oper_match_org_int_range(), refda_adm_ietf_dtnma_agent_oper_match_regexp(), refda_adm_ietf_dtnma_agent_oper_match_type(), refda_adm_ietf_dtnma_agent_oper_multiply(), refda_adm_ietf_dtnma_agent_oper_nary_eval(), refda_adm_ietf_dtnma_agent_oper_negate(), refda_adm_ietf_dtnma_agent_oper_predicate_all(), refda_adm_ietf_dtnma_agent_oper_predicate_any(), refda_adm_ietf_dtnma_agent_oper_predicate_none(), refda_adm_ietf_dtnma_agent_oper_remainder(), refda_adm_ietf_dtnma_agent_oper_strict_eq(), refda_adm_ietf_dtnma_agent_oper_strict_ne(), refda_adm_ietf_dtnma_agent_oper_sub(), refda_adm_ietf_dtnma_agent_oper_tbl_filter(), refda_adm_ietf_dtnma_agent_oper_unary_eval(), and test_reporting_oper_add().