|
PPL
0.12.1
|
00001 /* Handler and derived classes' declaration. 00002 Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it> 00003 Copyright (C) 2010-2012 BUGSENG srl (http://bugseng.com) 00004 00005 This file is part of the Parma Polyhedra Library (PPL). 00006 00007 The PPL is free software; you can redistribute it and/or modify it 00008 under the terms of the GNU General Public License as published by the 00009 Free Software Foundation; either version 3 of the License, or (at your 00010 option) any later version. 00011 00012 The PPL is distributed in the hope that it will be useful, but WITHOUT 00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software Foundation, 00019 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. 00020 00021 For the most up-to-date information see the Parma Polyhedra Library 00022 site: http://bugseng.com/products/ppl/ . */ 00023 00024 #ifndef PPL_Handler_defs_hh 00025 #define PPL_Handler_defs_hh 1 00026 00027 #include "Handler.types.hh" 00028 00030 class Parma_Polyhedra_Library::Implementation::Watchdog::Handler { 00031 public: 00033 virtual void act() const = 0; 00034 00036 virtual ~Handler(); 00037 }; 00038 00040 00059 template <typename Flag_Base, typename Flag> 00060 class Parma_Polyhedra_Library::Implementation::Watchdog::Handler_Flag 00061 : public Handler { 00062 public: 00064 Handler_Flag(const Flag_Base* volatile& holder, Flag& flag); 00065 00070 virtual void act() const; 00071 00072 private: 00073 // declare holder as reference to volatile pointer to const Flag_Base 00074 const Flag_Base* volatile& h; 00075 Flag& f; 00076 }; 00077 00079 class Parma_Polyhedra_Library::Implementation::Watchdog::Handler_Function 00080 : public Handler { 00081 public: 00083 Handler_Function(void (*function)()); 00084 00086 virtual void act() const; 00087 00088 private: 00090 void (*f)(); 00091 }; 00092 00093 #include "Handler.inlines.hh" 00094 00095 #endif // !defined(PPL_Handler_defs_hh)