DTNMA Reference Tools v2.0.0 - 7.g88e232c
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains definitions for AMM typing of ARI values. More...
Data Structures | |
struct | cace_amm_typeptr_t |
A pointer to cace_amm_type_t with ownership semantics. More... | |
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() (INIT(API_2(cace_amm_type_init)), CLEAR(API_2(cace_amm_type_deinit)), RESET(API_2(cace_amm_type_reset))) |
M*LIB OPLIST for the cace_amm_type_t. | |
#define | M_OPL_cace_amm_typeptr_t() (INIT(API_2(cace_amm_typeptr_init)), CLEAR(API_2(cace_amm_typeptr_deinit))) |
OPLIST for the cace_amm_typeptr_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... | |
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_reset (cace_amm_type_t *type) |
Reset to the default invalid state. | |
void | cace_amm_typeptr_init (cace_amm_typeptr_t *ptr) |
Initialize a type pointer to an allocated and initialized type object. | |
void | cace_amm_typeptr_deinit (cace_amm_typeptr_t *ptr) |
Free any allocated type object. | |
void | cace_amm_typeptr_take (cace_amm_typeptr_t *ptr, cace_amm_type_t *obj) |
Take ownership of a pointed-to object. | |
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 a human-friendly name for a type object. | |
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. | |
This file contains definitions for AMM typing of ARI values.
#define CACE_AMM_TYPE_INIT_INVALID |
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 CHKFALSE, and cace_ari_visitor_t::visit_ari.
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. |
void cace_amm_type_deinit | ( | cace_amm_type_t * | type | ) |
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_LOG_WARNING.
bool cace_amm_type_get_name | ( | const cace_amm_type_t * | type, |
cace_ari_t * | name | ||
) |
Get a human-friendly name for a type object.
[in] | type | The type to name. |
[out] | name | The generated name. |
References CHKFALSE.
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 CHKVOID.
bool cace_amm_type_is_valid | ( | const cace_amm_type_t * | type | ) |
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, and CHKRET.
void cace_amm_type_reset | ( | cace_amm_type_t * | type | ) |
Reset to the default invalid state.
[in,out] | type | The object to reset. |
void cace_amm_typeptr_deinit | ( | cace_amm_typeptr_t * | ptr | ) |
Free any allocated type object.
[in,out] | ptr | The object to de-initialize. |
References CACE_FREE, CHKVOID, and cace_amm_typeptr_t::obj.
void cace_amm_typeptr_init | ( | cace_amm_typeptr_t * | ptr | ) |
Initialize a type pointer to an allocated and initialized type object.
[out] | ptr | The type to initialize. |
References CACE_MALLOC, CHKVOID, and cace_amm_typeptr_t::obj.
void cace_amm_typeptr_take | ( | cace_amm_typeptr_t * | ptr, |
cace_amm_type_t * | obj | ||
) |
Take ownership of a pointed-to object.
[in,out] | ptr | The object to set. |
[in] | obj | The object to own. |
References CHKVOID, and cace_amm_typeptr_t::obj.