Non const iterator.
More...
#include <ilserver/model.h>
Inherits IlsViewedRelIterator.
template<class TargetType, class OriginType>
class IlsInvertedRelationList< TargetType, OriginType >::Iterator
Non const iterator.
Library: server
- Related Pattern
- Iterator
- See also
IlsException
, IlsInvertedRelationList
, IlsInvertedRelationList::ConstIterator
, IlsInvertedRelationList::Position
.
◆ Iterator()
template<class TargetType , class OriginType >
\short This copy constructor creates an iterator with the same
characteristics as the one supplied as its argument.
This iterator points to the same item in the list as the iterator supplied as its argument.
◆ operator*()
template<class TargetType , class OriginType >
\short Returns the next item to be read. The iterator
remains at the same position.
◆ operator+()
template<class TargetType , class OriginType >
Moves the iterator forward in the list according to the value supplied as its argument.
- Exceptions
-
IlsEndOfList | If the iterator is moved past the last list item. |
◆ operator++() [1/2]
template<class TargetType , class OriginType >
This increment operator moves the iterator to the next item in the list.
- Exceptions
-
IlsEndOfList | If the iterator is moved past the last list item. |
◆ operator++() [2/2]
template<class TargetType , class OriginType >
This operator is identical to operator++()
except that it uses a prefix notation.
- Exceptions
-
IlsEndOfList | If the iterator is moved past the last list item. |
◆ operator+=()
template<class TargetType , class OriginType >
Moves the iterator forward according to the value supplied as its argument.
- Exceptions
-
IlsEndOfList | If the value provided moves the iterator past the last list item. |
◆ operator-()
template<class TargetType , class OriginType >
Moves the iterator backward in the list according to the value supplied as its argument.
- Exceptions
-
◆ operator--() [1/2]
template<class TargetType , class OriginType >
Moves the iterator to the previous item in the list.
- Exceptions
-
◆ operator--() [2/2]
template<class TargetType , class OriginType >
This operator is identical to operator--()
except that it uses a prefix notation.
\throw IlsBeginningOfList If the iterator is moved past the first
list item.
◆ operator-=()
template<class TargetType , class OriginType >
Moves the iterator backward according to the value supplied as its argument.
- Exceptions
-
◆ operator<<()
template<class TargetType , class OriginType >
\short Adds an item to the list and puts it after the
last item read by the iterator or at the beginning of the list if the iterator has not yet been used.
- Warning
- If several iterators have been declared for the same list, be careful when you use one of these iterators to add an item to the list. Let us suppose that
iw
is an iterator that performs write operations and ir
is an iterator that performs read operations. If ir
and iw
point to the same item in the list and if iw
is used to add an item to this list, ir
may behave unexpectedly.
- Exceptions
-
IlsMaxCardViolated | If attempting to add an item to the list when the maximum cardinality has been reached. |
◆ operator=()
template<class TargetType , class OriginType >
\short Moves the iterator to the same position as the
one supplied as its argument.
◆ operator>>()
template<class TargetType , class OriginType >
\short Sequentially reads the items in the list.
When the iterator is used for the first time, the item read is the one at the beginning of the list.
If the iterator has reached the last item in the list, and if the list is not empty, no value is assigned to the argument of the operator during the next read operation. The conversion operator to IlsBoolean
returns IlsFalse
(see IlsBoolean()).
If an iterator is built for an empty list, the conversion operator of the iterator returns IlsFalse
.
◆ shrink()
template<class TargetType , class OriginType >
\short Removes the item following the last
element read from the list, or, if the list has not been read yet,
it removes the first item in the list.
\warning If several iterators, or positions, have been declared
for the same list, be careful when you use the shrink
function with one of these iterators or positions.
For example, suppose we have an iterator \c iw that
performs write operations and an iterator \c ir that
performs read operations. If \c ir and \c iw point to
the same item in the list and if \c iw executes the
function `shrink()`, \c ir may behave unexpectedly.
Likewise, if \c iw points to a given item in the list
and \c ir points to the next item, \c ir may behave
unexpectedly if \c iw executes the function `shrink()`.
\throw IlsMinCardViolated If this function is called when the
minimum cardinality of the list has been reached.
- Exceptions
-
IlsEndOfList | If it is called when the iterator points to the last item of the list. |
◆ shrinkBefore()
template<class TargetType , class OriginType >
\short Removes the last item read from the list.
Restrictions of the same kind as those mentioned for shrink()
apply to shrinkBefore()
.
\throw IlsMinCardViolated If this function is called when the
minimal cardinality of the list has been reached.
\throw IlsBeginningOfList If it is called when the iterator points
to the first item of the list.