00001 //----------------------------------------------------------- 00002 // Copyright Christian Arnault LAL-Orsay CNRS 00003 // arnault@lal.in2p3.fr 00004 // See the complete license in cmt_license.txt "http://www.cecill.info". 00005 //----------------------------------------------------------- 00006 00007 class iterator 00008 { 00009 public: 00010 iterator () 00011 { 00012 _index = 0; 00013 _vector = 0; 00014 } 00015 00016 iterator (cmt_vector& vector) 00017 { 00018 _index = 0; 00019 _vector = &vector; 00020 } 00021 00022 iterator (const iterator& other) 00023 { 00024 _index = other._index; 00025 _vector = other._vector; 00026 } 00027 00028 iterator& operator = (const iterator& other) 00029 { 00030 _index = other._index; 00031 _vector = other._vector; 00032 00033 return (*this); 00034 } 00035 00036 bool operator == (const iterator& other) 00037 { 00038 if (_vector != other._vector) return (false); 00039 if (_index != other._index) return (false); 00040 00041 return (true); 00042 } 00043 00044 iterator& operator ++ () 00045 { 00046 if (_vector != 0) 00047 { 00048 _index++; 00049 } 00050 00051 return (*this); 00052 }; 00053 00054 iterator& operator -- () 00055 { 00056 return (*this); 00057 }; 00058 00059 int operator - (const iterator* other) 00060 { 00061 return (0); 00062 }; 00063 00064 iterator operator + (int offset) 00065 { 00066 iterator it = *this; 00067 return (it); 00068 }; 00069 00070 iterator operator - (int offset) 00071 { 00072 iterator it = *this; 00073 return (it); 00074 }; 00075 00076 T& operator * () 00077 { 00078 return (); 00079 }; 00080 00081 private: 00082 int _index; 00083 cmt_vector* _vector; 00084 };