Wm4TTuple.inl
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 namespace Wm4
00018 {
00019
00020 template <int DIMENSION, class TYPE>
00021 TTuple<DIMENSION,TYPE>::TTuple ()
00022 {
00023
00024
00025 }
00026
00027 template <int DIMENSION, class TYPE>
00028 TTuple<DIMENSION,TYPE>::~TTuple ()
00029 {
00030 }
00031
00032 template <int DIMENSION, class TYPE>
00033 TTuple<DIMENSION,TYPE>::TTuple (const TTuple& rkT)
00034 {
00035 for (int i = 0; i < DIMENSION; i++)
00036 {
00037 m_atTuple[i] = rkT.m_atTuple[i];
00038 }
00039 }
00040
00041 template <int DIMENSION, class TYPE>
00042 TTuple<DIMENSION,TYPE>::operator const TYPE* () const
00043 {
00044 return m_atTuple;
00045 }
00046
00047 template <int DIMENSION, class TYPE>
00048 TTuple<DIMENSION,TYPE>::operator TYPE* ()
00049 {
00050 return m_atTuple;
00051 }
00052
00053 template <int DIMENSION, class TYPE>
00054 TYPE TTuple<DIMENSION,TYPE>::operator[] (int i) const
00055 {
00056 assert(0 <= i && i < DIMENSION);
00057 return m_atTuple[i];
00058 }
00059
00060 template <int DIMENSION, class TYPE>
00061 TYPE& TTuple<DIMENSION,TYPE>::operator[] (int i)
00062 {
00063 assert(0 <= i && i < DIMENSION);
00064 return m_atTuple[i];
00065 }
00066
00067 template <int DIMENSION, class TYPE>
00068 TTuple<DIMENSION,TYPE>& TTuple<DIMENSION,TYPE>::operator= (const TTuple& rkT)
00069 {
00070 for (int i = 0; i < DIMENSION; i++)
00071 {
00072 m_atTuple[i] = rkT.m_atTuple[i];
00073 }
00074 return *this;
00075 }
00076
00077 template <int DIMENSION, class TYPE>
00078 bool TTuple<DIMENSION,TYPE>::operator== (const TTuple& rkT) const
00079 {
00080 const size_t uiSize = DIMENSION*sizeof(TYPE);
00081 return memcmp(m_atTuple,rkT.m_atTuple,uiSize) == 0;
00082 }
00083
00084 template <int DIMENSION, class TYPE>
00085 bool TTuple<DIMENSION,TYPE>::operator!= (const TTuple& rkT) const
00086 {
00087 const size_t uiSize = DIMENSION*sizeof(TYPE);
00088 return memcmp(m_atTuple,rkT.m_atTuple,uiSize) != 0;
00089 }
00090
00091 template <int DIMENSION, class TYPE>
00092 bool TTuple<DIMENSION,TYPE>::operator< (const TTuple& rkT) const
00093 {
00094 const size_t uiSize = DIMENSION*sizeof(TYPE);
00095 return memcmp(m_atTuple,rkT.m_atTuple,uiSize) < 0;
00096 }
00097
00098 template <int DIMENSION, class TYPE>
00099 bool TTuple<DIMENSION,TYPE>::operator<= (const TTuple& rkT) const
00100 {
00101 const size_t uiSize = DIMENSION*sizeof(TYPE);
00102 return memcmp(m_atTuple,rkT.m_atTuple,uiSize) <= 0;
00103 }
00104
00105 template <int DIMENSION, class TYPE>
00106 bool TTuple<DIMENSION,TYPE>::operator> (const TTuple& rkT) const
00107 {
00108 const size_t uiSize = DIMENSION*sizeof(TYPE);
00109 return memcmp(m_atTuple,rkT.m_atTuple,uiSize) > 0;
00110 }
00111
00112 template <int DIMENSION, class TYPE>
00113 bool TTuple<DIMENSION,TYPE>::operator>= (const TTuple& rkT) const
00114 {
00115 const size_t uiSize = DIMENSION*sizeof(TYPE);
00116 return memcmp(m_atTuple,rkT.m_atTuple,uiSize) >= 0;
00117 }
00118
00119 }