00001 /*************************************************************************** 00002 * Copyright (C) 2008 by Benjamin Hadorn (b_hadorn@bluewin.ch) * 00003 *************************************************************************** 00004 * Projekt : Zeus Base Library 00005 * Module : ManagedSet 00006 * Package : System 00007 * Author : Benjamin Hadorn 00008 * Datum : $Date: 5.10.09 22:23 $ 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/ManagedSet.hpp $ 00031 ** 00032 ** 2 5.10.09 22:23 Bha 00033 ** improving speed using inline methods 00034 ** 00035 ** 1 6.10.08 7:33 Bha 00036 ** created 00037 ***************************************************************************/ 00038 00039 #ifndef ManagedSetHPP 00040 #define ManagedSetHPP 00041 00042 00043 #include <zeusbase/System/Set.hpp> 00044 #include <zeusbase/System/ZObject.h> 00045 #include <zeusbase/System/AutoPtr.hpp> 00046 00047 BEGIN_NAMESPACE_Zeus 00048 00049 /**************************************************************************/ 00052 /**************************************************************************/ 00053 template <class T> class TManagedSet : public TSet<TAutoPtr<T> > 00054 { 00055 public: 00056 00057 /***********************************************************************/ 00060 /***********************************************************************/ 00061 inline TManagedSet() : TSet<TAutoPtr<T> >(TAutoPtr<T>(NULL)) 00062 { 00063 } 00064 00065 /************************************************************************/ 00068 /************************************************************************/ 00069 inline virtual bool MQUALIFIER addItem(const TAutoPtr<T>& rItem) 00070 { 00071 return TSet<TAutoPtr<T> >::addItem(rItem); 00072 } 00073 00074 /************************************************************************/ 00080 /************************************************************************/ 00081 inline virtual bool addItem(const T* pData, bool bAddReference) 00082 { 00083 return TSet<TAutoPtr<T> >::addItem(TAutoPtr<T>(pData, bAddReference)); 00084 } 00085 00086 /************************************************************************/ 00092 /************************************************************************/ 00093 inline virtual bool addItem(const T& rData, bool bAddReference) 00094 { 00095 return TSet<TAutoPtr<T> >::addItem(TAutoPtr<T>(rData, bAddReference)); 00096 } 00097 }; 00098 00099 END_NAMESPACE_Zeus 00100 00101 #endif 00102