op_ima_obj_hname_get()

Abstract

Generates the hierarchical name of an object.

Syntax

op_ima_obj_hname_get (objid, hname, max_len)
Argument Type Description
objid Objid object ID of the object-of-interest
hname char * character buffer in which to place the generated hierarchical name (size must be at least max_len characters)
max_len int maximum length for hierarchical name

Return Type

Compcode

Completion code indicating whether the operation completed successfully. OPC_COMPCODE_FAILURE if an error occurs (see Errors section); OPC_COMPCODE_SUCCESS otherwise.

Example

char    name[100];

if (op_ima_obj_hname_get (op_id_self (), name, 100) == OPC_COMPCODE_SUCCESS)
	printf ("This object's name is %s\n", name);

Details

This KP obtains the hierarchical name of the specified object and, if necessary, drops characters from the front of the hierarchical name to limit the name to max_len.

Purpose

This KP generates the hierarchical name of a specified object. The name is placed in hname. op_ima_obj_hname_get() provides a quicker way of generating a hierarchical name than by using repeated calls to op_ima_obj_attr_get() to get the names of an object and each of its parents.

Errors

  • Recoverable Error: Object ID (<site_objid>) is out-of-range.
  • Recoverable Error: Object ID (<site_objid>) refers to a restricted object.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com