00001 #ifndef TAGCOLL_COLLECTION_H 00002 #define TAGCOLL_COLLECTION_H 00003 00008 /* 00009 * Copyright (C) 2003,2004,2005 Enrico Zini <enrico@debian.org> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Lesser General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2.1 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Lesser General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00024 */ 00025 00026 #include <tagcoll/ReadonlyCollection.h> 00027 #include <tagcoll/Consumer.h> 00028 00029 namespace Tagcoll 00030 { 00031 template<typename T1, typename T2> class PatchList; 00032 00040 template<typename ITEM, typename TAG> 00041 class Collection : public Consumer<ITEM, TAG>, public ReadonlyCollection<ITEM, TAG> 00042 { 00043 protected: 00044 /* 00045 * Implementation note: to avoid problems with classes implementing only 00046 * some of the virtual methods, they are given different names. The common 00047 * 'comsume' methods are just inlined calls to the right virtual functions, 00048 * and are a way of keeping the unoverridden methods from being hidden. 00049 */ 00050 00051 void consumeItemUntagged(const ITEM&) {} 00052 void consumeItemsUntagged(const OpSet<ITEM>&) {} 00053 00054 public: 00055 virtual ~Collection() {} 00056 00069 virtual void applyChange(const PatchList<ITEM, TAG>& change) = 0; 00070 }; 00071 00072 }; 00073 00074 // vim:set ts=4 sw=4: 00075 #endif