33 #include <casacore/casa/aips.h> 34 #include <casacore/casa/Utilities/Register.h> 35 #include <casacore/casa/Utilities/Notice.h> 36 #include <casacore/casa/Containers/Link.h> 37 #include <casacore/casa/Utilities/Assert.h> 38 #include <casacore/casa/Containers/IterError.h> 52 template<
class t>
class List;
113 mod(m),oprev(op),ocur(oc),nprev(np),ncur(nc), off(of), otherOff(nf) {}
120 nprev(0),ncur(0),off(0),otherOff(0) {}
215 enum {ListVersion = 2};
315 cur(st.head), prev(0), curPos(0),
316 container_((
List<t> *) (&st))
327 cur(other.cur), prev(other.prev), curPos(other.curPos),
328 container_(other.container_) {}
355 void notify(
const Notice &);
367 if (prev == 0)
return True;
372 if (cur == 0)
return True;
407 prev = (*prev).prev();
414 prev = (*prev).prev();
437 return (*container_).length;}
452 toffset = offset < 0 && -offset >
Int(curPos) ? -((- curPos - offset) % ((*container_).length + 1))
453 : (curPos + offset) % ((*container_).length + 1);
454 return(pos(toffset >= 0 ? toffset : (*container_).length + toffset + 1));}
465 return((*cur).val());}
491 cur = (*container_).head; prev = 0; curPos = 0;}
498 prev = (*container_).tail;
500 curPos = (*container_).length;
648 this->cur = newLink(e,this->prev,this->cur);
650 (*this->container_).added(this->prev,this->cur);
653 (*this->container_).notify(state);
679 return((*this->cur).val());}
753 #ifndef CASACORE_NO_AUTO_TEMPLATES 754 #include <casacore/casa/Containers/List.tcc> 755 #endif //# CASACORE_NO_AUTO_TEMPLATES doubly linked list primitive
t & getRight()
Returns the element to the right of the cursor.
ConstListIter(const ConstListIter< t > &other)
This constructor creates a "ConstListIter" which tracks the same list tracked by the "ConstListIter<t...
abstract base class for notice receptors
ListIter(List< t > *st, Bool OWN=False)
This constructor allows one to construct a ListIter and attach it to the List parameter.
Link< t > * cur
enum outside class because of compiler errors on HPUX enum {ConstListIterVersion = 1}; ...
uInt len() const
This function returns the number of elements in the list.
void operator--()
This function allow for stepping the cursor toward the front of the list.
int operator==(const Notice &op) const
This operator can be used to compare two ListNotices.
ListNotice(modification m, Link< t > *oc, Link< t > *op, Link< t > *nc, Link< t > *np, int of, int nf=0)
This is used to construct a list notice.
ListNotice()
This constructor is used to initialize a notice for a deleted "List".
PtrHolder< T > & operator=(const PtrHolder< T > &other)
List()
Creates an empty list.
Doubly linked constant list iterator.
void throw_list_init_error()
const List< t > * container() const
Get the container over which we are iterating, could be null...
base class for notice originators
void throw_list_swapright_same_error()
void toEnd()
This function moves the cursor to the end of the list.
uInt step(Int offset)
"step()" with no parameters advances the cursor forward one element.
Bool atStart() const
This functions allows one to checked if the cursor is at an extreme list position.
const t & getRight() const
Returns the element to the right of the cursor.
LatticeExprNode length(const LatticeExprNode &expr, const LatticeExprNode &axis)
2-argument function to get the length of an axis.
#define AlwaysAssert(expr, exception)
These marcos are provided for use instead of simply using the constructors of assert_ to allow additi...
bool Bool
Define the standard types used by Casacore.
abstract base class for notices
Linked list update notice.
ConstListIter()
This is the default constructor.
ConstListIter(const List< t > &st)
void addRight(t e)
This function adds the element to the right of the current cursor position.
void operator++()
This function is used to step the cursor forward through the list.
uInt len() const
Returns the length of the list.
ListIter(const ListIter< t > *other)
const Double e
e and functions thereof:
void throw_list_end_error()
The function which throws an exception for advancing the internal cursor past the end of a list...
uInt type() const
This function returns the Notice "type", which is retrieved from the "type registry".
Doubly linked non-constant list iterator The List class above only provides for the list framework...
const Double c
Fundamental physical constants (SI units):
Bool own
Indicates if this iterator "owns" the container it observes.
void toStart()
This function moves the cursor to the beginning of the list.
this file contains all the compiler specific defines
const t & getRight() const
void throw_list_start_error()
ListIter()
This is the default constructor.
Invalide iteration error class.