op_vvec_type_get()

摘要

获取向量的数据类型。

语法

op_vvec_type_get (vector)
参数 类型 说明
vector Vvec_Vector 目标值向量

返回类型

int

指示值向量各元素数据类型的常量

用作返回值的常量列表参见 Table 98 “Value Vector Type Symbolic Constants“ 第 35 页。

示例

/* Determine whether a value vector's type matches an esys interface's */
/* type before applying the vector to the esys interface.                         */
op_ima_obj_attr_get (interface_id, "type", &interface_type);
if (op_vvec_type_get (src_vector) == interface_type)
	{
	/* apply the vector value. */
	op_esys_interface_vector_set (interface_id, op_sim_time (), src_vector, 0);
	}
else
	{
	printf ("Error: interface type and vector type do not match.\n");
	}

详情

向量只能存储与其数据类型匹配的数据。

用途

提供一种确定值向量数据类型的机制。

错误

  • 可恢复错误:值向量无效。

参考

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