#include "CTBmap.hxx"
Inheritance diagram for CTBmap:
Public Types | |
typedef CTBmap< K, V, C > | Map |
typedef CTBmapNode< K, V, C > | Node |
typedef CTBmapIterator< K, V, C > | Iterator |
typedef CTBmapBrowser< K, V, C > | Browser |
Public Methods | |
CTBmap () | |
CTBmap (const CTBmap< K, V, C > &rhs) | |
~CTBmap () | |
bool | Insert (const CTBpair< const K, V > &pair) |
bool | Insert (const K &key, const V &value) |
bool | Insert (const K &key) |
CTBmapIterator< K, V, C > | Find (const K &key) |
CTBmapBrowser< K, V, C > | Find (const K &key) const |
CTBmapIterator< K, V, C > | FindLessEqual (const K &key, bool &b_found) |
CTBmapBrowser< K, V, C > | FindLessEqual (const K &key, bool &b_found) const |
CTBmapIterator< K, V, C > | FindGreaterEqual (const K &key, bool &b_found) |
CTBmapBrowser< K, V, C > | FindGreaterEqual (const K &key, bool &b_found) const |
CTBmapIterator< K, V, C > | FindOrCreate (const K &key, bool &b_found) |
bool | Rename (const K &keyold, const K &keynew) |
bool | Rename (const CTBmapIterator< K, V, C > &p, const K &keynew) |
bool | Delete (const K &key) |
bool | Delete (const CTBmapIterator< K, V, C > &p) |
void | Clear () |
CTBmapIterator< K, V, C > | First () |
CTBmapBrowser< K, V, C > | First () const |
CTBmapIterator< K, V, C > | Last () |
CTBmapBrowser< K, V, C > | Last () const |
CTBint | Size () const |
void | Dump (int i_indent=0, ostream &os=cout, const char *p_text=0) const |
V & | operator[] (const K &key) |
CTBmap< K, V, C > & | operator= (const CTBmap< K, V, C > &rhs) |
operator bool () const | |
Private Methods | |
CTBmapNode< K, V, C > * | LocateMatchOrBound (const K &key, int &i_mtype) const |
CTBmapNode< K, V, C > * | LocateMatchOrPrev (const K &key, bool &b_found) const |
CTBmapNode< K, V, C > * | LocateMatchOrNext (const K &key, bool &b_found) const |
void | InsertNode (CTBmapNode< K, V, C > *p_node, CTBmapNode< K, V, C > *p_parent, int i_ctype) |
void | RemoveNode (CTBmapNode< K, V, C > *p_node) |
Definition at line 27 of file CTBmap.hxx.
|
Definition at line 30 of file CTBmap.hxx. |
|
Definition at line 31 of file CTBmap.hxx. Referenced by FindOrCreate(), and Insert().
|
|
Definition at line 32 of file CTBmap.hxx. Referenced by Find(), FindGreaterEqual(), FindLessEqual(), FindOrCreate(), First(), and Last().
|
|
Definition at line 33 of file CTBmap.hxx. Referenced by Find(), FindGreaterEqual(), FindLessEqual(), First(), and Last().
|
|
Default constructor.
Definition at line 18 of file CTBmap.icc. |
|
Copy constructor.
Definition at line 37 of file CTBmap.icc. |
|
Destructor.
The destructor releases the whole map without executing the comparison operator. This is important when maps are released where Definition at line 30 of file CTBmap.icc. |
|
Insert key value pair.
Definition at line 29 of file CTBmap.cxx. |
|
Insert key value pair.
Definition at line 44 of file CTBmap.cxx. |
|
Insert key with default value.
Definition at line 59 of file CTBmap.cxx. |
|
Find entry with key key.
Definition at line 74 of file CTBmap.cxx. Referenced by Rename().
|
|
Find entry with key key.
Definition at line 88 of file CTBmap.cxx. |
|
Find entry with key key, return previous if no match found.
Definition at line 44 of file CTBmap.icc. |
|
Find entry with key key, return previous if no match found.
Definition at line 54 of file CTBmap.icc. |
|
Find entry with key key, return next if no match found.
Definition at line 64 of file CTBmap.icc. |
|
Find entry with key key, return next if no match found.
Definition at line 74 of file CTBmap.icc. |
|
Find entry with key key, create one with default value if none found.
Definition at line 102 of file CTBmap.cxx. Referenced by operator[]().
|
|
Rename key of entry with key keyold to keynew.
Returns Definition at line 126 of file CTBmap.cxx. |
|
Rename key of entry p to keynew.
Returns Definition at line 140 of file CTBmap.cxx. |
|
Delete entry with key key. Returns false if no entry with key key is found. Definition at line 180 of file CTBmap.cxx. |
|
Delete entry Returns false if iterator p is not valid. Definition at line 198 of file CTBmap.cxx. |
|
Delete al entries of the map.
Reimplemented from CTBbtree. Definition at line 211 of file CTBmap.cxx. |
|
Return iterator to first entry.
Definition at line 84 of file CTBmap.icc. |
|
Return browser to first entry.
Reimplemented from CTBbtree. Definition at line 93 of file CTBmap.icc. |
|
Return iterator to last entry.
Definition at line 102 of file CTBmap.icc. |
|
Return browser to first entry.
Reimplemented from CTBbtree. Definition at line 111 of file CTBmap.icc. |
|
Return number of entries (see size).
Reimplemented from CTBbtree. Definition at line 120 of file CTBmap.icc. |
|
Dump.
Reimplemented from CTBbtree. Definition at line 129 of file CTBmap.icc. |
|
Access entry with key key. The value of the entry with the key key is accessed. If there is no such entry, an entry with key key and the default value will be created first. Definition at line 144 of file CTBmap.icc. |
|
Delete all old entries, copy all entries from rhs.
Definition at line 154 of file CTBmap.icc. |
|
Definition at line 164 of file CTBmap.icc. |
|
Locate nearest entry. Returns a pointer to a node with key key or, if none exists, to a node with a key immediately before or after key. The parameter i_mtype is set to 0 in case of a match, -1 if key<node and +1 if key>node. A null pointer is returned if the map is empty. Definition at line 228 of file CTBmap.cxx. Referenced by Delete(), Find(), FindOrCreate(), Insert(), LocateMatchOrNext(), LocateMatchOrPrev(), and Rename().
|
|
Locate entry with key key, return previous if no match found.
Definition at line 269 of file CTBmap.cxx. Referenced by FindLessEqual().
|
|
Locate entry by key, return next if no match found.
Definition at line 287 of file CTBmap.cxx. Referenced by FindGreaterEqual().
|
|
Insert node into map. The node p_node is added as child of node p_parent, either as left child if i_ctype is <0 or as right child if i_ctype is >0. If p_node is 0 and i_ctype is 0 the node is inserted as root node. Definition at line 178 of file CTBmap.icc. Referenced by FindOrCreate(), Insert(), and Rename().
|
|
Remove node from map.
Definition at line 189 of file CTBmap.icc. Referenced by Rename().
|