1
1

add opal_hash_table_get_{first,next}_key_ptr

Этот коммит содержится в:
Gilles Gouaillardet 2014-11-20 14:55:56 +09:00
родитель 48f702827e
Коммит 0e3b5bf000
2 изменённых файлов: 62 добавлений и 0 удалений

Просмотреть файл

@ -795,6 +795,30 @@ opal_hash_table_get_next_key_uint32(opal_hash_table_t * ht,
return OPAL_ERROR;
}
int /* OPAL_ return code */
opal_hash_table_get_first_key_ptr(opal_hash_table_t * ht,
void * *key, size_t *key_size, void * *value,
void * *node)
{
return opal_hash_table_get_next_key_ptr(ht, key, key_size, value, NULL, node);
}
int /* OPAL_ return code */
opal_hash_table_get_next_key_ptr(opal_hash_table_t * ht,
void * *key, size_t *key_size, void * *value,
void * in_node, void * *out_node)
{
opal_hash_element_t * elt;
if (OPAL_SUCCESS == opal_hash_table_get_next_elt(ht, (opal_hash_element_t *) in_node, &elt)) {
*key = (void *)elt->key.ptr.key;
*key_size = elt->key.ptr.key_size;
*value = elt->value;
*out_node = elt;
return OPAL_SUCCESS;
}
return OPAL_ERROR;
}
int /* OPAL_ return code */
opal_hash_table_get_first_key_uint64(opal_hash_table_t * ht,
uint64_t *key, void * *value,

Просмотреть файл

@ -302,6 +302,44 @@ OPAL_DECLSPEC int opal_hash_table_get_next_key_uint64(opal_hash_table_t *table,
void **out_node);
/**
* Get the first ptr bit key from the hash table, which can be used later to
* get the next key
* @param table The hash table pointer (IN)
* @param key The first key (OUT)
* @param key_size The first key size (OUT)
* @param value The value corresponding to this key (OUT)
* @param node The pointer to the hash table internal node which stores
* the key-value pair (this is required for subsequent calls
* to get_next_key) (OUT)
* @return OPAL error code
*
*/
OPAL_DECLSPEC int opal_hash_table_get_first_key_ptr(opal_hash_table_t *table, void* *key,
size_t *key_size, void **value, void **node);
/**
* Get the next ptr bit key from the hash table, knowing the current key
* @param table The hash table pointer (IN)
* @param key The key (OUT)
* @param key_size The key size (OUT)
* @param value The value corresponding to this key (OUT)
* @param in_node The node pointer from previous call to either get_first
or get_next (IN)
* @param out_node The pointer to the hash table internal node which stores
* the key-value pair (this is required for subsequent calls
* to get_next_key) (OUT)
* @return OPAL error code
*
*/
OPAL_DECLSPEC int opal_hash_table_get_next_key_ptr(opal_hash_table_t *table, void* *key,
size_t *key_size, void **value,
void *in_node, void **out_node);
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_proc_table_t);