11 #ifndef _LISTIMPLEM_H_ 12 #define _LISTIMPLEM_H_ 27 m_usePool(source.m_usePool)
68 if (!(
this == &source))
97 head->suc->pre = newlink;
107 ln->pre->suc = newlink;
128 if (this->pre != NULL) pre->suc = a;
131 if (this->suc != NULL) suc->pre =
this;
134 else if (a->suc ==
this)
142 if (this->pre != NULL)
149 if (this->suc != NULL)
153 if (this->pre!= NULL)
183 tail->pre->suc = newlink;
191 ln->suc->pre = newlink;
397 ln->suc->pre = ln->pre;
398 ln->pre->suc = ln->suc;
422 if (
head == NULL)
return;
432 if (next != NULL && next->val < p->val)
void catenate(List< T > &src)
Appends a copy of all items in List<T> src to this List<T>.
Definition: ListImplem.H:211
void addAfter(ListIterator< T > &lit, const T &val)
Insert val into List<T> after the object pointed to by lit.
Definition: List.H:679
ListLink< T > * p
Definition: List.H:167
#define CH_assert(cond)
Definition: CHArray.H:37
List< T > & operator=(const List< T > &rhs)
The assignment operator.
Definition: ListImplem.H:66
void transfer(ListIterator< T > &lit)
Transfer the object pointed to by lit from the List<T> lit is associated with to this one...
Definition: ListImplem.H:317
void remove(const T &value)
Removes all objects in the List<T> equal to value.
Definition: ListImplem.H:356
void * getPtr()
request a section of memory of ptrSize_ contiguous bytes.
Definition: Pool.H:157
void removeLink(ListLink< T > *ln)
Definition: ListImplem.H:373
void append(const T &value)
Adds a copy of the value to the end of the List<T>.
Definition: List.H:582
ListLink< T > * tail
Definition: List.H:368
void clear()
Removes all objects from the List<T>.
Definition: ListImplem.H:263
void returnPtr(void *a_ptr)
return memory previous acquired with the getPtr() function.
ListLink< T > * head
Definition: List.H:363
void join(const List< T > &src)
Appends a copy of all items in List<T> src to this List<T>.
Definition: ListImplem.H:203
bool m_usePool
Definition: List.H:381
void addBefore(ListIterator< T > &lit, const T &val)
Insert val into List<T> before the object pointed to by lit.
Definition: List.H:688
A Doubly-Linked List Class.
Definition: List.H:21
const char * name(const FArrayBox &a_dummySpecializationArg)
Definition: CH_HDF5.H:907
Iterator over a List.
Definition: List.H:20
void add(const T &value)
Adds a copy of the value to the end of the List<T>.
Definition: ListImplem.H:49
Pool is a class to optimize memory allocation.
Definition: Pool.H:63
const List< T > & list
Definition: List.H:162
static Pool linkPool
Definition: List.H:379
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
int length() const
Returns the number of objects in the List<T>.
Definition: ListImplem.H:56
bool operator==(const List< T > &rhs) const
Returns true if the this and rhs are memberwise equal.
Definition: ListImplem.H:295
bool operator!=(const List< T > &rhs) const
Returns true if the this and rhs are not equal.
Definition: ListImplem.H:310
bool isEmpty() const
Returns true if the List<T> is empty.
Definition: List.H:619
bool includes(const T &value) const
Returns true if the List<T> contains an object identical to value.
Definition: ListImplem.H:284
List()
Construct an empty List<T>.
Definition: List.H:556
void checkLinks() const
Definition: ListImplem.H:236
void sort()
sort according to operator< (note: currently implemented with BubbleSort)
Definition: ListImplem.H:420
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).