Ovis_Entity_From_Objid_Create()

摘要

根据仿真对象 ID 创建 Ovis 实体。

语法

Ovis_Entity_From_Objid_Create (des_objid, callback, state_ptr)
参数 类型 说明
des_objid Objid 站点的仿真对象 ID
callback OvisT_Entity_State_Destroy_Proc 实体被销毁时用于销毁实体状态的回调函数
state_ptr void * 可选的用户提供的状态

返回类型

OvisT_Entity *

返回该实体,或返回 OVISC_NIL。

头文件

ovis_entity.h

详情

该函数使用仿真对象 ID 指定的站点创建 Ovis 实体。如果该站点已关联某个实体,函数将返回该实体(其状态和销毁过程不会被所提供的参数修改)。该函数只能在仿真的上下文中使用。

示例

OvisT_Entity     * ent_ptr;
OvisT_DIS_Type    dis [] { 1, 2, 225, 20, 2, 10, 0 };

/* Create entity associated with node containing that process model */
ent_ptr = Ovis_Entity_From_Objid_Create (op_topo_parent (op_id_self ()),
    OPC_NIL, OPC_NIL);

Ovis_Entity_Animation_Set (ent_ptr, OPC_NIL, OvisC_Aggregation_Entity, dis,
    OvisC_DIS_Force_Friendly, OvisC_DIS_DR_Static);
Ovis_Entity_Animation_Enable (ent_ptr);

错误

  • 对象 ID(<id>)超出范围。
  • 对象 ID(<id>)指向受限对象。
  • 对象 <hname> 不是固定节点、移动节点或子网。

参考

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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