op_id_from_hierarchical_name()
Abstract
Obtains the object ID of an object specified by its hierarchical name.
Syntax
op_id_from_hierarchical_name (hname)
| Argument | Type | Description |
|---|---|---|
hname |
const char * |
full hierarchical name of the object-of-interest |
Return Type
Objid
Object ID of the object, or OPC_OBJID_INVALID if no existing object matches the specified criteria or if a recoverable error occurs.
Example
/* determine the object ID of the desired remote queue */
rem_node_objid = op_id_from_hierarchical_name ("top.office.frnt_end");
rem_queue_objid = op_id_from_name (rem_node_objid, OPC_OBJTYPE_QUEUE, "buffer_a");
/* obtain key state variables of queueing process */
prio_thresh_ptr = (int *) op_ima_obj_svar_get (rem_queue_objid, "prio_thresh");
protocol_version = (char *) op_ima_obj_svar_get (rem_queue_objid, "proto_ver");
/* modify the state variables */
*prio_thresh_ptr = 44;
sprintf (protocol_version, "Ver 5.1")
Details
None.
Purpose
Provides a mechanism to map from object hierarchical names into object IDs.
Errors
- Program Abort: Segmentation violation. (due to a malformed
hnameargument) - Recoverable Error: Hierarchical name passed in to
op_id_from_hierarchical_name ()is NULL. - Recoverable Error: Name (
<hname>) cannot be matched to an object id because of (<error_string>).
Reference
- Use the KP op_id_from_userid() to obtain the object ID of a network object from its user ID
- Use the KP op_ima_obj_attr_get() to obtain the value of an object’s attribute
- Use the KP op_ima_obj_attr_set() to assign the value of an object’s attribute
- Use the KP op_topo_child() to obtain child object IDs by type and index
- Use the KP op_topo_parent() to obtain the object ID of the parent of an object
- Use the KP op_ima_obj_hname_get() to get a hierarchial name from an object ID