A bidirectional iterator for traversing the Entry objects of a Group. More...
#include <partition.hpp>
Public Member Functions | |
Iterator () | |
Constructs a Iterator with a NULL Group association. More... | |
Iterator (const Iterator &i) | |
Copy constructor. More... | |
Iterator & | operator= (const Iterator &i) |
Copy assignment. More... | |
Iterator & | operator++ () |
Increments the iterator to the next list position and returns a reference to itself. More... | |
Iterator & | operator-- () |
Decrements the iterator to the previous list position and returns a reference to itself. More... | |
Iterator | operator++ (int) |
Increments the iterator to the next list position and returns a copy of the value of this iterator before the increment. More... | |
Iterator | operator-- (int) |
Decrements the iterator to the previous list position and returns a copy of the value of this iterator before the decrement. More... | |
bool | isBeforeFront () const |
Returns true if this iterator is pointing one logical position before the first Entry in the list, and false if it is pointing to any list Entry. More... | |
bool | isAfterBack () const |
Returns true if this iterator is pointing one logical position after the last Entry in the list, and false if it is pointing to any list Entry. More... | |
bool | isAtFront () const |
Returns true if this iterator points to the first Entry of a non-empty list, or to the afterBack position of an empty list; and false otherwise. More... | |
bool | isAtBack () const |
Returns true if this iterator points to the last Entry of a non-empty list, or to the beforeFront position of an empty list; and false otherwise. More... | |
Entry & | operator* () const |
Returns a reference to the Entry pointed to by this iterator. More... | |
Entry * | operator-> () const |
Returns a pointer to the Entry pointed to by this iterator. More... | |
Group * | getContainer () const |
Returns a pointer to the Group associated with this Iterator. More... | |
bool | operator== (const Iterator &i) const |
Returns true if this Iterator and i point to the same Entry in the same Group list, and false otherwise. More... | |
bool | operator== (const ConstIterator &i) const |
Returns true if this Iterator and i point to the same Entry in the same Group list, and false otherwise. More... | |
bool | operator!= (const Iterator &i) const |
Returns false if this Iterator and i point to the same Entry in the same Group list and true otherwise. More... | |
bool | operator!= (const ConstIterator &i) const |
Returns false if this Iterator and i point to the same Entry in the same Group list and true otherwise. More... | |
void | addBefore (int id) const |
Removes the Entry with the given id from the Group with which it was previously a member (if any), and adds it into this Iterator's Group immediately before the position pointed to by this Iterator. More... | |
void | addAfter (int id) const |
Removes the Entry with the given id from the Group with which it was previously a member (if any), and adds it into this Iterator's Group immediately after the position pointed to by this Iterator. More... | |
Entry & | removeAndInc () |
Removes and returns a reference to the Entry pointed to by this Iterator from its Group's list, and updates this Iterator to point to the next Entry in the list. More... | |
Entry & | removeAndDec () |
Removes and returns a reference to the Entry pointed to by this Iterator from this Group's list, and updates this Iterator to point to the previous Entry in the list. More... | |
Friends | |
class | Group |
A bidirectional iterator for traversing the Entry objects of a Group.
Notes on Iterator invalidation:
An Iterator is invalidated if either of the following occur:
The underlying Domain incurs a memory reallocation event.
The behavior of an invalidated Iterator is undefined so one must take care to avoid unintentional iterator invalidation. Remember that an operation that adds an Entry to a Group also removes that same Entry from its previous Group; so all operations that affect Group membership can invalidate Iterators. Also the Domain's resize methods can be used to eliminate Entry's from the Domain entirely (and from their Groups).
For more information on the circumstances of Domain memory reallocation events see Domain.
|
inline |
|
inline |
Copy constructor.
|
inline |
Copy assignment.
|
inline |
Increments the iterator to the next list position and returns a reference to itself.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_INC
|
|
inline |
Decrements the iterator to the previous list position and returns a reference to itself.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_INC
|
|
inline |
Increments the iterator to the next list position and returns a copy of the value of this iterator before the increment.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_INC
|
|
inline |
Decrements the iterator to the previous list position and returns a copy of the value of this iterator before the decrement.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_INC
|
|
inline |
Returns true
if this iterator is pointing one logical position before the first Entry in the list, and false
if it is pointing to any list Entry.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_DEREF
|
|
inline |
Returns true
if this iterator is pointing one logical position after the last Entry in the list, and false
if it is pointing to any list Entry.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_DEREF
|
|
inline |
Returns true
if this iterator points to the first Entry of a non-empty list, or to the afterBack position of an empty list; and false
otherwise.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_DEREF
|
|
inline |
Returns true
if this iterator points to the last Entry of a non-empty list, or to the beforeFront position of an empty list; and false
otherwise.
PartitionException | if this Iterator has no Group association. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_DEREF
|
|
inline |
Returns a reference to the Entry pointed to by this iterator.
PartitionException | if this Iterator isBeforeFront() or isAfterBack() .This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_DEREF
|
|
inline |
Returns a pointer to the Entry pointed to by this iterator.
PartitionException | if this Iterator isBeforeFront() or isAfterBack() .This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_DEREF
|
|
inline |
|
inline |
Returns true
if this Iterator and i
point to the same Entry in the same Group list, and false
otherwise.
PartitionException | if this Iterator and Iterator i are not associated with the same Group. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_COMPARE
|
|
inline |
Returns true
if this Iterator and i
point to the same Entry in the same Group list, and false
otherwise.
PartitionException | if this Iterator and Iterator i are not associated with the same Group. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_COMPARE
|
|
inline |
Returns false
if this Iterator and i
point to the same Entry in the same Group list and true
otherwise.
PartitionException | if this Iterator and Iterator i are not associated with the same Group. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_COMPARE
|
|
inline |
Returns false
if this Iterator and i
point to the same Entry in the same Group list and true
otherwise.
PartitionException | if this Iterator and Iterator i are not associated with the same Group. This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_ITERATOR_COMPARE
|
|
inline |
Removes the Entry with the given id
from the Group with which it was previously a member (if any), and adds it into this Iterator's Group immediately before the position pointed to by this Iterator.
Computational Complexity: Constant
PartitionException | if this Iterator is not associated with a Group; or if this Iterator's Group is not associated with a Domain; or if id is not a member of the associated Domain.These validations are only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_GROUP_ADD
|
|
inline |
Removes the Entry with the given id
from the Group with which it was previously a member (if any), and adds it into this Iterator's Group immediately after the position pointed to by this Iterator.
Computational Complexity: Constant
PartitionException | if this Iterator is not associated with a Group; or if this Iterator's Group is not associated with a Domain; or if id is not a member of the associated Domain.These validations are only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_GROUP_ADD
|
|
inline |
Removes and returns a reference to the Entry pointed to by this Iterator from its Group's list, and updates this Iterator to point to the next Entry in the list.
Computational Complexity: Constant.
PartitionException | if Iterator i isBeforeFront() or isAfterBack() .This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_GROUP_REMOVE
|
|
inline |
Removes and returns a reference to the Entry pointed to by this Iterator from this Group's list, and updates this Iterator to point to the previous Entry in the list.
Computational Complexity: Constant.
PartitionException | if Iterator i isBeforeFront() or isAfterBack() .This validation is only included if the following preprocessor directive evaluates to true during compilation: #if PARTITION_SL >= PARTITION_ST_GROUP_REMOVE
|