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 "FixedList.H"
00028 #include "ListLoopM.H"
00029
00030
00031
00032
00033
00034 template<class T, unsigned Size>
00035 void Foam::FixedList<T, Size>::swap(FixedList<T, Size>& a)
00036 {
00037 List_ACCESS(T, (*this), vp);
00038 List_ACCESS(T, a, ap);
00039 T tmp;
00040 List_FOR_ALL((*this), i)
00041 tmp = List_ELEM((*this), vp, i);
00042 List_ELEM((*this), vp, i) = List_ELEM(a, ap, i);
00043 List_ELEM(a, ap, i) = tmp;
00044 List_END_FOR_ALL
00045 }
00046
00047
00048
00049
00050 template<class T, unsigned Size>
00051 bool Foam::FixedList<T, Size>::operator==(const FixedList<T, Size>& a) const
00052 {
00053 bool equal = true;
00054
00055 List_CONST_ACCESS(T, (*this), vp);
00056 List_CONST_ACCESS(T, (a), ap);
00057
00058 List_FOR_ALL((*this), i)
00059 equal = equal && (List_ELEM((*this), vp, i) == List_ELEM((a), ap, i));
00060 List_END_FOR_ALL
00061
00062 return equal;
00063 }
00064
00065
00066 template<class T, unsigned Size>
00067 bool Foam::FixedList<T, Size>::operator!=(const FixedList<T, Size>& a) const
00068 {
00069 return !operator==(a);
00070 }
00071
00072
00073 template<class T, unsigned Size>
00074 bool Foam::FixedList<T, Size>::operator<(const FixedList<T, Size>& a) const
00075 {
00076 for
00077 (
00078 const_iterator vi = cbegin(), ai = a.cbegin();
00079 vi < cend() && ai < a.cend();
00080 vi++, ai++
00081 )
00082 {
00083 if (*vi < *ai)
00084 {
00085 return true;
00086 }
00087 else if (*vi > *ai)
00088 {
00089 return false;
00090 }
00091 }
00092
00093 if (Size < a.Size)
00094 {
00095 return true;
00096 }
00097 else
00098 {
00099 return false;
00100 }
00101 }
00102
00103
00104 template<class T, unsigned Size>
00105 bool Foam::FixedList<T, Size>::operator>(const FixedList<T, Size>& a) const
00106 {
00107 return a.operator<(*this);
00108 }
00109
00110
00111 template<class T, unsigned Size>
00112 bool Foam::FixedList<T, Size>::operator<=(const FixedList<T, Size>& a) const
00113 {
00114 return !operator>(a);
00115 }
00116
00117
00118 template<class T, unsigned Size>
00119 bool Foam::FixedList<T, Size>::operator>=(const FixedList<T, Size>& a) const
00120 {
00121 return !operator<(a);
00122 }
00123
00124
00125
00126
00127 #include "FixedListIO.C"
00128
00129