DTNMA Reference Tools v2.0.0 - 7.g88e232c
Delay-Tolerant Networking Management Architecture (DTNMA) Tool Suite
Loading...
Searching...
No Matches
base.h File Reference

This file contains the definitions, prototypes, constants, and other information necessary for the identification and processing of AMM Resource Identifiers (ARIs). More...

#include "type.h"
#include "lit.h"
#include "ref.h"
#include "cace/config.h"
#include "cace/cace_data.h"
#include <m-string.h>
#include <m-list.h>
#include <m-dict.h>
#include <time.h>
#include <stdint.h>
#include <stdbool.h>
+ Include dependency graph for base.h:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  cace_ari_t
 Defines a general-purpose ARI structure. More...
 

Macros

#define CACE_ARI_INIT_UNDEFINED
 A static value to initialize an ARI to the undefined value.
 
#define CACE_ARI_INIT_NULL
 

Functions

void cace_ari_init (cace_ari_t *ari)
 Initialize an ARI to the undefined value.
 
cace_ari_lit_tcace_ari_init_lit (cace_ari_t *ari)
 Initialize an ARI to be a literal value which requires further state initialization.
 
cace_ari_ref_tcace_ari_init_objref (cace_ari_t *ari)
 Initialize an ARI to be an object reference value which requires further state initialization.
 
int cace_ari_init_copy (cace_ari_t *ari, const cace_ari_t *src)
 Initialize an ARI with copy semantics.
 
int cace_ari_init_move (cace_ari_t *ari, cace_ari_t *src)
 Initialize an ARI with move semantics.
 
int cace_ari_deinit (cace_ari_t *ari)
 De-initialize an ARI.
 
void cace_ari_reset (cace_ari_t *ari)
 Reset an initialized ARI to the undefined value.
 
cace_ari_ref_tcace_ari_set_objref (cace_ari_t *ari)
 Set an ARI to be an object reference value which requires further state setting.
 
int cace_ari_set_copy (cace_ari_t *ari, const cace_ari_t *src)
 Copy an ARI value into another ARI.
 
int cace_ari_set_move (cace_ari_t *ari, cace_ari_t *src)
 Move an ARI value into another ARI.
 

Detailed Description

This file contains the definitions, prototypes, constants, and other information necessary for the identification and processing of AMM Resource Identifiers (ARIs).

Every object in the AMM can be uniquely identified using an ARI.

Macro Definition Documentation

◆ CACE_ARI_INIT_NULL

#define CACE_ARI_INIT_NULL
Value:
{ \
.is_ref = false, .as_lit = {.prim_type = CACE_ARI_PRIM_NULL } \
}
@ CACE_ARI_PRIM_NULL
A singleton primitive associated with CACE_ARI_TYPE_NULL.
Definition lit.h:72
Defines a general-purpose ARI structure.
Definition base.h:51

◆ CACE_ARI_INIT_UNDEFINED

#define CACE_ARI_INIT_UNDEFINED
Value:
{ \
.is_ref = false, .as_lit = {.prim_type = CACE_ARI_PRIM_UNDEFINED } \
}
@ CACE_ARI_PRIM_UNDEFINED
A singleton primitive type with no specific value.
Definition lit.h:70

A static value to initialize an ARI to the undefined value.

This can be used as an alternative to cace_ari_init() for static initialization.

Function Documentation

◆ cace_ari_deinit()

◆ cace_ari_init()

void cace_ari_init ( cace_ari_t ari)

Initialize an ARI to the undefined value.

Parameters
[out]ariThe value to modify.

References cace_ari_state_reset(), and CHKVOID.

Referenced by cace_amp_msg_decode(), and cace_ari_tbl_move_row_ac().

◆ cace_ari_init_copy()

int cace_ari_init_copy ( cace_ari_t ari,
const cace_ari_t src 
)

Initialize an ARI with copy semantics.

Parameters
[in,out]ariThe value to modify.
srcThe source to deep copy from.

References CHKERR1.

Referenced by cace_amm_type_set_use_ref().

◆ cace_ari_init_lit()

◆ cace_ari_init_move()

int cace_ari_init_move ( cace_ari_t ari,
cace_ari_t src 
)

Initialize an ARI with move semantics.

Parameters
[in,out]ariThe value to modify.
[in,out]srcThe source to move from and reset.

References cace_ari_state_reset(), and CHKERR1.

◆ cace_ari_init_objref()

cace_ari_ref_t * cace_ari_init_objref ( cace_ari_t ari)

Initialize an ARI to be an object reference value which requires further state initialization.

Parameters
[out]ariThe value to modify.
Returns
A pointer to the object reference struct to set state in.

References cace_ari_t::as_ref, cace_ari_state_reset(), CHKNULL, and cace_ari_t::is_ref.

Referenced by cace_ari_cbor_decode_stream(), and cace_ari_set_objref().

◆ cace_ari_reset()

void cace_ari_reset ( cace_ari_t ari)

Reset an initialized ARI to the undefined value.

This is equivalent to calling cace_ari_deinit() and cace_ari_init() in sequence.

Parameters
[in,out]ariThe value to reset.
Postcondition
The ARI is left as the undefined value.

References cace_ari_state_reset(), and CHKVOID.

Referenced by cace_ari_cbor_decode(), and cace_ari_cbor_decode_stream().

◆ cace_ari_set_copy()

int cace_ari_set_copy ( cace_ari_t ari,
const cace_ari_t src 
)

Copy an ARI value into another ARI.

Parameters
[in,out]ariThe ARI to modify. The previous value is de-initialized prior to copy.
srcThe source to deep copy from.

References CHKERR1.

Referenced by cace_ari_lit_copy().

◆ cace_ari_set_move()

int cace_ari_set_move ( cace_ari_t ari,
cace_ari_t src 
)

Move an ARI value into another ARI.

Parameters
[in,out]ariThe ARI to modify. The previous value is de-initialized prior to move.
[in,out]srcThe source to move from and reset.
Postcondition
Source ARI is left as the undefined value.

References cace_ari_state_reset(), and CHKERR1.

Referenced by cace_amm_type_set_use_ref_move().

◆ cace_ari_set_objref()

cace_ari_ref_t * cace_ari_set_objref ( cace_ari_t ari)

Set an ARI to be an object reference value which requires further state setting.

Parameters
[in,out]ariThe value to modify.
Returns
A pointer to the object reference struct to set state in.

References cace_ari_init_objref(), and CHKNULL.

Referenced by cace_ari_set_objref_path_intid(), and cace_ari_set_objref_path_textid().