RAD Static Objects

The rad_modapi.h header file declares two interfaces for statically adding objects to a namespace.

rad_cont_insert

Adds an object to the namespace. In turn, objects are created by calling rad_instance_create with a pointer to the interface the object implements, a pointer to object-specific callback data and a pointer to a function to free the callback data. For example:

adr_name _t *uname = adr_name_vcreate("com.oracle.solaris.rad.user", 1, "type", "User");
     rad_instance_t *inst = rad_instance_create(&interface_User_svr, kyle_data, NULL);
     (void) rad_cont_insert(&rad_container, uname, inst);
     adr_name_rele(uname);
rad_cont_insert_singleton

Is a convenience routine that creates an object instance for the specified interface with the specified name and adds it to the namespace. The callback data is set to NULL. For example:

adr_name _t *uname = adr_name_vcreate("com.oracle.solaris.rad.user", 1, "type", "User");
    (void) rad_cont_insert_singleton(&rad_container, uname, &interface_User_svr);
    adr_name_rele(uname);