X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9cc56d1fc0b8eec41fbe2b961965e67c598d9406..36a0190ebd5bd9a7302f60f6dcd608b80574e21c:/interface/wx/hashmap.h diff --git a/interface/wx/hashmap.h b/interface/wx/hashmap.h index 6a61c80520..d0bf672e29 100644 --- a/interface/wx/hashmap.h +++ b/interface/wx/hashmap.h @@ -2,8 +2,7 @@ // Name: hashmap.h // Purpose: interface of wxHashMap // Author: wxWidgets team -// RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /** @@ -11,8 +10,8 @@ This is a simple, type-safe, and reasonably efficient hash map class, whose interface is a subset of the interface of STL containers. - In particular, the interface is modeled after std::map, and the various, - non-standard, std::hash_map. + In particular, the interface is modelled after std::map, and the various, + non-standard, std::hash_map (http://www.cppreference.com/wiki/stl/map/start). Example: @code @@ -73,11 +72,11 @@ @endcode The HASH_T and KEY_EQ_T are the types used for the hashing function and key comparison. wxWidgets provides three predefined hashing functions: - wxIntegerHash for integer types ( int, long, short, and their unsigned counterparts ), - wxStringHash for strings ( wxString, wxChar*, char* ), and wxPointerHash for + @c wxIntegerHash for integer types ( int, long, short, and their unsigned counterparts ), + @c wxStringHash for strings ( wxString, wxChar*, char* ), and @c wxPointerHash for any kind of pointer. - Similarly three equality predicates: wxIntegerEqual, wxStringEqual, - wxPointerEqual are provided. + Similarly three equality predicates: @c wxIntegerEqual, @c wxStringEqual, + @c wxPointerEqual are provided. Using this you could declare a hash map mapping int values to wxString like this: @code @@ -151,6 +150,13 @@ it + 3, it1 - it2. + @section hashmap_predef Predefined hashmap types + + wxWidgets defines the following hashmap types: + - wxLongToLongHashMap (uses long both for keys and values) + - wxStringToStringHashMap (uses wxString both for keys and values) + + @library{wxbase} @category{containers} */ @@ -221,7 +227,8 @@ public: /** If an element with the given key is present, the functions returns an iterator pointing at that element, otherwise an invalid iterator is - returned; i.e. + returned. + @code hashmap.find( non_existent_key ) == hashmap.end() @endcode