Obtaining a Reference to a RAD Singleton in C
A module developer creates a singleton to represent an interface. This interface can be accessed easily. For example, the zonemgr
module defines a singleton interface, ZoneInfo. It contains information about the zone that contains the RAD instance with which you are communicating.
Example 2-3 C Language – Obtaining a Reference to a RAD Singleton
#include <rad/radclient.h> #include<rad/client/1/zonemgr.h> rc_instance_t *inst; rc_err_t status; char *name; rc_conn_t *conn = rc_connect_unix(NULL, NULL); if (conn !=NULL) { status = zonemgr_ZoneInfo__rad_lookup(conn, B_TRUE, &inst, 0); if(status == RCE_OK) { status =zonemgr_ZoneInfo_get_name(inst, &name); if (status ==RCE_OK) printf("Zone name: %s\n", name); } }
In the preceding example, you have connected to a local RAD instance, and have obtained a remote object reference directly using the lookup function provided by the zonemgr
binding. After you have the remote reference, you can access the properties with the module_interface__get_<property>
() function.