qx::QxCollectionIterator : Java-style iterator to iterate over a qx::QxCollection<Key, Value> container
More...
#include <QxCollectionIterator.h>
|
| QxCollectionIterator (const QxCollection< Key, Value > &col) |
| Construct an iterator for traversing the collection. The iterator is set to be at the front of the list (before the first item)
|
|
| ~QxCollectionIterator () |
| Destroy the iterator.
|
|
const Key & | key () const |
| Return the 'key' at current position.
|
|
const Value & | value () const |
| Return the 'value' at current position.
|
|
void | toFirst () |
| Move the iterator to the front of the container (before the first item)
|
|
void | toLast () |
| Move the iterator to the back of the container (after the last item)
|
|
bool | next () |
| Advance the iterator by one position. Return 'true' if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise return 'false'.
|
|
bool | previous () |
| Move the iterator back by one position. Return 'true' if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise return 'false'.
|
|
template<typename Key, typename Value>
class qx::QxCollectionIterator< Key, Value >
qx::QxCollectionIterator : Java-style iterator to iterate over a qx::QxCollection<Key, Value> container
Quick sample using qx::QxCollectionIterator Java-style iterator :
while (itr.next())
{
QString code = itr.key();
qDebug() << qPrintable(itr.value()->name) << " " << qPrintable(itr.value()->desc);
}
qx::QxCollectionIterator : Java-style iterator to iterate over a qx::QxCollection<Key,...
Definition at line 66 of file QxCollectionIterator.h.
◆ QxCollectionIterator() [1/2]
template<typename Key , typename Value >
Construct an iterator for traversing the collection. The iterator is set to be at the front of the list (before the first item)
◆ ~QxCollectionIterator()
template<typename Key , typename Value >
◆ QxCollectionIterator() [2/2]
template<typename Key , typename Value >
◆ key()
template<typename Key , typename Value >
Return the 'key' at current position.
◆ next()
template<typename Key , typename Value >
Advance the iterator by one position. Return 'true' if there is at least one item ahead of the iterator, i.e. the iterator is not at the back of the container; otherwise return 'false'.
◆ operator=()
template<typename Key , typename Value >
◆ previous()
template<typename Key , typename Value >
Move the iterator back by one position. Return 'true' if there is at least one item behind the iterator, i.e. the iterator is not at the front of the container; otherwise return 'false'.
◆ toFirst()
template<typename Key , typename Value >
Move the iterator to the front of the container (before the first item)
◆ toLast()
template<typename Key , typename Value >
Move the iterator to the back of the container (after the last item)
◆ value()
template<typename Key , typename Value >
Return the 'value' at current position.
◆ m_lCurrIndex
template<typename Key , typename Value >
◆ m_pCollection
template<typename Key , typename Value >
The documentation for this class was generated from the following file: