00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Benjamin Hadorn (bhadorn@swissinfo.org) * 00003 *************************************************************************** 00004 * Projekt : Zeus 00005 * Module : IMap 00006 * Package : System 00007 * Author : Benjamin Hadorn 00008 * Datum : 19.09.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/IMap.hpp $ 00031 ** 00032 ** 11 7.01.08 9:21 Bha 00033 ** New method to copy maps defined 00034 ** 00035 ** 10 3.09.07 7:04 bha 00036 ** New Framework using auto pointer and improved lists 00037 ** 00038 ** 9 5.03.07 7:18 bha 00039 ** Stack und Heap Schnittstellen definiert. 00040 ***************************************************************************/ 00041 00042 #ifndef IMapHPP 00043 #define IMapHPP 00044 00045 #include <zeusbase/System/Interfaces/IMapIterator.hpp> 00046 #include <zeusbase/System/Interfaces/IValueType.hpp> 00047 00048 BEGIN_NAMESPACE_Zeus 00049 00050 /*****************************************************************************/ 00053 /*****************************************************************************/ 00054 template <class TKeyType, class TValueType> class IMap : public IValueType 00055 { 00056 //causes errors of HIDE_ASSIGNMENT_OPERATOR(IMap<TKeyType, TValueType> 00057 typedef IMap<TKeyType, TValueType> IMapTemplate; 00058 00059 HIDE_ASSIGNMENT_OPERATOR(IMapTemplate) 00060 00061 public: 00062 /************************************************************************/ 00066 /************************************************************************/ 00067 virtual void MQUALIFIER copyToMap(IMap<TKeyType, TValueType>& rMap) const = 0; 00068 00069 /************************************************************************/ 00074 /************************************************************************/ 00075 virtual TValueType& MQUALIFIER getItem(const TKeyType& rKey)=0; 00076 00077 /************************************************************************/ 00082 /************************************************************************/ 00083 virtual const TValueType& MQUALIFIER getItemConst(const TKeyType& rKey) const=0; 00084 00085 /************************************************************************/ 00090 /************************************************************************/ 00091 virtual void MQUALIFIER setItem(const TKeyType& rKey, const TValueType& rData)=0; 00092 00093 /************************************************************************/ 00098 /************************************************************************/ 00099 virtual bool MQUALIFIER isEmpty() const=0; 00100 00101 /************************************************************************/ 00104 /************************************************************************/ 00105 virtual Int MQUALIFIER getCount() const=0; 00106 00107 /************************************************************************/ 00113 /************************************************************************/ 00114 virtual bool MQUALIFIER deleteItem(const TKeyType& rKey)=0; 00115 00116 /************************************************************************/ 00122 /************************************************************************/ 00123 virtual bool MQUALIFIER hasItem(const TKeyType& rKey) const=0; 00124 00125 /************************************************************************/ 00128 /************************************************************************/ 00129 virtual void MQUALIFIER clear()=0; 00130 00131 /************************************************************************/ 00134 /************************************************************************/ 00135 virtual IMapIterator<TKeyType, TValueType>* MQUALIFIER getIterator()=0; 00136 00137 /************************************************************************/ 00140 /************************************************************************/ 00141 virtual void MQUALIFIER releaseIterator(const IListIterator<TValueType>* pIterator) const=0; 00142 00143 /************************************************************************/ 00146 /************************************************************************/ 00147 virtual const IMapIterator<TKeyType, TValueType>* MQUALIFIER getConstIterator() const=0; 00148 00149 /************************************************************************/ 00152 /************************************************************************/ 00153 virtual bool MQUALIFIER equals(const IMap<TKeyType, TValueType>& rMap) const = 0; 00154 }; 00155 00156 00157 END_NAMESPACE_Zeus 00158 00159 #endif