Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Types | Public Member Functions
IlsListRelationIterator< RelationList > Class Template Reference

List iterator. More...

#include <ilserver/model.h>

Inherits IlsViewedRelIterator.

Public Types

typedef IlsListRelationIterator< RelationList > Myself
 Myself is the type of the instantiated template class.
 

Public Member Functions

 IlsListRelationIterator (const Myself &rhs)
 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.
 
 IlsListRelationIterator (RelationList &r)
 Constructor. Creates an iterator for the list that is supplied as its argument.
 
virtual IlsBoolean eol () const
 Returns IlsTrue if the end of the list has been reached.
 
TargetTypeP getNextQuietly ()
 
MyselfgotoEnd ()
 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!= (Myself &rhs) const
 
CTargetTypePR operator* () const
 
Position operator+ (int i) const
 
Myselfoperator++ ()
 This increment operator moves the iterator to the next item in the list. More...
 
Myselfoperator++ (int)
 
Myselfoperator+= (int i)
 
Position operator- (int i) const
 
Myselfoperator-- ()
 
Myselfoperator-- (int)
 This operator is identical to operator--() except that it uses a prefix notation. More...
 
Myselfoperator-= (int i)
 
Myselfoperator<< (CTargetTypePR p)
 
Myselfoperator= (const Myself &rhs)
 
Myselfoperator= (const Position &rhs)
 Moves the iterator to the specified position.
 
IlsBoolean operator== (Myself &rhs) const
 
Myselfoperator>> (TargetTypeP &p)
 
CTargetTypePR operator[] (int i) const
 Returns the i-th list item.
 
void reset ()
 
Myselfseekp (const Position &position)
 Moves the iterator to the specified position.
 
Myselfshrink ()
 
MyselfshrinkBefore ()
 
Position tellp () const
 Returns the position of the iterator.
 

Detailed Description

template<class RelationList>
class IlsListRelationIterator< RelationList >

List iterator.

Library: server

This class is aliased (by typedef) to Iterator in relation lists.

Related Pattern
Iterator
See also
IlsException, IlsOwnsList::Iterator.

Member Function Documentation

◆ getNextQuietly()

template<class RelationList >
TargetTypeP IlsListRelationIterator< RelationList >::getNextQuietly ( )
\short Provides quick access to the next element

of the list accessible through this iterator.

It should not be used to evaluate a derived data member or to retrieve a value when using Rogue Wave Server transactions. This method returns a null pointer when the end of the list is reached.

Example:

while (iter) {
d = iter.getNextQuietly();
if (d) {
// ...
}
}

◆ operator!=()

template<class RelationList >
IlsBoolean IlsListRelationIterator< RelationList >::operator!= ( Myself rhs) const
\short Indicates whether the iterator is not at the same

position as the one supplied as its argument.

◆ operator*()

template<class RelationList >
CTargetTypePR IlsListRelationIterator< RelationList >::operator* ( ) const
\short Returns the next item to be read. The iterator

remains at the same position.

◆ operator+()

template<class RelationList >
Position IlsListRelationIterator< RelationList >::operator+ ( int  i) const
\short 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 RelationList >
Myself& IlsListRelationIterator< RelationList >::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 RelationList >
Myself& IlsListRelationIterator< RelationList >::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 RelationList >
Myself& IlsListRelationIterator< RelationList >::operator+= ( int  i)
\short 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 RelationList >
Position IlsListRelationIterator< RelationList >::operator- ( int  i) const
\short Moves the iterator backward in the list according

to the value supplied as its argument.

\throw IlsBeginningOfList If the iterator is moved past the first
list item.

◆ operator--() [1/2]

template<class RelationList >
Myself& IlsListRelationIterator< RelationList >::operator-- ( )
\short 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 RelationList >
Myself& IlsListRelationIterator< RelationList >::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 RelationList >
Myself& IlsListRelationIterator< RelationList >::operator-= ( int  i)
\short Moves the iterator backward in the list according

to the value supplied as its argument.

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

◆ operator<<()

template<class RelationList >
Myself& IlsListRelationIterator< RelationList >::operator<< ( CTargetTypePR  p)
\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.

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 we have an iterator iw, which performs write operations, and an iterator ir, which 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 in an unexpected way.

Exceptions
IlsMaxCardViolatedIf the maximal cardinality has been reached.
IlsOwnershipCycleIf a cycle has been detected among ownership relations.

◆ operator=()

template<class RelationList >
Myself& IlsListRelationIterator< RelationList >::operator= ( const Myself rhs)
\short Moves the iterator to the same position as the

one supplied as its argument.

◆ operator==()

template<class RelationList >
IlsBoolean IlsListRelationIterator< RelationList >::operator== ( Myself rhs) const
\short Indicates whether the iterator occupies the same

position as the one supplied as its argument.

◆ operator>>()

template<class RelationList >
Myself& IlsListRelationIterator< RelationList >::operator>> ( TargetTypeP &  p)
\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 operator IlsBoolean()).

If an iterator is built for an empty list, the conversion operator of the iterator returns IlsFalse.

◆ reset()

template<class RelationList >
void IlsListRelationIterator< RelationList >::reset ( )
\short Resets the iterator so that it points again

to the first item of the list.

◆ shrink()

template<class RelationList >
Myself& IlsListRelationIterator< RelationList >::shrink ( )
\short Removes the item following the last element

read from the list, or, if the list has not yet been read, it removes the first item in the list.

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. Let us suppose we have an iterator iw, which performs write operations, and an iterator ir, which 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 in an unexpected way. Also, if iw points to a given item in the list and ir points to the next item, ir may behave in an unexpected way if iw executes the function shrink.

Exceptions
IlsUpdateForbiddenIf the member function isUpdateAllowed() returns IlsFalse for the type where the relation is declared.
IlsMinCardViolatedIf the minimal cardinality has been reached.
IlsEndOfListIf the iterator points to the last item of the list.

◆ shrinkBefore()

template<class RelationList >
Myself& IlsListRelationIterator< RelationList >::shrinkBefore ( )
\short Removes the last item read from the list.

Restrictions of the same kind as those mentioned for shrink() apply to shrinkBefore().

Exceptions
IlsMinCardViolatedIf the minimal cardinality has been reached.
IlsBeginningOfListif the iterator points to the first item of the list.
IlsListRelationIterator
List iterator.
Definition: model.h:3309
IlsSmartPointer
This class lets you declare smart pointers to objects of a given type. Objects referenced by smart po...
Definition: refcount.h:273