The QtSoapArrayIterator class provides an iterator for traversing the items in a QtSoapArray. More...
#include <QtSoapArrayIterator>
QtSoapArrayIterator ( QtSoapArray & array ) | |
QtSoapArrayIterator ( const QtSoapArrayIterator & copy ) | |
~QtSoapArrayIterator () | |
bool | atEnd () const |
const QtSoapType * | current () const |
QtSoapType * | data () |
void | pos ( int * pos0, int * pos1 = 0, int * pos2 = 0, int * pos3 = 0, int * pos4 = 0 ) const |
int | pos () const |
bool | operator!= ( const QtSoapArrayIterator & j ) const |
void | operator++ () |
QtSoapArrayIterator & | operator= ( const QtSoapArrayIterator & copy ) |
bool | operator== ( const QtSoapArrayIterator & j ) const |
The QtSoapArrayIterator class provides an iterator for traversing the items in a QtSoapArray.
The items are traversed in ascending order of index position, depth first.
// Construct a 2x2 array of Strings. QtSoapArray array("Array of strings", String, 2, 2); array.insert(0, 0, new QtSoapSimpleType(Q4SoapQName("top left"), "top left"); array.insert(0, 1, new QtSoapSimpleType(Q4SoapQName("top right"), "top right"); array.insert(1, 0, new QtSoapSimpleType(Q4SoapQName("bottom left"), "bottom left"); array.insert(1, 1, new QtSoapSimpleType(Q4SoapQName("bottom right"), "bottom right"); // Traverse all items. QtSoapArrayIterator it(array); while (!it.current()) { // Find the position of the current element. int pos1, pos2; it.pos(&pos1, &pos2); qDebug() << "Position (" << pos1 << ", " << pos2 << ") is " << "the " << it.current()->toString() << " coordinate of the grid." << endl; ++it; }
Constructs a QtSoapArrayIterator on array, initializing the iterator to point to the first element.
Constructs a QtSoapArrayIterator that is a copy of copy.
Destructs the QtSoapArrayIterator.
Returns false if this iterator points to an item in the array, otherwise true.
Returns a reference to the item that the iterator is currently pointing to.
Returns a reference to the item that the iterator is currently pointing to.
Populates the arguments pos0, pos1, pos2, pos3 and pos4 with the coordinate of the current position of the iterator. For a one dimensional array, only pos0 is populated. For a two dimensional array, pos0 and pos1 are populated, and so on.
Any of the arguments that are 0-pointers are ignored.
This is an overloaded function.
Returns the ordinal position of the iterator. Works for arrays of any dimension, but is only useful for one dimensional arrays.
Returns true if this Iterator's position is not equal to the position of j; otherwise returns false.
Moves the iterator position to the next item in the array.
Assignment operator of QtSoapArrayIterator. Makes this iterator a copy of copy.
Returns true if this Iterator's position is equal to the position of j; otherwise returns false.