Rogue Wave Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Member Functions
IlsInvertedRelationList< TargetType, OriginType >::Iterator Class Reference

Non const iterator. More...

#include <ilserver/model.h>

Inherits IlsViewedRelIterator.

Public Member Functions

 Iterator (Myself &r)
 Creates an iterator for the list supplied as its argument.
 
 Iterator (const Iterator &rhs)
 This copy constructor creates an iterator with the same characteristics as the one supplied as its argument. More...
 
virtual IlsBoolean eol () const
 Returns IlsTrue if the end of the list has been reached.
 
IteratorgotoEnd ()
 Moves the iterator to the end of the list.
 
 operator IlsBoolean () const
 This conversion operator indicates whether the iterator has reached the end of the list. It returns IlsFalse if the list is empty, or if at least one unsuccessful extraction has been performed.
 
IlsBoolean operator!= (const Iterator &rhs) const
 Indicates whether the iterator is not at the same position as the one supplied as its argument.
 
OriginType * operator* () const
 Returns the next item to be read. The iterator remains at the same position.
 
Position operator+ (int i) const
 Moves the iterator forward in the list according to the value supplied as its argument. More...
 
Iteratoroperator++ ()
 This increment operator moves the iterator to the next item in the list. More...
 
Iteratoroperator++ (int)
 This operator is identical to operator++() except that it uses a prefix notation. More...
 
Iteratoroperator+= (int i)
 Moves the iterator forward according to the value supplied as its argument. More...
 
Position operator- (int i) const
 Moves the iterator backward in the list according to the value supplied as its argument. More...
 
Iteratoroperator-- ()
 Moves the iterator to the previous item in the list. More...
 
Iteratoroperator-- (int)
 This operator is identical to operator--() except that it uses a prefix notation. More...
 
Iteratoroperator-= (int i)
 Moves the iterator backward according to the value supplied as its argument. More...
 
Iteratoroperator<< (OriginType *p)
 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. More...
 
Iteratoroperator= (const Position &rhs)
 Assigns the position provided as its argument to another position and returns the position supplied.
 
Iteratoroperator= (const Iterator &rhs)
 Moves the iterator to the same position as the one supplied as its argument.
 
IlsBoolean operator== (const Iterator &rhs) const
 Indicates whether the iterator is at the same position as the one supplied as its argument.
 
Iteratoroperator>> (OriginType *&p)
 Sequentially reads the items in the list. More...
 
OriginType * operator[] (int i) const
 Returns the i-th list element.
 
Iteratorreset ()
 Resets the iterator so that it points again to the first item of the list.
 
Iteratorseekp (const Position &position)
 Moves the iterator to the specified position.
 
Iteratorshrink ()
 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. More...
 
IteratorshrinkBefore ()
 Removes the last item read from the list. More...
 
Position tellp () const
 Returns the position of the iterator.
 

Detailed Description

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.

Constructor & Destructor Documentation

§ Iterator()

template<class TargetType, class OriginType>
IlsInvertedRelationList< TargetType, OriginType >::Iterator::Iterator ( const Iterator rhs)

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.

Member Function Documentation

§ operator+()

template<class TargetType, class OriginType>
Position IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator+ ( int  i) const

Moves the iterator forward in the list according to the value supplied as its argument.

Exceptions
IlsEndOfListIf the iterator is moved past the last list item.

§ operator++() [1/2]

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator++ ( )

This increment operator moves the iterator to the next item in the list.

Exceptions
IlsEndOfListIf the iterator is moved past the last list item.

§ operator++() [2/2]

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator++ ( int  )

This operator is identical to operator++() except that it uses a prefix notation.

Exceptions
IlsEndOfListIf the iterator is moved past the last list item.

§ operator+=()

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator+= ( int  i)

Moves the iterator forward according to the value supplied as its argument.

Exceptions
IlsEndOfListIf the value provided moves the iterator past the last list item.

§ operator-()

template<class TargetType, class OriginType>
Position IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator- ( int  i) const

Moves the iterator backward in the list according to the value supplied as its argument.

Exceptions
IlsBeginningOfListIf the iterator is moved past the first list item.

§ operator--() [1/2]

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator-- ( )

Moves the iterator to the previous item in the list.

Exceptions
IlsBeginningOfListIf the iterator is moved past the first list item.

§ operator--() [2/2]

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator-- ( int  )

This operator is identical to operator--() except that it uses a prefix notation.

Exceptions
IlsBeginningOfListIf the iterator is moved past the first list item.

§ operator-=()

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator-= ( int  i)

Moves the iterator backward according to the value supplied as its argument.

Exceptions
IlsBeginningOfListIf the value provided moves the iterator past the first list item.

§ operator<<()

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator<< ( OriginType *  p)

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
IlsMaxCardViolatedIf attempting to add an item to the list when the maximum cardinality has been reached.

§ operator>>()

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::operator>> ( OriginType *&  p)

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>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::shrink ( )

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 iw that performs write operations and an iterator ir that performs read operations. If ir and iw point to the same item in the list and if iw executes the function shrink(), ir may behave unexpectedly. Likewise, if iw points to a given item in the list and ir points to the next item, ir may behave unexpectedly if iw executes the function shrink().
Exceptions
IlsMinCardViolatedIf this function is called when the minimum cardinality of the list has been reached.
IlsEndOfListIf it is called when the iterator points to the last item of the list.

§ shrinkBefore()

template<class TargetType, class OriginType>
Iterator& IlsInvertedRelationList< TargetType, OriginType >::Iterator::shrinkBefore ( )

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.

© Copyright 2018, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.