ROSE 0.11.145.192
Public Member Functions | List of all members
Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator Class Reference

Description

template<class T, class Alloc = DefaultAllocator>
class Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator

List const node bidirectional iterator.

This iterator traverse the elements of the list in the order they are stored in the list and returns a reference to a const storage node (Node, a user-defined value and associated ID number) when dereferenced. If one wants to traverse elements in the order of the ID numbers instead, just use a "for" loop to iterate from zero to the number of items in the list and make use of the constant-time lookup-by-ID feature.

Iterators are stable across insertion and erasure. In other words, an iterator is guaranteed to not become invalid when other elements are added to or removed from the container. Added elements will become part of any existing iterator traversals when they are inserted between that iterator's current and ending position.

Node ID numbers are accessed from the iterator by invoking its id method. ID numbers are stable across insertion, but not erasure; erasing an element from the list will cause zero or one other element to receive a new ID number, and this new ID will be immediately reflected in all existing iterators that point to the affected node.

Definition at line 235 of file IndexedList.h.

#include <Sawyer/IndexedList.h>

Inheritance diagram for Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator:
Inheritance graph
[legend]
Collaboration diagram for Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator:
Collaboration graph
[legend]

Public Member Functions

 ConstNodeIterator (const ConstNodeIterator &other)
 
 ConstNodeIterator (const NodeIterator &other)
 
ConstNodeIteratoroperator= (const ConstNodeIterator &other)
 
const Nodeoperator* () const
 
const Nodeoperator-> () const
 

Constructor & Destructor Documentation

◆ ConstNodeIterator() [1/3]

template<class T , class Alloc = DefaultAllocator>
Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator::ConstNodeIterator ( )
inline

Definition at line 238 of file IndexedList.h.

◆ ConstNodeIterator() [2/3]

template<class T , class Alloc = DefaultAllocator>
Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator::ConstNodeIterator ( const ConstNodeIterator other)
inline

Definition at line 239 of file IndexedList.h.

◆ ConstNodeIterator() [3/3]

template<class T , class Alloc = DefaultAllocator>
Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator::ConstNodeIterator ( const NodeIterator other)
inline

Definition at line 240 of file IndexedList.h.

Member Function Documentation

◆ operator=()

template<class T , class Alloc = DefaultAllocator>
ConstNodeIterator & Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator::operator= ( const ConstNodeIterator other)
inline

Definition at line 241 of file IndexedList.h.

◆ operator*()

template<class T , class Alloc = DefaultAllocator>
const Node & Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator::operator* ( ) const
inline

Definition at line 242 of file IndexedList.h.

◆ operator->()

template<class T , class Alloc = DefaultAllocator>
const Node * Sawyer::Container::IndexedList< T, Alloc >::ConstNodeIterator::operator-> ( ) const
inline

Definition at line 243 of file IndexedList.h.


The documentation for this class was generated from the following file: