00001 /******************************************************************************* 00002 * Copyright (C) 2011 by Luca Perrone * 00003 ******************************************************************************* 00004 * Projekt : Zeus Base Library 00005 * Module : IIndexedMap 00006 * Package : System 00007 * Author : Luca Perrone 00008 * Datum : $Date: 9.03.11 9:31 $ 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/IIndexedMap.hpp $ 00031 ** 00032 ** 3 9.03.11 9:31 Lpe 00033 ** add getOrCreateItem() Method from IMap 00034 ** 00035 ** 2 4.03.11 10:36 Mab 00036 ** 00037 ** 1 3.03.11 17:07 Lpe 00038 ** neu erstellt 00039 *******************************************************************************/ 00040 00041 #ifndef IIndexedMapHPP 00042 #define IIndexedMapHPP 00043 00044 #include <zeusbase/System/Interfaces/IMap.hpp> 00045 00046 BEGIN_NAMESPACE_Zeus 00047 00048 /******************************************************************************/ 00051 /******************************************************************************/ 00052 template <class TKeyType, class TValueType> class IIndexedMap : public IMap<TKeyType, TValueType> 00053 { 00054 //causes errors of HIDE_ASSIGNMENT_OPERATOR(IIndexedMap<TKeyType, TValueType> 00055 typedef IIndexedMap<TKeyType, TValueType> IIndexedMapTemplate; 00056 00057 HIDE_ASSIGNMENT_OPERATOR(IIndexedMapTemplate) 00058 00059 public: 00060 /**************************************************************************/ 00066 /**************************************************************************/ 00067 virtual bool MQUALIFIER deleteItemByIndex(Int iIndex) = 0; 00068 00069 /*************************************************************************/ 00075 /**************************************************************************/ 00076 virtual bool MQUALIFIER equals(const IIndexedMap<TKeyType, TValueType>& rIndexedMap) const = 0; 00077 00078 /**************************************************************************/ 00083 /**************************************************************************/ 00084 virtual Int MQUALIFIER getIndexByKey(const TKeyType& rKey) = 0; 00085 00086 /**************************************************************************/ 00091 /**************************************************************************/ 00092 virtual const Int MQUALIFIER getIndexByKeyConst(const TKeyType& rKey) const = 0; 00093 00094 /************************************************************************/ 00099 /************************************************************************/ 00100 virtual TValueType& MQUALIFIER getOrCreateItem(const TKeyType& rKey) = 0; 00101 00102 /**************************************************************************/ 00107 /**************************************************************************/ 00108 virtual TValueType& MQUALIFIER getValueByIndex(Int iIndex) = 0; 00109 00110 /**************************************************************************/ 00115 /**************************************************************************/ 00116 virtual const TValueType& MQUALIFIER getValueByIndexConst(Int iIndex) const = 0; 00117 00118 /**************************************************************************/ 00123 /**************************************************************************/ 00124 virtual TKeyType MQUALIFIER getKeyByIndex(Int iIndex) = 0; 00125 00126 /**************************************************************************/ 00131 /**************************************************************************/ 00132 virtual const TKeyType MQUALIFIER getKeyByIndexConst(Int iIndex) const = 0; 00133 00134 /**************************************************************************/ 00138 /**************************************************************************/ 00139 virtual const IMap<TKeyType, TValueType>& MQUALIFIER getMapConst() const = 0; 00140 00141 protected: 00142 /************************************************************************/ 00145 /************************************************************************/ 00146 virtual IMapIterator<TKeyType, TValueType>* MQUALIFIER getIterator() = 0; 00147 }; 00148 00149 END_NAMESPACE_Zeus 00150 00151 #endif 00152