]>
git.saurik.com Git - wxWidgets.git/blob - interface/hash.h
7def270604f28910c156101758f834bb1d4235ca
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: documentation for wxHashTable class
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 @b Please note that this class is retained for backward compatibility
14 reasons; you should use wxHashMap.
16 This class provides hash table functionality for wxWidgets, and for an
17 application if it wishes. Data can be hashed on an integer or string
26 class wxHashTable
: public wxObject
30 Constructor. @a key_type is one of wxKEY_INTEGER, or wxKEY_STRING,
31 and indicates what sort of keying is required. @a size is optional.
33 wxHashTable(unsigned int key_type
, int size
= 1000);
36 Destroys the hash table.
41 The counterpart of @e Next. If the application wishes to iterate
42 through all the data in the hash table, it can call @e BeginFind and
48 Clears the hash table of all nodes (but as usual, doesn't delete user data).
54 Deletes entry in hash table and returns the user's data (if found).
56 wxObject
* Delete(long key
);
57 wxObject
* Delete(const wxString
& key
);
61 If set to @true data stored in hash table will be deleted when hash table object
64 void DeleteContents(bool flag
);
68 Gets data from the hash table, using an integer or string key (depending on
70 has table constructor was used).
72 wxObject
* Get(long key
);
73 wxObject
* Get(const char* key
);
77 Returns the number of elements in the hash table.
82 Makes an integer key out of a string. An application may wish to make a key
83 explicitly (for instance when combining two data values to form a key).
85 long MakeKey(const wxString
& string
);
88 If the application wishes to iterate through all the data in the hash
89 table, it can call @e BeginFind and then loop on @e Next. This function
90 returns a @b Node() pointer (or @NULL if there are no more nodes).
91 The return value is functionally equivalent to @b wxNode but might not be
92 implemented as a @b wxNode. The user will probably only wish to use the
93 @b GetData method to retrieve the data; the node may also be deleted.
95 wxHashTable::Node
* Next();
99 Inserts data into the hash table, using an integer or string key (depending on
101 has table constructor was used). The key string is copied and stored by the hash
102 table implementation.
104 void Put(long key
, wxObject
* object
);
105 void Put(const char* key
, wxObject
* object
);