Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

ConstIterator.hpp

Go to the documentation of this file.
00001 /* 00002 * Copyright (C) 2004 Andrew Sutton 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to: 00016 * 00017 * The Free Software Foundation, Inc. 00018 * 59 Temple Place, Suite 330 00019 * Boston, MA 02111-1307 USA 00020 * 00021 * Contact: 00022 * Andrew Sutton asutton@cs.kent.edu 00023 */ 00024 00025 #ifndef OMF_CONSTITERATOR_HPP 00026 #define OMF_CONSTITERATOR_HPP 00027 00028 // std includes 00029 #include <list> 00030 #include <set> 00031 #include <map> 00032 00033 namespace OMF 00034 { 00035 // forward declarations 00036 class Object; 00037 class List; 00038 class Set; 00039 00048 class ConstIterator 00049 { 00050 friend class List; 00051 friend class Set; 00052 00053 typedef std::list<Object *>::const_iterator ListConstIterator; 00054 typedef std::set<Object *>::const_iterator SetConstIterator; 00055 typedef std::map<unsigned, Object *>::const_iterator MapConstIterator; 00056 00061 enum Mode { 00062 None, 00063 List, 00064 Set, 00065 Map 00066 }; 00067 00068 public: 00069 ConstIterator(); 00070 ConstIterator(const ConstIterator &i); 00071 ConstIterator(const ListConstIterator &i); 00072 ConstIterator(const SetConstIterator &i); 00073 ConstIterator(const MapConstIterator &i); 00074 00075 const ConstIterator &operator =(const ConstIterator &i); 00076 const ConstIterator &operator =(const ListConstIterator &i); 00077 const ConstIterator &operator =(const SetConstIterator &i); 00078 const ConstIterator &operator =(const MapConstIterator &i); 00079 00080 Object *operator *(); 00081 Object *operator ->(); 00082 00083 ConstIterator &operator ++(); 00084 ConstIterator operator ++(int); 00085 ConstIterator &operator --(); 00086 ConstIterator operator --(int); 00087 00088 bool operator ==(const ConstIterator &i); 00089 bool operator !=(const ConstIterator &i); 00090 00091 private: 00092 Mode _mode; 00093 ListConstIterator _iList; 00094 SetConstIterator _iSet; 00095 MapConstIterator _iMap; 00096 }; 00097 } 00098 00099 #endif

Generated on Fri Sep 10 13:07:33 2004 for OpenModelingFramework by doxygen 1.3.8