Container Interactions in C for RAD
The following are the RAD container actions in the C language:
-
conerr_t rad_cont_insert(rad_container_t *container, adr_name_t *name, rad_instance_t *instance); conerr_t rad_cont_insert_singleton(rad_container_t *container, adr_name_t *name, rad_object_t *object);-
Creates an instance,
rad_instance_t, using the supplied name and object and then inserts it into container. If the operation succeeds,CE_OKis returned. -
void rad_cont_remove(rad_container_t *container, adr_name_t *name); -
Removes the
instancefrom the container. -
conerr_t rad_cont_register_dynamic(rad_container_t *container, adr_name_t *name, rad_modinfo_t *modinfo, rad_dyn_list_t listf, rad_dyn_lookup_t lookupf, void *arg); conerr_t (*rad_dyn_list_t)(adr_pattern_t *pattern, adr_data_t **data, void *arg);conerr_t (*rad_dyn_lookup_t)(adr_name_t **name, rad_instance_t **inst, void *arg);-
Registers a dynamic container instance manager. This is the container in which the instances will be managed. The
namedefines the name filter for which this instance manager is responsible. A typical name would define the type of the instance which are managed. For example,zname = adr_name_vcreate (MOD_DOMAIN, 1, "type", "Zone")would be responsible for managing all instances with a type of "Zone". listf is a user-supplied function which is invoked when objects with the matching pattern are listed. lookupf is a user-supplied function which is invoked when objects with the matching name are looked up. arg is stored and provided in the callback to the user functions.