TuyaOS
宏定义 | 类型定义
hashmap.h 文件参考

tuya hasmap module 更多...

#include "tuya_hashmap.h"
hashmap.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

宏定义

#define hashmap_data_traversal(in, key, arg_iterator)   tuya_hashmap_data_traversal(in, key, arg_iterator)
 traverse all data with same key 更多...
 
#define HASHMAP_FOR_EACH_DATA(in, key, data_iter)   TUYA_HASHMAP_FOR_EACH_DATA(in, key, data_iter)
 traverse all data with same key
 
#define hashmap_free(in)   tuya_hashmap_free(in)
 free the hashmap 更多...
 
#define hashmap_get(in, key, arg)   tuya_hashmap_get(in, key, arg)
 get an element from the hashmap 更多...
 
#define hashmap_length(in)   tuya_hashmap_length(in)
 get current size of the hashmap 更多...
 
#define hashmap_new(table_size)   tuya_hashmap_new(table_size)
 create a new empty hashmap 更多...
 
#define hashmap_put(in, key, data)   tuya_hashmap_put(in, key , data)
 Add an element to the hashmap 更多...
 
#define hashmap_remove(in, key, data)   tuya_hashmap_remove(in, key, data)
 remove an element from the hashmap 更多...
 

类型定义

typedef ANY_T any_t
 
typedef ANY_T_ITER any_t_iter
 
typedef MAP_T map_t
 

详细描述

tuya hasmap module

版本
1.0
日期
2019-10-30

宏定义说明

◆ hashmap_data_traversal

#define hashmap_data_traversal (   in,
  key,
  arg_iterator 
)    tuya_hashmap_data_traversal(in, key, arg_iterator)

traverse all data with same key

参数
[in]inthe hashmap
[in]keythe key of element
[in,out]arg_iteratorthe traverse iterator
返回
MAP_OK on success, others on failed, please refer to the define of hashmap error code
注解
if arg_iterator is NULL, fetch the first element, otherwise, fetch the next element

◆ hashmap_free

#define hashmap_free (   in)    tuya_hashmap_free(in)

free the hashmap

参数
[in]inthe hashmap need to free
警告
must remove all element first, otherwise, it will cause element leak

◆ hashmap_get

#define hashmap_get (   in,
  key,
  arg 
)    tuya_hashmap_get(in, key, arg)

get an element from the hashmap

参数
[in]inthe hashmap
[in]keythe key of the element
[out]argthe first value that the key matches
返回
MAP_OK on success, others on failed, please refer to the define of hashmap error code

◆ hashmap_length

#define hashmap_length (   in)    tuya_hashmap_length(in)

get current size of the hashmap

参数
[in]inthe hashmap
返回
the current size

◆ hashmap_new

#define hashmap_new (   table_size)    tuya_hashmap_new(table_size)

create a new empty hashmap

参数
[in]table_sizethe hash table size
返回
a new empty hashmap

◆ hashmap_put

#define hashmap_put (   in,
  key,
  data 
)    tuya_hashmap_put(in, key , data)

Add an element to the hashmap

参数
[in]inthe hashmap
[in]keythe key of hash element
[in]datathe data of hash element
返回
MAP_OK on success, others on failed, please refer to the define of hashmap error code
注解
For same key, it does not replace it. it is inserted in the head of the list

◆ hashmap_remove

#define hashmap_remove (   in,
  key,
  data 
)    tuya_hashmap_remove(in, key, data)

remove an element from the hashmap

参数
[in]inthe hashmap
[in]keythe key of element
[in]datathe data of the element
返回
MAP_OK on success, others on failed, please refer to the define of hashmap error code
注解
if data is NULL,then delete the first note match key.if data is not null, then delete the node match key and data.