ILList.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "ILList.H"
00028
00029
00030
00031 template<class LListBase, class T>
00032 Foam::ILList<LListBase, T>::ILList(const ILList<LListBase, T>& lst)
00033 :
00034 UILList<LListBase, T>()
00035 {
00036 for
00037 (
00038 typename UILList<LListBase, T>::const_iterator iter = lst.begin();
00039 iter != lst.end();
00040 ++iter
00041 )
00042 {
00043 append(iter().clone().ptr());
00044 }
00045 }
00046
00047
00048 #ifndef __INTEL_COMPILER
00049 template<class LListBase, class T>
00050 template<class CloneArg>
00051 Foam::ILList<LListBase, T>::ILList
00052 (
00053 const ILList<LListBase, T>& lst,
00054 const CloneArg& cloneArg
00055 )
00056 :
00057 UILList<LListBase, T>()
00058 {
00059 for
00060 (
00061 typename UILList<LListBase, T>::const_iterator iter = lst.begin();
00062 iter != lst.end();
00063 ++iter
00064 )
00065 {
00066 append(iter().clone(cloneArg).ptr());
00067 }
00068 }
00069 #endif
00070
00071
00072
00073
00074 template<class LListBase, class T>
00075 Foam::ILList<LListBase, T>::~ILList()
00076 {
00077 this->clear();
00078 }
00079
00080
00081
00082
00083 template<class LListBase, class T>
00084 bool Foam::ILList<LListBase, T>::eraseHead()
00085 {
00086 T* tPtr;
00087 if ((tPtr = this->removeHead()))
00088 {
00089 delete tPtr;
00090 return true;
00091 }
00092 else
00093 {
00094 return false;
00095 }
00096 }
00097
00098 template<class LListBase, class T>
00099 bool Foam::ILList<LListBase, T>::erase(T* p)
00100 {
00101 T* tPtr;
00102 if ((tPtr = remove(p)))
00103 {
00104 delete tPtr;
00105 return true;
00106 }
00107 else
00108 {
00109 return false;
00110 }
00111 }
00112
00113
00114 template<class LListBase, class T>
00115 void Foam::ILList<LListBase, T>::clear()
00116 {
00117 label oldSize = this->size();
00118 for (label i=0; i<oldSize; i++)
00119 {
00120 eraseHead();
00121 }
00122
00123 LListBase::clear();
00124 }
00125
00126
00127 template<class LListBase, class T>
00128 void Foam::ILList<LListBase, T>::transfer(ILList<LListBase, T>& lst)
00129 {
00130 clear();
00131 LListBase::transfer(lst);
00132 }
00133
00134
00135
00136
00137 template<class LListBase, class T>
00138 void Foam::ILList<LListBase, T>::operator=(const ILList<LListBase, T>& lst)
00139 {
00140 this->clear();
00141
00142 for
00143 (
00144 typename UILList<LListBase, T>::const_iterator iter = lst.begin();
00145 iter != lst.end();
00146 ++iter
00147 )
00148 {
00149 append(iter().clone().ptr());
00150 }
00151 }
00152
00153
00154
00155 #include "ILListIO.C"
00156
00157
00158
Copyright © 2000-2009 OpenCFD Ltd