Changeset 2859 for trunk/psLib/src/collections/psHash.h
- Timestamp:
- Jan 3, 2005, 10:28:07 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/collections/psHash.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/collections/psHash.h
r2204 r2859 10 10 * @author Robert Lupton, Princeton University 11 11 * @author George Gusciora, MHPCC 12 * 13 * @version $Revision: 1.5 $ $Name: not supported by cvs2svn $ 14 * @date $Date: 2004-10-27 00:57:31 $ 12 * @author Robert DeSonia, MHPCC 13 * 14 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2005-01-03 20:28:07 $ 15 16 * 16 17 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 29 typedef struct psHashBucket 29 30 { 30 char *key; ///< key for this item of data31 psPtr data; ///< the data itself32 struct psHashBucket* next; ///< list of other possible keys31 char *key; ///< key for this item of data 32 psPtr data; ///< the data itself 33 struct psHashBucket* next; ///< list of other possible keys 33 34 } 34 35 psHashBucket; … … 39 40 typedef struct psHash 40 41 { 41 psS32 nbucket; ///< Number of buckets in hash table.42 psHashBucket* *buckets; ///< The bucket data.42 psS32 nbucket; ///< Number of buckets in hash table. 43 psHashBucket* *buckets; ///< The bucket data. 43 44 } 44 45 psHash; 45 46 46 47 /// Allocate hash buckets in table. 47 psHash* psHashAlloc(psS32 nbucket ///< The number of buckets to allocate. 48 ); 48 psHash* psHashAlloc( 49 psS32 nbucket ///< The number of buckets to allocate. 50 ); 49 51 50 52 /// Insert entry into table. 51 psBool psHashAdd(psHash* table, ///< table to insert in 52 const char *key, ///< key to use 53 psPtr data ///< data to insert 54 ); 53 psBool psHashAdd( 54 psHash* table, ///< table to insert in 55 const char *key, ///< key to use 56 psPtr data ///< data to insert 57 ); 55 58 56 59 /// Lookup key in table. 57 psPtr psHashLookup(psHash* table, ///< table to lookup key in 58 const char *key ///< key to lookup 59 ); 60 psPtr psHashLookup( 61 psHash* table, ///< table to lookup key in 62 const char *key ///< key to lookup 63 ); 60 64 61 65 /// Remove key from table. 62 psBool psHashRemove(psHash* table, ///< table to lookup key in 63 const char *key ///< key to lookup 64 ); 66 psBool psHashRemove( 67 psHash* table, ///< table to lookup key in 68 const char *key ///< key to lookup 69 ); 65 70 66 71 /// List all keys in table. 67 psList* psHashKeyList(psHash* table ///< table to list keys from. 68 ); 72 psList* psHashKeyList( 73 psHash* table ///< table to list keys from. 74 ); 75 76 /** Create a psArray from a psHash contents. 77 * 78 * @return psArray* A new psArray with duplicate contents of the input psHash 79 */ 80 psArray* psHashToArray( 81 psHash* table ///< table to convert to psArray 82 ); 69 83 70 84 /* \} */// End of DataGroup Functions
Note:
See TracChangeset
for help on using the changeset viewer.
