| VRS - The Virtual Rendering System |
| version 3.3 |
00001 /****************************************************************************** 00002 * VRS - The Virtual Rendering System 00003 * Copyright (C) 2000-2004 Computer Graphics Systems Group at the 00004 * Hasso-Plattner-Institute (HPI), Potsdam, Germany. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU Lesser General Public License as published by 00008 * the Free Software Foundation; either version 2.1 of the License, or (at 00009 * your option) any later version. This library is distributed in the hope 00010 * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied 00011 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Lesser General Public License for more details. You should have received 00013 * a copy of the GNU Lesser+ General Public License along with this library; if 00014 * not, write to the FreeSoftware Foundation, Inc., 59 Temple Place, Suite 330, 00015 * Boston, MA, 02111-1307, USA. 00016 ******************************************************************************/ 00017 00018 // $Id: cachedengineresource.h 4423 2004-10-25 15:26:30Z kirsch $ 00019 // 00020 // $Log$ 00021 // Revision 1.1 2004/10/25 15:26:30 kirsch 00022 // - renamed CachedEngineGLResource to CachedEngineResource 00023 // - moved CachedEngineResource to separate file 00024 // - CachedEngineResource now accepts all kinds of engines. Callbacks 00025 // are still only registered to EngineGL-objects 00026 // 00027 // Revision 1.4 2004/10/22 11:15:04 kirsch 00028 // added convenience class CachedEngineGLResource 00029 // 00030 // Revision 1.3 2004/10/22 06:57:35 baumann 00031 // code cleanup 00032 // 00033 // Revision 1.2 2004/10/21 16:22:17 kirsch 00034 // fixed comment 00035 // 00036 // Revision 1.1 2004/10/21 09:02:33 kirsch 00037 // added cached resource 00038 // 00039 00040 #ifndef VRS_CONTAINER_CACHEDENGINERESOURCE_H 00041 #define VRS_CONTAINER_CACHEDENGINERESOURCE_H 00042 00043 #include <vrs/container/cachedresource.h> 00044 #include <vrs/methodcallback.h> 00045 00046 namespace VRS { 00047 00048 class Engine; 00049 class EngineGL; 00050 00054 template<typename KEY, typename RESOURCE> 00055 class CachedEngineResource : public CachedResource<KEY, RESOURCE> { 00056 public: 00057 CachedEngineResource(Engine* = 0, unsigned int frames = 10); 00062 virtual ~CachedEngineResource(); 00065 virtual void setEngine(Engine*); 00067 00071 virtual bool isCleanUpRegistered(); 00076 virtual void cleanUp(SO<EngineGL>); 00078 00087 private: 00088 WO<EngineGL> m_engine; 00089 SO<MethodCallback1<CachedEngineResource<KEY, RESOURCE>, SO<EngineGL> > > m_engine_callback; 00090 }; 00091 00092 } // namespace VRS 00093 00094 #include "cachedengineresource.tli" 00095 00096 #endif // VRS_CONTAINER_CACHEDENGINERESOURCE_H