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 &) |
Hook through which NoticeTarget s are notified (by NoticeSource s). More... | |
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... | |
Public Member Functions inherited from casacore::NoticeTarget | |
virtual | ~NoticeTarget () |
Destructs this NoticeTarget . More... | |
Bool | isValid () const |
Returns a boolean value telling whether this NoticeTarget is still "valid". More... | |
Bool | isAttached () const |
Returns a boolean value telling whether this NoticeTarget is still attached to a NoticeSource or not. More... | |
void | invalidate () |
Makes the current NoticeTarget "invalid". 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_ |
Protected Attributes inherited from casacore::NoticeTarget | |
Link< NoticeTarget * > * | ilink |
NoticeSource * | container |
Bool | valid |
Additional Inherited Members | |
Protected Member Functions inherited from casacore::NoticeTarget | |
NoticeTarget () | |
Creates an unlinked, "invalid" NoticeTarget . More... | |
NoticeTarget (NoticeSource *v) | |
Creates a "valid" NoticeTarget linked to the specified NoticeSource . More... | |
NoticeTarget (NoticeSource &v) | |
NoticeTarget (NoticeTarget &other) | |
Creates a "valid" NoticeTarget linked to the same NoticeSource as the other NoticeTarget . More... | |
NoticeTarget (NoticeTarget *other) | |
void | unlink () |
Unlinks this NoticeTarget from its NoticeSource . More... | |
void | link (const NoticeTarget &other) |
Links this NoticeTarget to the same NoticeSource as the other NoticeTarget . More... | |
void | link (const NoticeTarget *other) |
Link< NoticeTarget * > * | next () |
Retrieves the next NoticeTarget in the target list of the associated NoticeSource . More... | |
const Link< NoticeTarget * > * | next () const |
void | attach (NoticeSource *v) |
Adds this NoticeTarget to the target list in the specified NoticeSource , so that it will receive all notices sent out by that NoticeSource . More... | |
void | attach (NoticeSource &v) |
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, casacore::NoticeTarget::isValid(), 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::NoticeTarget::isValid(), 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, casacore::NoticeTarget::isValid(), 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, and casacore::NoticeTarget::isValid().
|
virtual |
Hook through which NoticeTarget
s are notified (by NoticeSource
s).
Implements casacore::NoticeTarget.
Referenced by casacore::ListIter< t >::addRight().
|
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::NoticeTarget::isValid(), 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::NoticeTarget::isValid(), 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.
Reimplemented in casacore::ListIter< t >.
|
virtual |
Reimplemented in casacore::ListIter< t >.
|
virtual |
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" passed as an argument.
Reimplemented in casacore::ListIter< t >.
|
virtual |
Reimplemented in casacore::ListIter< t >.
|
inline |
Definition at line 430 of file List.h.
References AlwaysAssert, casacore::ConstListIter< t >::curPos, and casacore::NoticeTarget::isValid().
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, casacore::NoticeTarget::isValid(), 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, casacore::NoticeTarget::isValid(), 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, casacore::NoticeTarget::isValid(), and casacore::ConstListIter< t >::prev.
|
protected |
Definition at line 519 of file List.h.
Referenced by casacore::ListIter< t >::addRight(), and 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::ListIter< t >::addRight(), casacore::ConstListIter< t >::atEnd(), casacore::ListIter< t >::getRight(), casacore::ConstListIter< t >::getRight(), casacore::ConstListIter< t >::operator++(), casacore::ConstListIter< t >::operator--(), casacore::ConstListIter< t >::toEnd(), and casacore::ConstListIter< t >::toStart().
|
protected |
Definition at line 518 of file List.h.
Referenced by casacore::ListIter< t >::addRight(), casacore::ConstListIter< t >::operator++(), casacore::ConstListIter< t >::operator--(), casacore::ConstListIter< t >::pos(), casacore::ConstListIter< t >::step(), casacore::ConstListIter< t >::toEnd(), and casacore::ConstListIter< t >::toStart().
|
protected |
Definition at line 517 of file List.h.
Referenced by casacore::ListIter< t >::addRight(), casacore::ConstListIter< t >::atStart(), casacore::ConstListIter< t >::operator++(), casacore::ConstListIter< t >::operator--(), casacore::ConstListIter< t >::toEnd(), and casacore::ConstListIter< t >::toStart().