#include <cmt_map.h>
Public Member Functions | |
cmt_map () | |
Constructor. | |
~cmt_map () | |
Destructor. | |
void | clear () |
clear: erase everything from this map | |
void | add (const K &key, T &t) |
Add an entry. | |
void | add (const K &key, T *t) |
bool | has (const K &key) const |
Finds whether there is a node holding that key. | |
T * | find (const K &key) const |
Finds the value associated with that key. | |
const cmt_node< K, T > * | find_node (const K &key) const |
Finds the node containing the value associated with that key. | |
Private Attributes | |
cmt_node< K, T > * | m_top |
It is implemented by one top cmt_node.
At creation the map is empty.
Definition at line 333 of file cmt_map.h.
|
Constructor.
Definition at line 340 of file cmt_map.h.
00340 : m_top (0) 00341 { 00342 } |
|
Destructor.
Definition at line 347 of file cmt_map.h.
00348 { 00349 clear (); 00350 } |
|
Definition at line 381 of file cmt_map.h.
00382 { 00383 if (m_top == 0) 00384 { 00385 m_top = new cmt_node<K, T> (key, *t); 00386 } 00387 else 00388 { 00389 m_top->add (key, *t); 00390 } 00391 } |
|
Add an entry. Existing entries with the same key will be overridden Definition at line 369 of file cmt_map.h. Referenced by Package::add(), Tag::add(), PatternList::add(), add_request(), CommandHelp::CommandHelp(), Symbol::create(), and Use::get_all_clients().
00370 { 00371 if (m_top == 0) 00372 { 00373 m_top = new cmt_node<K, T> (key, t); 00374 } 00375 else 00376 { 00377 m_top->add (key, t); 00378 } 00379 } |
|
clear: erase everything from this map
Definition at line 355 of file cmt_map.h. Referenced by Package::clear_all(), Tag::clear_all(), Symbol::clear_all(), PatternList::clear_all(), and cmt_map< cmt_string, Package >::~cmt_map().
|
|
Finds the value associated with that key. Returns 0 if not found Definition at line 412 of file cmt_map.h. Referenced by Package::find(), Tag::find(), Symbol::find(), and PatternList::find().
|
|
Finds the node containing the value associated with that key. Returns 0 if not found Definition at line 428 of file cmt_map.h.
|
|
Finds whether there is a node holding that key.
Definition at line 396 of file cmt_map.h. Referenced by add_request(), and Use::get_all_clients().
|
|
|