X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fstlplus%2Fcontainers%2Fhash.hpp;fp=src%2Fmoof%2Fstlplus%2Fhash.hpp;h=19624812850a1fc0d1355f983f3972b475e2d747;hp=05d3b7dcec718d2e8ffd4ef3da47150e94b943db;hb=6b0a0d0efafe34d48ab344fca3b479553bd4e62c;hpb=85783316365181491a3e3c0c63659972477cebba diff --git a/src/moof/stlplus/hash.hpp b/src/stlplus/containers/hash.hpp old mode 100755 new mode 100644 similarity index 92% rename from src/moof/stlplus/hash.hpp rename to src/stlplus/containers/hash.hpp index 05d3b7d..1962481 --- a/src/moof/stlplus/hash.hpp +++ b/src/stlplus/containers/hash.hpp @@ -14,6 +14,7 @@ #include "exceptions.hpp" #include "safe_iterator.hpp" #include +#include namespace stlplus { @@ -151,10 +152,14 @@ namespace stlplus iterator insert(const K& key); // remove a key/data pair from the hash table - bool erase(const K& key); + // as in map, this returns the number of elements erased + size_type erase(const K& key); + // remove an element from the hash table using an iterator + // as in map, returns an iterator to the next element + iterator erase(iterator it); // remove all elements from the hash table void erase(void); - // provide the std::map equivalent clear function + // map equivalent of above void clear(void); // find a key and return an iterator to it @@ -176,6 +181,10 @@ namespace stlplus const_iterator end(void) const; iterator end(void); + // diagnostic report shows the number of items in each bin so can be used + // to diagnose effectiveness of hash functions + void debug_report(std::ostream&) const; + // internals private: friend class hash_element;