00001 /* 00002 * $Id: BackgroundFunction.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_BACKGROUND_FUNCTION_H__ 00015 #define __XVR2_BACKGROUND_FUNCTION_H__ 00016 #include<xvr2/Function.h> 00017 #include<xvr2/FinalizerCallback.h> 00018 #include<xvr2/SharedVar.h> 00019 #include<xvr2/ThreadFinalizator.h> 00020 00021 namespace xvr2 { 00025 class BackgroundFunction:public Function, public ThreadFinalizator { 00026 protected: 00027 public: 00028 UInt64 id; 00032 SharedVar<bool> called; 00033 SharedVar<bool> terminated; 00035 BackgroundFunction(); 00037 virtual ~BackgroundFunction(); 00041 virtual void operator()(void) = 0; 00044 virtual void onStart(); 00046 virtual void onTerminate(); 00050 //void registerFinalizer(FinalizerCallback *fc); 00053 //void callFinalizers(); 00054 }; 00055 } 00056 00057 #endif