PPL  1.2
Handler_defs.hh
Go to the documentation of this file.
1 /* Handler and derived classes' declaration.
2  Copyright (C) 2001-2010 Roberto Bagnara <bagnara@cs.unipr.it>
3  Copyright (C) 2010-2016 BUGSENG srl (http://bugseng.com)
4 
5 This file is part of the Parma Polyhedra Library (PPL).
6 
7 The PPL is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 The PPL is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software Foundation,
19 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
20 
21 For the most up-to-date information see the Parma Polyhedra Library
22 site: http://bugseng.com/products/ppl/ . */
23 
24 #ifndef PPL_Handler_defs_hh
25 #define PPL_Handler_defs_hh 1
26 
27 #include "Handler_types.hh"
28 
31 public:
33  virtual void act() const = 0;
34 
36  virtual ~Handler();
37 };
38 
40 
60 template <typename Flag_Base, typename Flag>
62  : public Handler {
63 public:
65  Handler_Flag(const Flag_Base* volatile& holder, Flag& flag);
66 
71  virtual void act() const;
72 
73 private:
74  // Declare holder as reference to volatile pointer to const Flag_Base.
75  const Flag_Base* volatile& h;
76  Flag& f;
77 };
78 
81  : public Handler {
82 public:
84  Handler_Function(void (* const function)());
85 
87  virtual void act() const;
88 
89 private:
91  void (* const f)();
92 };
93 
94 #include "Handler_inlines.hh"
95 
96 #endif // !defined(PPL_Handler_defs_hh)
Handler_Function(void(*const function)())
Constructor with a given function.
Abstract base class for handlers of the watchdog events.
Definition: Handler_defs.hh:30
Handler_Flag(const Flag_Base *volatile &holder, Flag &flag)
Constructor with a given function.
A kind of Handler that installs a flag onto a flag-holder.
Definition: Handler_defs.hh:61
void(*const f)()
Pointer to the embedded function.
Definition: Handler_defs.hh:91
virtual void act() const
Does its job: calls the embedded function.
Definition: Handler.cc:33
virtual void act() const
Does its job: installs the flag onto the holder, if a flag with an higher priority has not already be...