Modeling Services > Relations > Set-relations > Set-relation Iterators
 
Set-relation Iterators
Rogue Wave® Server provides an Iterator type that lets you browse through a set-relation.
Since a set-relation is an associative container—non-ordered— objects will not be read in a specific order. This type is a nested type of both IlsOwnsSet and IlsUsesSet. For more information on how this iterator works, see IlsOwnsSet::Iterator and IlsUsesSet::Iterator in the Rogue Wave Server Reference Manual.
To initialize an iterator, you just have to provide a reference to the set to the constructor of the iterator:
IlsOwnsSet<Route,Flight>::Iterator i(route.flights);
The type Iterator includes an insertion operator that returns the iterator. It also contains a conversion operator to IlsBoolean that returns IlsTrue as long as the read operation is successful:
{
   IlsOwnsSet<Route,Flight>::Iterator i(route.flights);
   FlightP flight;
   while (i>>flight){
     // do something
   }
}
Set-relations iterators are read-only. You cannot update a set-relation using an iterator.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.