Public Types | |
typedef const iterator | const_iterator |
Public Member Functions | |
NMap (void) | |
Constructs a NMap object. | |
~NMap (void) | |
Destroys a NMap object. | |
bool | contains (const K &keyname) const |
Returns whether there is an item. | |
bool | contains (const K &keyname, const V &val) const |
Returns whether there is an item. | |
nuint64 | size (void) const |
Gets the current number of itens in the map. | |
nuint64 | count (void) const |
Gets the current number of itens in the map. | |
nuint64 | count (const K &keyname) const |
Gets the count of itens in the list that are equal to a given keyname. | |
iterator | begin (void) |
Returns an iterator pointing to the first item in the map. | |
const_iterator | constBegin (void) const |
Returns a const_iterator pointing to the first item in the map. | |
iterator | end (void) |
Returns an iterator pointing to the last item in the map. | |
const_iterator | constEnd (void) const |
Returns a const_iterator pointing to the last item in the map. | |
bool | erase (iterator pos) |
Removes the item defined by key from the map. If it is not found it will be silently ignored. | |
iterator | find (const K &keyname) |
Finds a node containing key. | |
iterator | find (const K &keyname, const V &val) |
Finds a node containing key. | |
const_iterator | constFind (const K &keyname) const |
Finds a node containing key. | |
const_iterator | constFind (const K &keyname, const V &val) const |
Finds a node containing key. | |
iterator | insert (const K &keyname, const V &val) |
Inserts the data defined by key in the list and val. | |
bool | isEmpty (void) const |
Checks whether the map is empty. | |
const K | key (const V val) const |
Gets the first key containing a given value. | |
NList< K > | keys (void) const |
Gets a list of the keys in the map. | |
NList< K > | keys (const V val) |
Gets a list of the keys in the map that contains a given value. | |
nuint64 | remove (const K &keyname) |
Removes the itens containing a given key name. | |
V | take (const K &keyname) |
Removes the a item with a given key value in the map and returns it. | |
V | value (const K &keyname) const |
Gets the value of a given key. | |
V | value (const K &keyname, const V &defaultValue) const |
Gets the value of a given key. | |
NList< V > | values (void) const |
Gets a list of values in the map. | |
NList< V > | values (const K &keyname) const |
Gets a list of values in the map with a given keyname. | |
void | clear (void) |
Clears the map. | |
void | copy (const NMap< K, V > &rhs) |
Copies another map. | |
NMap< K, V > & | operator= (const NMap< K, V > &rhs) |
Copies another map. | |
bool | operator!= (const NMap< K, V > &rhs) const |
Tests whether a map differs from another. | |
bool | operator== (const NMap< K, V > &rhs) const |
Tests whether a map equals another. | |
V | operator[] (const K &keyname) |
Gets the value of a given key. | |
const V & | operator[] (const K &keyname) const |
Gets the value of a given key. | |
Classes | |
class | iterator |
NMap::iterator class provides an iterator to navigate through the map object. More... |
Definition at line 36 of file nmap.hpp.
bool contains | ( | const K & | keyname | ) | const [inline] |
Returns whether there is an item.
keyname | The keyname of the item to search |
Definition at line 721 of file nmap.hpp.
References constEnd(), and constFind().
Referenced by NSqlRecord::getData(), operator!=(), and operator==().
bool contains | ( | const K & | keyname, | |
const V & | val | |||
) | const [inline] |
Returns whether there is an item.
keyname | The keyname of the item to search | |
val | The value of the item to search |
Definition at line 731 of file nmap.hpp.
References constEnd(), and constFind().
nuint64 size | ( | void | ) | const [inline] |
Gets the current number of itens in the map.
Definition at line 304 of file nmap.hpp.
References NSkipList::count().
nuint64 count | ( | void | ) | const [inline] |
Gets the current number of itens in the map.
Definition at line 310 of file nmap.hpp.
References NSkipList::count().
nuint64 count | ( | const K & | keyname | ) | const [inline] |
Gets the count of itens in the list that are equal to a given keyname.
keyname | The name of the key |
Definition at line 316 of file nmap.hpp.
References NSkipList::begin(), and NSkipList::end().
Returns an iterator pointing to the first item in the map.
Definition at line 473 of file nmap.hpp.
References NSkipList::begin().
Referenced by copy(), operator!=(), operator==(), NEvent1::~NEvent1(), and NSignal1::~NSignal1().
NMAPITERATOR_CONST constBegin | ( | void | ) | const [inline] |
Returns a const_iterator pointing to the first item in the map.
Definition at line 479 of file nmap.hpp.
References NSkipList::constBegin().
Referenced by NEvent1::notify().
Returns an iterator pointing to the last item in the map.
Definition at line 487 of file nmap.hpp.
References NSkipList::end().
Referenced by copy(), NEvent1::detach(), NEvent1::isAttached(), operator!=(), operator==(), NEvent1::~NEvent1(), and NSignal1::~NSignal1().
NMAPITERATOR_CONST constEnd | ( | void | ) | const [inline] |
Returns a const_iterator pointing to the last item in the map.
Definition at line 493 of file nmap.hpp.
References NSkipList::constEnd().
Referenced by contains(), and NEvent1::notify().
bool erase | ( | iterator | pos | ) | [inline] |
Removes the item defined by key from the map. If it is not found it will be silently ignored.
pos | An iterator pointing to the item to be removed |
Definition at line 499 of file nmap.hpp.
References NSkipList::erase().
Referenced by NEvent1::detach().
Finds a node containing key.
keyname | The key to be searched |
Definition at line 505 of file nmap.hpp.
References NSkipList::begin(), and NSkipList::end().
Referenced by NEvent1::detach(), and NEvent1::isAttached().
Finds a node containing key.
keyname | The key to be searched | |
val | The value of the item to be searched |
Definition at line 533 of file nmap.hpp.
References NSkipList::begin(), and NSkipList::end().
NMAPITERATOR_CONST constFind | ( | const K & | keyname | ) | const [inline] |
Finds a node containing key.
keyname | The key to be searched |
Definition at line 518 of file nmap.hpp.
References NSkipList::constBegin(), and NSkipList::constEnd().
Referenced by contains().
NMAPITERATOR_CONST constFind | ( | const K & | keyname, | |
const V & | val | |||
) | const [inline] |
Finds a node containing key.
keyname | The key to be searched | |
val | The value of the item to be searched |
Definition at line 545 of file nmap.hpp.
References NSkipList::constBegin(), and NSkipList::constEnd().
Inserts the data defined by key in the list and val.
keyname | The key of the item to be added to the map | |
val | The value of the item to be added to the map |
Definition at line 559 of file nmap.hpp.
References NSkipList::insert(), NMapItem::key, and NMapItem::value.
Referenced by NEvent1::attach(), NSignal1::connect(), and copy().
bool isEmpty | ( | void | ) | const [inline] |
Checks whether the map is empty.
Definition at line 569 of file nmap.hpp.
References NSkipList::isEmpty().
const K key | ( | const V | val | ) | const [inline] |
Gets the first key containing a given value.
val | The value of the item |
Definition at line 575 of file nmap.hpp.
References NSkipList::begin(), and NSkipList::end().
NList< K > keys | ( | void | ) | const [inline] |
Gets a list of the keys in the map.
Definition at line 590 of file nmap.hpp.
References NList::append(), NSkipList::constBegin(), and NSkipList::constEnd().
NList< K > keys | ( | const V | val | ) | [inline] |
Gets a list of the keys in the map that contains a given value.
Definition at line 605 of file nmap.hpp.
References NList::append(), NSkipList::begin(), and NSkipList::end().
nuint64 remove | ( | const K & | keyname | ) | [inline] |
Removes the itens containing a given key name.
keyname | The value of the key |
Definition at line 620 of file nmap.hpp.
References NSkipList::begin(), and NSkipList::end().
V take | ( | const K & | keyname | ) | [inline] |
Removes the a item with a given key value in the map and returns it.
Definition at line 635 of file nmap.hpp.
References NSkipList::begin(), and NSkipList::end().
V value | ( | const K & | keyname | ) | const [inline] |
Gets the value of a given key.
keyname | The value of the key |
Definition at line 648 of file nmap.hpp.
References NSkipList::constBegin(), and NSkipList::constEnd().
Referenced by NSqlRecord::getData(), and operator[]().
V value | ( | const K & | keyname, | |
const V & | defaultValue | |||
) | const [inline] |
Gets the value of a given key.
keyname | The value of the key | |
defaultValue | The default value for the return object, if not found |
Definition at line 665 of file nmap.hpp.
References NSkipList::constBegin(), and NSkipList::constEnd().
NList< V > values | ( | void | ) | const [inline] |
Gets a list of values in the map.
Definition at line 682 of file nmap.hpp.
References NList::append(), NSkipList::constBegin(), and NSkipList::constEnd().
NList< V > values | ( | const K & | keyname | ) | const [inline] |
Gets a list of values in the map with a given keyname.
keyname | The value of the key |
Definition at line 695 of file nmap.hpp.
References NList::append(), NSkipList::constBegin(), and NSkipList::constEnd().
void copy | ( | const NMap< K, V > & | rhs | ) | [inline] |
Copies another map.
rhs | The map to be copied |
Definition at line 711 of file nmap.hpp.
References begin(), NSkipList::clear(), end(), and insert().
Referenced by operator=().
bool operator!= | ( | const NMap< K, V > & | rhs | ) | const [inline] |
Tests whether a map differs from another.
rhs | The map to be tested |
Definition at line 750 of file nmap.hpp.
References begin(), contains(), and end().
bool operator== | ( | const NMap< K, V > & | rhs | ) | const [inline] |
Tests whether a map equals another.
rhs | The map to be tested |
Definition at line 762 of file nmap.hpp.
References begin(), contains(), and end().
V operator[] | ( | const K & | keyname | ) | [inline] |
const V & operator[] | ( | const K & | keyname | ) | const [inline] |