IlsOwnsList::ConstIterator
Category
Nested class
Description
ConstIterator is a class nested in the template
IlsOwnsList. This nested class is used to sequentially read a list of ownership relations.
Related Pattern
Iterator
Library
Synopsis
class ConstIterator
{
public:
IlsBoolean operator!=(const Iterator&);
Const
Iterator&
seekp(const Position& position);
};
Constructors
ConstIterator(IlsOwnsList&);
This constructor creates an iterator for the list that is 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>>(OwnedTypeP&);
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 moves the iterator to the specified position.
ConstIterator& operator=(const Iterator&);
This operator moves the iterator to the same position as the one supplied as its argument.
OwnedTypeP 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 occupies 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+(unsigned 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-(unsigned 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+=(unsigned 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-=(unsigned int i);
This operator moves the iterator backward in the list 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.
OwnedTypeP operator[](unsigned int i);
This operator returns the i-th list item.
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 unsuccessful extraction has been performed.
See Also
Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.