casacore
|
Doubly linked constant list iterator. More...
#include <List.h>
Public Member Functions | |
ConstListIter (const List< t > *st) | |
This constructor creates a "ConstListIter" which tracks the "List<t>" parameter. More... | |
ConstListIter (const List< t > &st) | |
ConstListIter (const ConstListIter< t > &other) | |
This constructor creates a "ConstListIter" which tracks the same list tracked by the "ConstListIter<t>" parameter. More... | |
ConstListIter (const ConstListIter< t > *other) | |
ConstListIter () | |
This is the default constructor. More... | |
~ConstListIter () | |
void | notify (const Notice &) |
Bool | atStart () const |
This functions allows one to checked if the cursor is at an extreme list position. More... | |
Bool | atEnd () const |
void | operator++ () |
This function is used to step the cursor forward through the list. More... | |
void | operator++ (int) |
void | operator-- () |
This function allow for stepping the cursor toward the front of the list. More... | |
void | operator-- (int) |
virtual uInt | pos (uInt) |
"pos()" without arguments returns the current postion of the cursor. More... | |
uInt | pos () const |
uInt | len () const |
This function returns the number of elements in the list. More... | |
uInt | step (Int offset) |
"step()" with no parameters advances the cursor forward one element. More... | |
uInt | step () |
const t & | getRight () const |
Returns the element to the right of the cursor. More... | |
virtual ConstListIter< t > & | operator= (const List< t > &other) |
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" passed as an argument. More... | |
virtual ConstListIter< t > & | operator= (const List< t > *other) |
virtual ConstListIter< t > & | operator= (const ConstListIter< t > &other) |
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" tracked by the passed "ConstListIter<t>" argument. More... | |
virtual ConstListIter< t > & | operator= (const ConstListIter< t > *other) |
void | toStart () |
This function moves the cursor to the beginning of the list. More... | |
void | toEnd () |
This function moves the cursor to the end of the list. More... | |
const List< t > * | container () const |
Get the container over which we are iterating, could be null... More... | |
Protected Attributes | |
Link< t > * | cur |
enum outside class because of compiler errors on HPUX enum {ConstListIterVersion = 1}; More... | |
Link< t > * | prev |
uInt | curPos |
List< t > * | container_ |
Doubly linked constant list iterator.
The List class above only provides for the list framework. This is one of two classes which allow list iteration, insertion, and removal. This class cannot be used to modify a list, but rather, it can only be used to look at or observe a list. It provides no functions for modifying the list.
All of the operations take place to the right of a conceptual cursor. The cursor starts out before the first element of the list and can be incremented past the last element of the list. Going further than the end of the list results in an exception.
In this example, assume that this function is called at the end of the example above, i.e. assume that the line before the return, above, is uncommented.
The output which this function, iterate()
, would produce would look like:
2 8 len=4 pos=2 89 10 8 2
As shown above:
pos()
step()
, operator++()
, and operator--()
getRight()
In addition:
atStart()
, atEnd()
, and pos()
len()
Tip: This class uses the Notice classes to implement "dynamic" cursors so that multiple cursors are updated as elements are added and removed from the list;
casacore::ConstListIter< t >::ConstListIter | ( | const List< t > * | st | ) |
This constructor creates a "ConstListIter" which tracks the "List<t>" parameter.
|
inline |
|
inline |
casacore::ConstListIter< t >::ConstListIter | ( | const ConstListIter< t > * | other | ) |
|
inline |
This is the default constructor.
It allows one to create an initially invalid empty ConstListIter. The instantiated class will accept assignment and thus become valid later.
casacore::ConstListIter< t >::~ConstListIter | ( | ) |
|
inline |
Definition at line 373 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::cur, casacore::False, and casacore::True.
|
inline |
This functions allows one to checked if the cursor is at an extreme list position.
"atStart()" checks to see if the cursor is at the beginning of the list, and "atEnd()" checks to see if the cursor is at the end of the list.
Definition at line 368 of file List.h.
References AlwaysAssert, casacore::False, casacore::ConstListIter< t >::prev, and casacore::True.
|
inline |
Get the container over which we are iterating, could be null...
Definition at line 509 of file List.h.
References casacore::ConstListIter< t >::container_.
|
inline |
Returns the element to the right of the cursor.
Definition at line 465 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::cur, and casacore::throw_list_end_error().
|
inline |
This function returns the number of elements in the list.
Definition at line 438 of file List.h.
References AlwaysAssert.
void casacore::ConstListIter< t >::notify | ( | const Notice & | ) |
|
inline |
This function is used to step the cursor forward through the list.
Definition at line 384 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::cur, casacore::ConstListIter< t >::curPos, casacore::ConstListIter< t >::prev, and casacore::throw_list_end_error().
|
inline |
Definition at line 392 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::cur, casacore::ConstListIter< t >::curPos, casacore::ConstListIter< t >::prev, and casacore::throw_list_end_error().
|
inline |
This function allow for stepping the cursor toward the front of the list.
Definition at line 406 of file List.h.
References casacore::ConstListIter< t >::cur, casacore::ConstListIter< t >::curPos, casacore::ConstListIter< t >::prev, and casacore::throw_list_start_error().
|
inline |
Definition at line 413 of file List.h.
References casacore::ConstListIter< t >::cur, casacore::ConstListIter< t >::curPos, casacore::ConstListIter< t >::prev, and casacore::throw_list_start_error().
|
virtual |
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" tracked by the passed "ConstListIter<t>" argument.
|
virtual |
|
virtual |
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" passed as an argument.
|
virtual |
|
inline |
Definition at line 430 of file List.h.
References AlwaysAssert, and casacore::ConstListIter< t >::curPos.
Referenced by casacore::ConstListIter< t >::step().
|
virtual |
"pos()" without arguments returns the current postion of the cursor.
"pos()" with an unsigned integer parameter moves the cursor to an absolute position.
|
inline |
Definition at line 459 of file List.h.
References casacore::ConstListIter< t >::step().
Referenced by casacore::ConstListIter< t >::step().
|
inline |
"step()" with no parameters advances the cursor forward one element.
"step()" with a signed integer parameter moves the cursor (forward or backward) by a relative offset indicated by the parameter.
Definition at line 450 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::curPos, and casacore::ConstListIter< t >::pos().
|
inline |
This function moves the cursor to the end of the list.
Definition at line 499 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::cur, casacore::ConstListIter< t >::curPos, and casacore::ConstListIter< t >::prev.
|
inline |
This function moves the cursor to the beginning of the list.
Definition at line 492 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::cur, casacore::ConstListIter< t >::curPos, and casacore::ConstListIter< t >::prev.
|
protected |
Definition at line 519 of file List.h.
Referenced by casacore::ConstListIter< t >::container().
|
protected |
enum outside class because of compiler errors on HPUX enum {ConstListIterVersion = 1};
Definition at line 516 of file List.h.
Referenced by casacore::ConstListIter< t >::atEnd(), casacore::ConstListIter< t >::getRight(), casacore::ConstListIter< t >::operator++(), casacore::ConstListIter< t >::operator--(), casacore::ConstListIter< t >::toEnd(), and casacore::ConstListIter< t >::toStart().
|
protected |
|
protected |
Definition at line 517 of file List.h.
Referenced by casacore::ConstListIter< t >::atStart(), casacore::ConstListIter< t >::operator++(), casacore::ConstListIter< t >::operator--(), casacore::ConstListIter< t >::toEnd(), and casacore::ConstListIter< t >::toStart().