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>
55template<
class t>
class List;
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());}
501 prev = (*container_).tail;
503 curPos = (*container_).length;
682 return((*this->
cur).val());}
756#ifndef CASACORE_NO_AUTO_TEMPLATES
757#include <casacore/casa/Containers/List.tcc>
#define AlwaysAssert(expr, exception)
These marcos are provided for use instead of simply using the constructors of assert_ to allow additi...
Doubly linked constant list iterator.
virtual ConstListIter< t > & operator=(const List< t > *other)
virtual ConstListIter< t > & operator=(const List< t > &other)
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" passed a...
void toEnd()
This function moves the cursor to the end of the list.
virtual uInt pos(uInt)
"pos()" without arguments returns the current postion of the cursor.
Bool atStart() const
This functions allows one to checked if the cursor is at an extreme list position.
uInt len() const
This function returns the number of elements in the list.
ConstListIter(const ConstListIter< t > *other)
ConstListIter(const List< t > *st)
This constructor creates a "ConstListIter" which tracks the "List<t>" parameter.
virtual ConstListIter< t > & operator=(const ConstListIter< t > *other)
void notify(const Notice &)
Hook through which NoticeTargets are notified (by NoticeSources).
ConstListIter()
This is the default constructor.
Link< t > * cur
enum outside class because of compiler errors on HPUX enum {ConstListIterVersion = 1};
void toStart()
This function moves the cursor to the beginning of the list.
void operator--()
This function allow for stepping the cursor toward the front of the list.
void operator++()
This function is used to step the cursor forward through the list.
uInt step(Int offset)
"step()" with no parameters advances the cursor forward one element.
const t & getRight() const
Returns the element to the right of the cursor.
virtual ConstListIter< t > & operator=(const ConstListIter< t > &other)
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" tracked ...
const List< t > * container() const
Get the container over which we are iterating, could be null...
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...
Invalide iteration error class.
Doubly linked non-constant list iterator The List class above only provides for the list framework.
virtual Link< t > * newLink(t &e, Link< t > *p=0, Link< t > *n=0)
const t & getRight() const
ConstListIter< t > & operator=(const ConstListIter< t > *)
void addRight(t e)
This function adds the element to the right of the current cursor position.
virtual void swapRight(ListIter< t > &)
This function swaps the list section after the current position of the list with the right section of...
virtual ListIter< t > & operator=(List< t > &other)
This assignment operator changes the List which this iterator tracks to the List parameter.
ConstListIter< t > & operator=(const ConstListIter< t > &)
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" tracked ...
Bool own
Indicates if this iterator "owns" the container it observes.
virtual ListIter< t > & operator=(const ListIter< t > &other)
These assignment operators allow one to change the List to which this iterator tracks to the List cur...
virtual ListIter< t > & operator=(List< t > *other)
ConstListIter< t > & operator=(const List< t > *)
ListIter()
This is the default constructor.
t & getRight()
Returns the element to the right of the cursor.
ListIter(List< t > &st)
This constructor allows one to construct a ListIter and attach it to the List parameter.
ListIter(const ListIter< t > *other)
void removeRight()
This function removes the element to the right of the current cursor position.
ConstListIter< t > & operator=(const List< t > &)
This assignment operator substitutes the "List<t>" tracked by this iterator to the "List<t>" passed a...
ListIter(const ListIter< t > &other)
These constructors allow for the creation of a ListIter from another ListIter.
ListIter(List< t > *st, Bool OWN=False)
This constructor allows one to construct a ListIter and attach it to the List parameter.
virtual ListIter< t > & assign(List< t > *other, Bool OWN=False)
This function changes the List which this ListIter tracks and specifies that the List should be delet...
virtual ListIter< t > & operator=(const ListIter< t > *other)
uInt type() const
This function returns the Notice "type", which is retrieved from the "type registry".
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".
List< t > & operator=(const List< t > *other)
List(const List< t > &other)
Copy Semantics.
List()
Creates an empty list.
virtual void added(Link< t > *, Link< t > *)
Updates the extreme pointers, head or tail under the appropriate conditions.
List(const List< t > *other)
virtual void removed(Link< t > *, Link< t > *, Link< t > *)
List< t > & operator=(const List< t > &other)
uInt len() const
Returns the length of the list.
base class for notice originators
abstract base class for notice receptors
Bool isValid() const
Returns a boolean value telling whether this NoticeTarget is still "valid".
this file contains all the compiler specific defines
void throw_list_swapright_same_error()
void throw_list_init_error()
void throw_list_end_error()
The function which throws an exception for advancing the internal cursor past the end of a list.
void throw_list_start_error()
bool Bool
Define the standard types used by Casacore.