X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a660d684eda27638bca0384b2058911a31c8e845..50c538600e7586c256fe0145ac8054f045be6fbb:/docs/latex/wx/hash.tex?ds=sidebyside diff --git a/docs/latex/wx/hash.tex b/docs/latex/wx/hash.tex index 5cb1232974..37cd59f4d7 100644 --- a/docs/latex/wx/hash.tex +++ b/docs/latex/wx/hash.tex @@ -1,6 +1,9 @@ \section{\class{wxHashTable}}\label{wxhashtable} -This class provides hash table functionality for wxWindows, and for an +{\bf Please note} that this class is retained for backward compatibility +reasons; you should use \helpref{wxHashMap}{wxhashmap}. + +This class provides hash table functionality for wxWidgets, and for an application if it wishes. Data can be hashed on an integer or string key. @@ -8,12 +11,16 @@ key. \helpref{wxObject}{wxobject} +\wxheading{Include files} + + + \wxheading{Example} Below is an example of using a hash table. \begin{verbatim} - wxHashTable table(KEY_STRING); + wxHashTable table(wxKEY_STRING); wxPoint *point = new wxPoint(100, 200); table.Put("point 1", point); @@ -79,11 +86,19 @@ Clears the hash table of all nodes (but as usual, doesn't delete user data). Deletes entry in hash table and returns the user's data (if found). +\membersection{wxHashTable::DeleteContents} + +\func{void}{DeleteContents}{\param{bool}{ flag}} + +If set to true data stored in hash table will be deleted when hash table object +is destroyed. + + \membersection{wxHashTable::Get} \func{wxObject *}{Get}{\param{long}{ key}} -\func{wxObject *}{Get}{\param{const wxString\& }{ key}} +\func{wxObject *}{Get}{\param{const char*}{ key}} Gets data from the hash table, using an integer or string key (depending on which has table constructor was used). @@ -97,22 +112,28 @@ explicitly (for instance when combining two data values to form a key). \membersection{wxHashTable::Next} -\func{wxNode *}{Next}{\void} +\func{wxHashTable::Node *}{Next}{\void} If the application wishes to iterate through all the data in the hash table, it can call {\it BeginFind} and then loop on {\it Next}. This function -returns a {\bf wxNode} pointer (or NULL if there are no more nodes). See the -description for \helpref{wxNode}{wxnode}. The user will probably only wish to use the -{\bf wxNode::Data} function to retrieve the data; the node may also be deleted. +returns a {\bf wxHashTable::Node} pointer (or NULL if there are no more nodes). +The return value is functionally equivalent to \textbf{wxNode} but might not be +implemented as a \textbf{wxNode}. The user will probably only wish to use the +\textbf{GetData} method to retrieve the data; the node may also be deleted. \membersection{wxHashTable::Put} \func{void}{Put}{\param{long}{ key}, \param{wxObject *}{object}} -\func{void}{Put}{\param{const wxString\& }{ key}, \param{wxObject *}{object}} +\func{void}{Put}{\param{const char*}{ key}, \param{wxObject *}{object}} Inserts data into the hash table, using an integer or string key (depending on which has table constructor was used). The key string is copied and stored by the hash table implementation. +\membersection{wxHashTable::GetCount} + +\constfunc{size\_t}{GetCount}{\void} + +Returns the number of elements in the hash table.