hashtable: document get_safe_ptr()
authorBrian Norris <banorris@uci.edu>
Sat, 11 Aug 2012 01:11:12 +0000 (18:11 -0700)
committerBrian Norris <banorris@uci.edu>
Sat, 11 Aug 2012 01:11:12 +0000 (18:11 -0700)
hashtable.h

index b4054ec8c71263c0210e216fe5befef329ef4ddc..8302000b03e9f9946eb064a8c5c61ca1d8f27b44 100644 (file)
@@ -152,7 +152,16 @@ template<typename _Key, typename _Val, typename _KeyInt, int _Shift=0, void * (*
                size++;
        }
 
                size++;
        }
 
-       /** Put a key entry into the table. */
+       /**
+        * @brief Get a valid pointer to a value corresponding to a given key
+        *
+        * Ensure that key is present in the hash table, then return a pointer
+        * to its value bin. This may require either creating a new bin for
+        * this key (with a default-constructed value) or simply locating and
+        * returning a pointer to an existing value.
+        * @param key The key to check
+        * @return A pointer to the value in the table
+        */
        _Val * get_safe_ptr(_Key key) {
                if (size > threshold)
                        resize(capacity << 1);
        _Val * get_safe_ptr(_Key key) {
                if (size > threshold)
                        resize(capacity << 1);