00001 /*************************************************************************** 00002 * Copyright (C) 2008 by Benjamin Hadorn (b_hadorn@bluewin.ch) * 00003 *************************************************************************** 00004 * Projekt : Zeus 00005 * Module : IList 00006 * Package : System 00007 * Author : Benjamin Hadorn 00008 * Datum : 5.10.06 00009 * Ablage : $File$ 00010 * System : Cell Computing Model 00011 *************************************************************************** 00012 * Licence: * 00013 * This library is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU Lesser General Public License as * 00015 * published by the Free Software Foundation; either version * 00016 * 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * 00026 ***************************************************************************/ 00027 00028 /*************************************************************************** 00029 Changes : 00030 $Log: /Development_F/StuderWIN/dev/Zeus/src/zeusbase/System/Interfaces/IList.hpp $ 00031 ** 00032 ** 17 15.09.08 7:05 Bha 00033 ** adding empty item method defined 00034 ** 00035 ** 16 27.05.08 7:44 Bha 00036 ** handing multible items on lists 00037 ** 00038 ** 15 3.09.07 17:21 Mabbuehl 00039 ** VS6 warnings removed. 00040 ** 00041 ** 14 3.09.07 7:04 bha 00042 ** New Framework using auto pointer and improved lists 00043 ** 00044 ** 13 11.07.07 17:35 bha 00045 ** New methods getting first and last items 00046 ** 00047 ** 12 5.03.07 7:18 bha 00048 ** Stack und Heap Schnittstellen definiert. 00049 ***************************************************************************/ 00050 00051 00052 #ifndef IListHPP 00053 #define IListHPP 00054 00055 #include <zeusbase/System/Interfaces/IValueType.hpp> 00056 #include <zeusbase/System/Interfaces/IListIterator.hpp> 00057 00058 #ifdef _MSC_VER 00059 #pragma warning(push, 1) 00060 #endif 00061 00062 #include <stddef.h> 00063 00064 #ifdef _MSC_VER 00065 #pragma warning(pop) 00066 #endif 00067 00068 00069 BEGIN_NAMESPACE_Zeus 00070 00071 /*****************************************************************************/ 00075 /*****************************************************************************/ 00076 template <class T> class IList : public IValueType 00077 { 00078 HIDE_ASSIGNMENT_OPERATOR(IList<T>) 00079 00080 public: 00081 00082 /**************************************************************************/ 00092 /**************************************************************************/ 00093 virtual Int MQUALIFIER add(const T& rItem)=0; 00094 00095 /**************************************************************************/ 00101 /**************************************************************************/ 00102 virtual Int MQUALIFIER addAll(const IList<T>& rlstItems) = 0; 00103 00104 /**************************************************************************/ 00108 /**************************************************************************/ 00109 virtual Int MQUALIFIER addEmptyItem() = 0; 00110 00111 /**************************************************************************/ 00116 /**************************************************************************/ 00117 virtual void MQUALIFIER copyToList(IList<T>& rList) const =0; 00118 00119 /**************************************************************************/ 00124 /**************************************************************************/ 00125 virtual void MQUALIFIER clear()=0; 00126 00127 /**************************************************************************/ 00139 /**************************************************************************/ 00140 virtual Retval MQUALIFIER deleteItem(Int iIndex)=0; 00141 00142 /**************************************************************************/ 00150 /**************************************************************************/ 00151 virtual Retval MQUALIFIER remove(const T& rItem)=0; 00152 00153 /**************************************************************************/ 00159 /**************************************************************************/ 00160 virtual Retval MQUALIFIER removeAll(const IList<T>& rlstItems)=0; 00161 00162 /**************************************************************************/ 00166 /**************************************************************************/ 00167 virtual Int MQUALIFIER getCount() const =0; 00168 00169 /**************************************************************************/ 00178 /**************************************************************************/ 00179 virtual T& MQUALIFIER getItem(Int iIndex)=0; 00180 00181 /**************************************************************************/ 00186 /**************************************************************************/ 00187 virtual const T& MQUALIFIER getItemConst(Int iIndex) const=0; 00188 00189 /**************************************************************************/ 00195 /**************************************************************************/ 00196 virtual Int MQUALIFIER indexOf(const T& rItem) const=0; 00197 00198 /**************************************************************************/ 00211 /**************************************************************************/ 00212 virtual Int MQUALIFIER insert(Int iIndex, const T& rItem)=0; 00213 00214 /**************************************************************************/ 00221 /**************************************************************************/ 00222 virtual bool MQUALIFIER equalsItem(Int iIndex, const T& rItem) const =0; 00223 00224 /**************************************************************************/ 00230 /**************************************************************************/ 00231 virtual bool MQUALIFIER equals(const IList<T>& rList) const =0; 00232 00233 /**************************************************************************/ 00241 /**************************************************************************/ 00242 virtual IListIterator<T>* MQUALIFIER getIterator() const=0; 00243 00244 /**************************************************************************/ 00252 /**************************************************************************/ 00253 virtual const IListIterator<T>* MQUALIFIER getConstIterator() const=0; 00254 00255 /**************************************************************************/ 00260 /**************************************************************************/ 00261 virtual void MQUALIFIER releaseIterator(const IListIterator<T>* pIterator) const=0; 00262 00263 /**************************************************************************/ 00268 /**************************************************************************/ 00269 virtual bool MQUALIFIER isEmpty() const =0; 00270 00271 00272 /**************************************************************************/ 00276 /**************************************************************************/ 00277 virtual T& MQUALIFIER getFirstItem()=0; 00278 00279 /**************************************************************************/ 00284 /**************************************************************************/ 00285 virtual const T& MQUALIFIER getFirstItemConst() const=0; 00286 00287 /**************************************************************************/ 00291 /**************************************************************************/ 00292 virtual T& MQUALIFIER getLastItem()=0; 00293 00294 /**************************************************************************/ 00299 /**************************************************************************/ 00300 virtual const T& MQUALIFIER getLastItemConst() const=0; 00301 00302 /**************************************************************************/ 00308 /**************************************************************************/ 00309 virtual bool MQUALIFIER hasItem(const T& rItem) const = 0; 00310 00311 /**************************************************************************/ 00317 /**************************************************************************/ 00318 virtual bool MQUALIFIER hasAllItems(const IList<T>& rlstItems) const = 0; 00319 00320 //Friend classes: DO NOT CHANGE 00321 friend class TZVariant; 00322 }; 00323 00324 00325 END_NAMESPACE_Zeus 00326 00327 #endif