DTNMA Reference Tools v2.0.0 - 21.g58e5557
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
|
This file contains definitions for AMM typing of ARI values. More...
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_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. | |
This file contains definitions for AMM typing of ARI values.
#define CACE_AMM_TYPE_INIT_INVALID |
#define M_OPL_cace_amm_type_t | ( | ) |
M*LIB OPLIST for the cace_amm_type_t.
Possible classes of AMM types.
Result status for type matching.
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. |
References CACE_LOG_DEBUG, CHKERR1, and CHKRET.
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_INVALID, CACE_FREE, and CHKVOID.
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 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 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 | ) |
Determine if a type object is valid.
References CACE_AMM_TYPE_INVALID, and CHKFALSE.
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.
void cace_amm_type_reset | ( | cace_amm_type_t * | type | ) |
Reset to the default invalid state.
[in,out] | type | The object to reset. |
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. |