31 #ifndef AIPS_USE_DEPRECATED 32 #error "List.h is deprecated; use -DBUILD_DEPRECATED=ON to use it" 36 #include <casacore/casa/aips.h> 37 #include <casacore/casa/Utilities/Register.h> 38 #include <casacore/casa/Utilities/Notice.h> 39 #include <casacore/casa/Containers/Link.h> 40 #include <casacore/casa/Utilities/Assert.h> 41 #include <casacore/casa/Containers/IterError.h> 55 template<
class t>
class List;
116 mod(m),oprev(op),ocur(oc),nprev(np),ncur(nc), off(of), otherOff(nf) {}
123 nprev(0),ncur(0),off(0),otherOff(0) {}
218 enum {ListVersion = 2};
318 cur(st.head), prev(0), curPos(0),
319 container_((
List<t> *) (&st))
330 cur(other.cur), prev(other.prev), curPos(other.curPos),
331 container_(other.container_) {}
358 void notify(
const Notice &);
370 if (prev == 0)
return True;
375 if (cur == 0)
return True;
410 prev = (*prev).prev();
417 prev = (*prev).prev();
440 return (*container_).length;}
455 toffset = offset < 0 && -offset >
Int(curPos) ? -((- curPos - offset) % ((*container_).length + 1))
456 : (curPos + offset) % ((*container_).length + 1);
457 return(pos(toffset >= 0 ? toffset : (*container_).length + toffset + 1));}
468 return((*cur).val());}
494 cur = (*container_).head; prev = 0; curPos = 0;}
501 prev = (*container_).tail;
503 curPos = (*container_).length;
651 this->cur = newLink(e,this->prev,this->cur);
653 (*this->container_).added(this->prev,this->cur);
656 (*this->container_).notify(state);
682 return((*this->cur).val());}
756 #ifndef CASACORE_NO_AUTO_TEMPLATES 757 #include <casacore/casa/Containers/List.tcc> 758 #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.