11 #ifndef _LISTIMPLEM_H_ 12 #define _LISTIMPLEM_H_ 27 m_usePool(source.m_usePool)
69 if (!(
this == &source))
98 head->suc->pre = newlink;
108 ln->pre->suc = newlink;
129 if (this->pre != NULL) pre->suc = a;
132 if (this->suc != NULL) suc->pre =
this;
135 else if (a->suc ==
this)
143 if (this->pre != NULL)
150 if (this->suc != NULL)
154 if (this->pre!= NULL)
184 tail->pre->suc = newlink;
192 ln->suc->pre = newlink;
398 ln->suc->pre = ln->pre;
399 ln->pre->suc = ln->suc;
423 if (
head == NULL)
return;
433 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:212
void addAfter(ListIterator< T > &lit, const T &val)
Insert val into List<T> after the object pointed to by lit.
Definition: List.H:680
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:67
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:318
const T & value() const
Return a constant reference to the object in the List<T> currently pointed to by the iterator...
Definition: List.H:488
void remove(const T &value)
Removes all objects in the List<T> equal to value.
Definition: ListImplem.H:357
void removeLink(ListLink< T > *ln)
Definition: ListImplem.H:374
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:264
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:204
void * getPtr()
request a section of memory of ptrSize_ contiguous bytes.
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:689
A Doubly-Linked List Class.
Definition: List.H:21
const char * name(const FArrayBox &a_dummySpecializationArg)
Definition: CH_HDF5.H:741
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:50
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:57
bool operator==(const List< T > &rhs) const
Returns true if the this and rhs are memberwise equal.
Definition: ListImplem.H:296
bool operator!=(const List< T > &rhs) const
Returns true if the this and rhs are not equal.
Definition: ListImplem.H:311
bool isEmpty() const
Returns true if the List<T> is empty.
Definition: List.H:620
bool includes(const T &value) const
Returns true if the List<T> contains an object identical to value.
Definition: ListImplem.H:285
List()
Construct an empty List<T>.
Definition: List.H:556
void checkLinks() const
Definition: ListImplem.H:237
void sort()
sort according to operator< (note: currently implemented with BubbleSort)
Definition: ListImplem.H:421
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).