1 /* 2 * Copyright (c) 2010 Cisco Systems, Inc. All rights reserved. 3 * Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved. 4 * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. 5 * Copyright (c) 2015 Research Organization for Information Science 6 * and Technology (RIST). All rights reserved. 7 * $COPYRIGHT$ 8 * 9 * Additional copyrights may follow 10 * 11 * $HEADER$ 12 */ 13 14 #ifndef PMIX_HASH_H 15 #define PMIX_HASH_H 16 17 #include <src/include/pmix_config.h> 18 19 20 #include "src/mca/bfrops/bfrops_types.h" 21 #include "src/class/pmix_hash_table.h" 22 23 BEGIN_C_DECLS 24 25 /* store a value in the given hash table for the specified 26 * rank index.*/ 27 PMIX_EXPORT pmix_status_t pmix_hash_store(pmix_hash_table_t *table, 28 pmix_rank_t rank, pmix_kval_t *kv); 29 30 /* Fetch the value for a specified key and rank from within 31 * the given hash_table */ 32 PMIX_EXPORT pmix_status_t pmix_hash_fetch(pmix_hash_table_t *table, pmix_rank_t rank, 33 const char *key, pmix_value_t **kvs); 34 35 /* Fetch the value for a specified key from within 36 * the given hash_table 37 * It gets the next portion of data from table, where matching key. 38 * To get the first data from table, function is called with key parameter as string. 39 * Remaining data from table are obtained by calling function with a null pointer for the key parameter.*/ 40 PMIX_EXPORT pmix_status_t pmix_hash_fetch_by_key(pmix_hash_table_t *table, const char *key, 41 pmix_rank_t *rank, pmix_value_t **kvs, void **last); 42 43 /* remove the specified key-value from the given hash_table. 44 * A NULL key will result in removal of all data for the 45 * given rank. A rank of PMIX_RANK_WILDCARD indicates that 46 * the specified key is to be removed from the data for all 47 * ranks in the table. Combining key=NULL with rank=PMIX_RANK_WILDCARD 48 * will therefore result in removal of all data from the 49 * table */ 50 PMIX_EXPORT pmix_status_t pmix_hash_remove_data(pmix_hash_table_t *table, 51 pmix_rank_t rank, const char *key); 52 53 END_C_DECLS 54 55 #endif /* PMIX_HASH_H */