00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : IList 00006 * Package : Zeus.ZeusBase.System.Interfaces 00007 * Author : Benjamin Hadorn 00008 * Date : 27.12.2011 00009 * System : Zeus-Framework 00010 ***************************************************************************** 00011 * Licence: * 00012 * This library is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU Lesser General Public License as * 00014 * published by the Free Software Foundation; either version * 00015 * 2.1 of the License, or (at your option) any later version. * 00016 * * 00017 * This library is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU Lesser General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU Lesser General Public * 00023 * License along with this library; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00025 *****************************************************************************/ 00026 00027 /***************************************************************************** 00028 * Changes: 00029 * 27.12.2011 bha: created zeus 2.0 00030 *****************************************************************************/ 00031 00032 00033 #ifndef IListHPP 00034 #define IListHPP 00035 00036 #include <zeusbase/System/Interfaces/IValueType.hpp> 00037 #include <zeusbase/System/Interfaces/IListIterator.hpp> 00038 00039 #ifdef _MSC_VER 00040 #pragma warning(push, 1) 00041 #endif 00042 00043 #include <stddef.h> 00044 00045 #ifdef _MSC_VER 00046 #pragma warning(pop) 00047 #endif 00048 00049 00050 BEGIN_NAMESPACE_Zeus 00051 00052 /*****************************************************************************/ 00056 /*****************************************************************************/ 00057 template <class T> class IList : public IValueType 00058 { 00059 HIDE_ASSIGNMENT_OPERATOR(IList<T>) 00060 00061 public: 00062 00063 /**************************************************************************/ 00073 /**************************************************************************/ 00074 virtual Int MQUALIFIER add(const T& rItem)=0; 00075 00076 /**************************************************************************/ 00082 /**************************************************************************/ 00083 virtual Int MQUALIFIER addAll(const IList<T>& rlstItems) = 0; 00084 00085 /**************************************************************************/ 00089 /**************************************************************************/ 00090 virtual Int MQUALIFIER addEmptyItem() = 0; 00091 00092 /**************************************************************************/ 00097 /**************************************************************************/ 00098 virtual void MQUALIFIER copyToList(IList<T>& rList) const =0; 00099 00100 /**************************************************************************/ 00105 /**************************************************************************/ 00106 virtual void MQUALIFIER clear()=0; 00107 00108 /**************************************************************************/ 00120 /**************************************************************************/ 00121 virtual Retval MQUALIFIER deleteItem(Int iIndex)=0; 00122 00123 /**************************************************************************/ 00131 /**************************************************************************/ 00132 virtual Retval MQUALIFIER remove(const T& rItem)=0; 00133 00134 /**************************************************************************/ 00140 /**************************************************************************/ 00141 virtual Retval MQUALIFIER removeAll(const IList<T>& rlstItems)=0; 00142 00143 /**************************************************************************/ 00147 /**************************************************************************/ 00148 virtual Int MQUALIFIER getCount() const =0; 00149 00150 /**************************************************************************/ 00159 /**************************************************************************/ 00160 virtual T& MQUALIFIER getItem(Int iIndex)=0; 00161 00162 /**************************************************************************/ 00167 /**************************************************************************/ 00168 virtual const T& MQUALIFIER getItemConst(Int iIndex) const=0; 00169 00170 /**************************************************************************/ 00176 /**************************************************************************/ 00177 virtual Int MQUALIFIER indexOf(const T& rItem) const=0; 00178 00179 /**************************************************************************/ 00192 /**************************************************************************/ 00193 virtual Int MQUALIFIER insert(Int iIndex, const T& rItem)=0; 00194 00195 /**************************************************************************/ 00202 /**************************************************************************/ 00203 virtual bool MQUALIFIER equalsItem(Int iIndex, const T& rItem) const =0; 00204 00205 /**************************************************************************/ 00211 /**************************************************************************/ 00212 virtual bool MQUALIFIER equals(const IList<T>& rList) const =0; 00213 00214 /**************************************************************************/ 00222 /**************************************************************************/ 00223 virtual IListIterator<T>* MQUALIFIER getIterator() const=0; 00224 00225 /**************************************************************************/ 00233 /**************************************************************************/ 00234 virtual const IListIterator<T>* MQUALIFIER getConstIterator() const=0; 00235 00236 /**************************************************************************/ 00241 /**************************************************************************/ 00242 virtual void MQUALIFIER releaseIterator(const IListIterator<T>* pIterator) const=0; 00243 00244 /**************************************************************************/ 00249 /**************************************************************************/ 00250 virtual bool MQUALIFIER isEmpty() const =0; 00251 00252 00253 /**************************************************************************/ 00257 /**************************************************************************/ 00258 virtual T& MQUALIFIER getFirstItem()=0; 00259 00260 /**************************************************************************/ 00265 /**************************************************************************/ 00266 virtual const T& MQUALIFIER getFirstItemConst() const=0; 00267 00268 /**************************************************************************/ 00272 /**************************************************************************/ 00273 virtual T& MQUALIFIER getLastItem()=0; 00274 00275 /**************************************************************************/ 00280 /**************************************************************************/ 00281 virtual const T& MQUALIFIER getLastItemConst() const=0; 00282 00283 /**************************************************************************/ 00289 /**************************************************************************/ 00290 virtual bool MQUALIFIER hasItem(const T& rItem) const = 0; 00291 00292 /**************************************************************************/ 00298 /**************************************************************************/ 00299 virtual bool MQUALIFIER hasAllItems(const IList<T>& rlstItems) const = 0; 00300 00301 //Friend classes: DO NOT CHANGE 00302 friend class TZVariant; 00303 }; 00304 00305 00306 END_NAMESPACE_Zeus 00307 00308 #endif