\class NodeIterator nodeiterator.h Soprano/NodeIterator
An iterator that provides a stream of Nodes.
The most common use of %NodeIterator is through Model.listContexts().
Many backends do lock the underlying Model during iteration. Thus,
it is always a good idea to cache the results if they are to be used
to modify the model to prevent a deadlock:
Soprano.NodeIterator it = model->listContexts();
QList allNodes = it.allElements();
Q_FOREACH( Soprano.Node n, allNodes ) {
modifyTheModel( model, n );
}
For further details on %Soprano iterators see Iterator.
Be aware that iterators in Soprano are shared objects which means
that copies of one iterator object work on the same data.
Author Sebastian Trueg
|