00001 /***************************************************************************** 00002 * Copyright (C) 2011 by Benjamin Hadorn (b_hadorn@bluewin.ch) 00003 ***************************************************************************** 00004 * Project : Zeus Base Library 00005 * Module : ISet 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 ISetHPP 00033 #define ISetHPP 00034 00035 00036 #include <zeusbase/System/Interfaces/IList.hpp> 00037 00038 BEGIN_NAMESPACE_Zeus 00039 00040 /******************************************************************************/ 00043 /******************************************************************************/ 00044 template <class T> class ISet : public IValueType 00045 { 00046 HIDE_ASSIGNMENT_OPERATOR(ISet<T>) 00047 00048 public: 00049 /**************************************************************************/ 00055 /**************************************************************************/ 00056 virtual bool MQUALIFIER addItem(const T& rItem) = 0; 00057 00058 /**************************************************************************/ 00062 /**************************************************************************/ 00063 virtual void MQUALIFIER addAllItems(const ISet<T>& rItems) = 0; 00064 00065 /**************************************************************************/ 00068 /**************************************************************************/ 00069 virtual void MQUALIFIER clear() = 0; 00070 00071 /**************************************************************************/ 00074 /**************************************************************************/ 00075 virtual Int MQUALIFIER getCount() const = 0; 00076 00077 /**************************************************************************/ 00083 /**************************************************************************/ 00084 virtual bool MQUALIFIER hasItem(const T& rItem) const=0; 00085 00086 /**************************************************************************/ 00092 /**************************************************************************/ 00093 virtual bool MQUALIFIER hasAllItems(const ISet<T>& rItems) const = 0; 00094 00095 /************************************************************************/ 00100 /************************************************************************/ 00101 virtual IListIterator<T>* MQUALIFIER getIterator() = 0; 00102 00103 /************************************************************************/ 00108 /************************************************************************/ 00109 virtual const IListIterator<T>* MQUALIFIER getConstIterator() const = 0; 00110 00111 /************************************************************************/ 00116 /************************************************************************/ 00117 virtual bool MQUALIFIER isEmpty() const = 0; 00118 00119 /************************************************************************/ 00123 /************************************************************************/ 00124 virtual void MQUALIFIER releaseIterator(const IListIterator<T>* pIterator) const =0; 00125 00126 /************************************************************************/ 00130 /************************************************************************/ 00131 virtual bool MQUALIFIER removeItem(const T& rItem) = 0; 00132 00133 /************************************************************************/ 00137 /************************************************************************/ 00138 virtual void MQUALIFIER removeAllItems(const ISet<T>& rItems) = 0; 00139 00140 /************************************************************************/ 00144 /************************************************************************/ 00145 virtual void MQUALIFIER copyToList(IList<T>& rList) const = 0; 00146 00147 /************************************************************************/ 00151 /************************************************************************/ 00152 virtual void MQUALIFIER copyToSet(ISet<T>& rSet) const = 0; 00153 00154 /************************************************************************/ 00160 /************************************************************************/ 00161 virtual bool MQUALIFIER equals(const ISet<T>& rSet) const = 0; 00162 00163 /************************************************************************/ 00169 /************************************************************************/ 00170 virtual T& MQUALIFIER getItem() = 0; 00171 00172 /************************************************************************/ 00175 /************************************************************************/ 00176 virtual const T& MQUALIFIER getItemConst() const = 0; 00177 }; 00178 00179 00180 END_NAMESPACE_Zeus 00181 00182 #endif