00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : IMap 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 #ifndef IMapHPP 00033 #define IMapHPP 00034 00035 #include <zeusbase/System/Interfaces/IMapIterator.hpp> 00036 #include <zeusbase/System/Interfaces/IValueType.hpp> 00037 #include <zeusbase/System/Interfaces/IList.hpp> 00038 00039 BEGIN_NAMESPACE_Zeus 00040 00041 /*****************************************************************************/ 00044 /*****************************************************************************/ 00045 template <class TKeyType, class TValueType> class IMap : public IValueType 00046 { 00047 //causes errors of HIDE_ASSIGNMENT_OPERATOR(IMap<TKeyType, TValueType> 00048 typedef IMap<TKeyType, TValueType> IMapTemplate; 00049 00050 HIDE_ASSIGNMENT_OPERATOR(IMapTemplate) 00051 00052 public: 00053 /************************************************************************/ 00057 /************************************************************************/ 00058 virtual void MQUALIFIER copyToMap(IMap<TKeyType, TValueType>& rMap) const = 0; 00059 00060 /************************************************************************/ 00064 /************************************************************************/ 00065 virtual void MQUALIFIER copyValuesToList(IList<TValueType>& rList) const = 0; 00066 00067 /************************************************************************/ 00071 /************************************************************************/ 00072 virtual void MQUALIFIER copyKeysToList(IList<TKeyType>& rList) const = 0; 00073 00074 /************************************************************************/ 00079 /************************************************************************/ 00080 virtual TValueType& MQUALIFIER getItem(const TKeyType& rKey)=0; 00081 00082 /************************************************************************/ 00087 /************************************************************************/ 00088 virtual const TValueType& MQUALIFIER getItemConst(const TKeyType& rKey) const=0; 00089 00090 /************************************************************************/ 00095 /************************************************************************/ 00096 virtual TValueType& MQUALIFIER getOrCreateItem(const TKeyType& rKey)=0; 00097 00098 /************************************************************************/ 00103 /************************************************************************/ 00104 virtual void MQUALIFIER setItem(const TKeyType& rKey, const TValueType& rData)=0; 00105 00106 /************************************************************************/ 00111 /************************************************************************/ 00112 virtual bool MQUALIFIER isEmpty() const=0; 00113 00114 /************************************************************************/ 00117 /************************************************************************/ 00118 virtual Int MQUALIFIER getCount() const=0; 00119 00120 /************************************************************************/ 00126 /************************************************************************/ 00127 virtual bool MQUALIFIER deleteItem(const TKeyType& rKey)=0; 00128 00129 /************************************************************************/ 00135 /************************************************************************/ 00136 virtual bool MQUALIFIER hasItem(const TKeyType& rKey) const=0; 00137 00138 /************************************************************************/ 00141 /************************************************************************/ 00142 virtual void MQUALIFIER clear()=0; 00143 00144 /************************************************************************/ 00147 /************************************************************************/ 00148 virtual IMapIterator<TKeyType, TValueType>* MQUALIFIER getIterator()=0; 00149 00150 /************************************************************************/ 00153 /************************************************************************/ 00154 virtual void MQUALIFIER releaseIterator(const IListIterator<TValueType>* pIterator) const=0; 00155 00156 /************************************************************************/ 00159 /************************************************************************/ 00160 virtual const IMapIterator<TKeyType, TValueType>* MQUALIFIER getConstIterator() const=0; 00161 00162 /************************************************************************/ 00165 /************************************************************************/ 00166 virtual bool MQUALIFIER equals(const IMap<TKeyType, TValueType>& rMap) const = 0; 00167 }; 00168 00169 00170 END_NAMESPACE_Zeus 00171 00172 #endif