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

List.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_LIST_HPP 00026 #define OMF_LIST_HPP 00027 00028 // std includes 00029 #include <list> 00030 00031 // OMF includes 00032 #include <OMF/Container.hpp> 00033 #include <OMF/Exception.hpp> 00034 00035 namespace OMF 00036 { 00060 class List : public Container 00061 { 00062 static const std::string &_typeCode(); 00063 00064 typedef std::list<Object *> Type; 00065 public: 00066 List(); 00067 List(const List &value); 00068 virtual ~List(); 00069 00070 const List &operator =(const List &value); 00071 00072 virtual Iterator begin(); 00073 virtual Iterator end(); 00074 virtual Iterator find(Object *obj); 00075 virtual Iterator find(bool value); 00076 virtual Iterator find(int value); 00077 virtual Iterator find(const char *value); 00078 00079 virtual ConstIterator begin() const; 00080 virtual ConstIterator end() const; 00081 virtual ConstIterator find(Object *obj) const; 00082 virtual ConstIterator find(bool value) const; 00083 virtual ConstIterator find(int value) const; 00084 virtual ConstIterator find(const char *value) const; 00085 00086 Object *at(size_t index); 00087 Object *at(size_t index) const; 00088 Object *operator [](size_t index); 00089 Object *operator [](size_t index) const; 00090 00091 Object *front(); 00092 void pushFront(Object *obj); 00093 void pushFront(bool value); 00094 void pushFront(int value); 00095 void pushFront(const char *value); 00096 void popFront(); 00097 00098 Object *back(); 00099 void pushBack(Object *obj); 00100 void pushBack(bool value); 00101 void pushBack(int value); 00102 void pushBack(const char *value); 00103 void popBack(); 00104 00105 Iterator insert(Iterator i, Object *obj); 00106 Iterator insert(Iterator i, bool value); 00107 Iterator insert(Iterator i, int value); 00108 Iterator insert(Iterator i, const char *value); 00109 Iterator erase(Iterator i); 00110 00111 virtual bool empty() const; 00112 virtual size_t size() const; 00113 00118 virtual void add(Object *obj); 00119 virtual void add(bool value); 00120 virtual void add(int value); 00121 virtual void add(const char *value); 00122 00127 virtual void remove(Object *obj); 00128 virtual void remove(bool value); 00129 virtual void remove(int value); 00130 virtual void remove(const char *value); 00131 00133 virtual void clear(); 00134 00135 virtual const std::string &typeCode() const; 00136 00137 private: 00138 Type _data; 00139 }; 00140 } 00141 00142 #endif

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