IlsInvertedRelationList::ConstIterator
Category
Nested class
Description
ConstIterator is a class nested in the template IlsInvertedRelationList. Instances of that nested class are used to sequentially read a list of inverted relations.
Related Pattern
Iterator
Library
Synopsis
class ConstIterator
{
public:
operator IlsBoolean();
ConstIterator& seekp(const Position& position);
};
Constructors
ConstIterator(IlsInvertedRelationList&);
This constructor creates an iterator for the list supplied as its argument.
ConstIterator(Iterator&);
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 Functions
Position tellp();
This member function returns the position of the iterator.
ConstIterator& seekp(const Position& position);
This member function moves the iterator to the specified position.
ConstIterator& reset();
This member function resets the iterator so that it points again to the first item of the list.
ConstIterator& gotoEnd();
This member function moves the iterator to the end of the list.
Operators
ConstIterator& operator>>(OriginType*&);
This operator 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 below.) If an iterator is built for an empty list, the conversion operator of the iterator returns IlsFalse.
ConstIterator& operator++();
This increment operator moves the iterator to the next item in the list. If the iterator is moved past the last list item, the exception
IlsEndOfList is thrown.
ConstIterator& operator++(int);
This operator is identical to the previous one except that it uses a prefix notation.
ConstIterator& operator--();
This operator moves the iterator to the previous item in the list. If the iterator is moved past the first list item, the exception
IlsBeginningOfList is thrown.
ConstIterator& operator--(int);
This operator is identical to the previous one except that it uses a prefix notation.
ConstIterator& operator=(const Position&);
This operator assigns the position provided as its argument to another position and returns the position supplied.
ConstIterator& operator=(const Iterator&);
This operator moves the iterator to the same position as the one supplied as its argument.
OriginType* operator*() const;
This operator returns the next item to be read. The iterator remains at the same position.
IlsBoolean operator==(const Iterator&);
This operator indicates whether the iterator is at the same position as the one supplied as its argument.
IlsBoolean operator!=(const Iterator&);
This operator indicates whether the iterator is not at the same position as the one supplied as its argument.
Position operator+(int);
This operator moves the iterator forward in the list according to the value supplied as its argument. If the iterator is moved past the last list item, the exception
IlsEndOfList is thrown.
Position operator-(int);
This operator moves the iterator backward in the list according to the value supplied as its argument. If the iterator is moved past the first list item, the exception
IlsBeginningOfList is thrown.
ConstIterator& operator+=(int i);
This operator moves the iterator forward according to the value supplied as its argument. If the value provided moves the iterator past the last list item, the exception
IlsEndOfList is thrown.
ConstIterator& operator-=(int i);
This operator moves the iterator backward according to the value supplied as its argument. If the value provided moves the iterator past the first list item, the exception
IlsBeginningOfList is thrown.
IlsBoolean eol()const;
This operator returns IlsTrue if the end of the list has been reached.
OriginType* operator[](int i);
This operator returns the i-th list element.
operator IlsBoolean();
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 extraction has failed.
See Also
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.