add opal_hash_table_get_{first,next}_key_ptr
Этот коммит содержится в:
родитель
48f702827e
Коммит
0e3b5bf000
@ -795,6 +795,30 @@ opal_hash_table_get_next_key_uint32(opal_hash_table_t * ht,
|
|||||||
return OPAL_ERROR;
|
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 */
|
int /* OPAL_ return code */
|
||||||
opal_hash_table_get_first_key_uint64(opal_hash_table_t * ht,
|
opal_hash_table_get_first_key_uint64(opal_hash_table_t * ht,
|
||||||
uint64_t *key, void * *value,
|
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);
|
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);
|
OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_proc_table_t);
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user