加入收藏
举报
当前仅显示指定条件回帖 [ 展开查看全部 ]
02-14 20:03
#
文件名称:
common-h.md
所在目录:
Openharmony v1.0 / docs / docs-en / api / api-SmartVision-Devices
文件大小:
10.67 KB
下载地址:
fenwii/OpenHarmony
   
免责声明:本网站仅提供指向 GitHub 上的文件的链接,所有文件的版权归原作者所有,本网站不对文件内容的合法性、准确性或安全性承担任何责任。
文本预览:
# common.h
## **Overview**
**Related Modules:**
[Samgr](samgr.md)
**Description:**
Provides common objects and functions for Samgr and external modules.
This file provides simplified vector containers and downcast functions.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Structures









Data Structure Name


Description


SimpleVector


Defines the simplified vector class, which is extended by four elements.



## Macros









Macro Name and Value


Description


GET_OFFSIZE(T, member) (long)((char *)&(((T *)(0))->member))


Calculates the offset of the member in the T type.



## Typedefs









Typedef Name


Description


Vector


typedef struct SimpleVector


Defines the simplified vector class, which is extended by four elements.



## Functions

































Function Name


Description


VECTOR_Make (VECTOR_Key key, VECTOR_Compare compare)


Vector


Creates or initializes a vector object.


VECTOR_Clear (Vector *vector)


void


Destruct a vector object.


VECTOR_Add (Vector *vector, void *element)


int16


Adds an element to the vector.


VECTOR_Size (Vector *vector)


int16


Obtains the number of elements in the vector, including elements that have been set to NULL.


VECTOR_Num (Vector *vector)


int16


Obtains the number of valid elements in the vector, excluding elements that have been set to NULL.


VECTOR_At (Vector *vector, int16 index)


void *


Obtains the element at a specified position.


VECTOR_Swap (Vector *vector, int16 index, void *element)


void *


Swaps the element at a specified position in a vector with another element.


VECTOR_Find (Vector *vector, const void *element)


int16


Checks the position of an element.


VECTOR_FindByKey (Vector *vector, const void *key)


int16


Checks the position of the element with a specified key.


点赞 回复
回帖
支持markdown部分语法 ?