![]() |
VR-Forces 4.0.4 Class Documentation
|
This class will implement a data dictionary iterator that allows for data dictionaries to be chained within a single iterator. More...

Public Member Functions | |
| DtDictIterator (QHash< Key, Type > &d) | |
| ~DtDictIterator () | |
| unsigned int | count () |
| Returns the number of items in the current dictionary. | |
| bool | isEmpty () const |
| Returns true if the current dictionary is empty. | |
| Type | toFirst () |
| Moves the iterator to the first item of the current list. | |
| bool | remove (const Key &k) |
| Will remove the string (if there) from the current dictionary in the iterator. | |
| Type | operator++ () |
| Moves the iterator to the next object in the list. | |
| Type | operator+= (uint j) |
| Moves the iterator down the list the specified number of spaces. | |
| void | operator= (const typename QHash< Key, Type >::iterator &iter) |
| Type | current () |
| Type | reset (int toPosition=0, bool findFirstValid=true) |
| Resets the iterator to the first item in the supplied list index list. | |
| void | addDataDict (QHash< Key, Type > *dict) |
| Adds a data dictionary to our current dictionary list. | |
| Type | find (const Key &key) |
| Finds a particular key that could be in any of the attached dictionaries in this iterator. | |
| Type | nextList () |
| Moves to the next list in the chain and returns the first element of that list. | |
Protected Attributes | |
| QHash< Key, Type > * | myCurrentDict |
| QList< QHash< Key, Type > * > | myList |
| unsigned int | myPosition |
This class will implement a data dictionary iterator that allows for data dictionaries to be chained within a single iterator.
This allows for a single iterator to encompass the global and local data dictionaries
| DtDictIterator< Key, Type >::DtDictIterator | ( | QHash< Key, Type > & | d | ) | [inline] |
| DtDictIterator< Key, Type >::~DtDictIterator | ( | ) | [inline] |
| unsigned int DtDictIterator< Key, Type >::count | ( | ) | [inline] |
Returns the number of items in the current dictionary.
References DtDictIterator< Key, Type >::myCurrentDict.
| bool DtDictIterator< Key, Type >::isEmpty | ( | ) | const [inline] |
Returns true if the current dictionary is empty.
References DtDictIterator< Key, Type >::myCurrentDict.
| Type DtDictIterator< Key, Type >::toFirst | ( | ) | [inline] |
Moves the iterator to the first item of the current list.
To reset to the beginning of the first, call the reset method
References DtDictIterator< Key, Type >::myList, DtDictIterator< Key, Type >::myPosition, and DtDictIterator< Key, Type >::reset().
Referenced by DtDictIterator< Key, Type >::DtDictIterator(), and DtDictIterator< Key, Type >::nextList().
| bool DtDictIterator< Key, Type >::remove | ( | const Key & | k | ) | [inline] |
Will remove the string (if there) from the current dictionary in the iterator.
References DtDictIterator< Key, Type >::myCurrentDict.
| Type DtDictIterator< Key, Type >::operator++ | ( | ) | [inline] |
Moves the iterator to the next object in the list.
References DtDictIterator< Key, Type >::myCurrentDict, and DtDictIterator< Key, Type >::nextList().
| Type DtDictIterator< Key, Type >::operator+= | ( | uint | j | ) | [inline] |
Moves the iterator down the list the specified number of spaces.
References DtDictIterator< Key, Type >::myList, and DtDictIterator< Key, Type >::myPosition.
| void DtDictIterator< Key, Type >::operator= | ( | const typename QHash< Key, Type >::iterator & | iter | ) | [inline] |
| Type DtDictIterator< Key, Type >::current | ( | ) | [inline] |
References DtDictIterator< Key, Type >::myCurrentDict.
| Type DtDictIterator< Key, Type >::reset | ( | int | toPosition = 0, |
| bool | findFirstValid = true |
||
| ) | [inline] |
Resets the iterator to the first item in the supplied list index list.
References DtDictIterator< Key, Type >::myCurrentDict, DtDictIterator< Key, Type >::myList, and DtDictIterator< Key, Type >::myPosition.
Referenced by DtDictIterator< Key, Type >::toFirst().
| void DtDictIterator< Key, Type >::addDataDict | ( | QHash< Key, Type > * | dict | ) | [inline] |
Adds a data dictionary to our current dictionary list.
References DtDictIterator< Key, Type >::myCurrentDict, and DtDictIterator< Key, Type >::myList.
Referenced by DtDictIterator< Key, Type >::DtDictIterator().
| Type DtDictIterator< Key, Type >::find | ( | const Key & | key | ) | [inline] |
Finds a particular key that could be in any of the attached dictionaries in this iterator.
References DtDictIterator< Key, Type >::myList.
| Type DtDictIterator< Key, Type >::nextList | ( | ) | [inline] |
Moves to the next list in the chain and returns the first element of that list.
If at the end of the lists, returns NULL
References DtDictIterator< Key, Type >::myCurrentDict, DtDictIterator< Key, Type >::myList, DtDictIterator< Key, Type >::myPosition, and DtDictIterator< Key, Type >::toFirst().
Referenced by DtDictIterator< Key, Type >::operator++().
QHash<Key, Type>* DtDictIterator< Key, Type >::myCurrentDict [protected] |
Referenced by DtDictIterator< Key, Type >::addDataDict(), DtDictIterator< Key, Type >::count(), DtDictIterator< Key, Type >::current(), DtDictIterator< Key, Type >::isEmpty(), DtDictIterator< Key, Type >::nextList(), DtDictIterator< Key, Type >::operator++(), DtDictIterator< Key, Type >::remove(), and DtDictIterator< Key, Type >::reset().
QList<QHash<Key, Type>* > DtDictIterator< Key, Type >::myList [protected] |
unsigned int DtDictIterator< Key, Type >::myPosition [protected] |