00001 /* 00002 * $Id: ThreadFinalizator.h 562 2007-12-02 08:04:16Z mindstorm2600 $ 00003 * 00004 * X-VR2 00005 * 00006 * Copyright (C) Juan V. Guerrero 2007 00007 * 00008 * Juan V. Guerrero <mindstorm2600@users.sourceforge.net> 00009 * 00010 * This program is free software, distributed under the terms of 00011 * the GNU General Public License Version 2. See the LICENSE file 00012 * at the top of the source tree. 00013 */ 00014 #ifndef __XVR2_THREAD_FINALIZATOR_H__ 00015 #define __XVR2_THREAD_FINALIZATOR_H__ 00016 #include<xvr2/FinalizerCallback.h> 00017 #include<deque> 00018 00019 namespace xvr2 { 00023 class ThreadFinalizator : public xvr2::Object { 00024 private: 00025 protected: 00027 std::deque<FinalizerCallback *> finalizers; 00029 std::deque<FinalizerCallback *> cancelCBs; 00031 ThreadFinalizator(); 00032 public: 00035 void registerFinalizer(FinalizerCallback *f_cb); 00038 void registerCancellationCB(FinalizerCallback *f_cb); 00041 void callFinalizers(); 00044 void callCancellationCallbacks(); 00047 void removeCancellationCBs(); 00048 00049 }; 00050 00051 } 00052 00053 #endif 00054