4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief TimerSource public header */
26 #ifndef HH_SENF_Scheduler_TimerSource_
27 #define HH_SENF_Scheduler_TimerSource_ 1
30 #include <boost/utility.hpp>
32 #include "ClockService.hh"
33 #include "FdManager.hh"
35 //#include "TimerSource.mpp"
36 ///////////////////////////////hh.p////////////////////////////////////////
46 virtual ~TimerSource();
48 virtual void timeout(ClockService::clock_type timeout) = 0;
49 virtual void notimeout() = 0;
51 virtual void enable() = 0;
52 virtual void disable() = 0;
58 class POSIXTimerSource
59 : public detail::FdManager::Event, public TimerSource
65 virtual void timeout(ClockService::clock_type timeout);
66 virtual void notimeout();
68 virtual void enable();
69 virtual void disable();
72 static void sigHandler(int signal, ::siginfo_t * siginfo, void *);
73 virtual void signal(int events);
77 ClockService::clock_type timeout_;
88 virtual void timeout(ClockService::clock_type timeout);
89 virtual void notimeout();
91 virtual void enable();
92 virtual void disable();
96 class TimerFDTimerSource
97 : public detail::FdManager::Event, public TimerSource
100 TimerFDTimerSource();
101 ~TimerFDTimerSource();
103 virtual void timeout(ClockService::clock_type timeout);
104 virtual void notimeout();
106 virtual void enable();
107 virtual void disable();
109 static bool haveTimerFD();
112 virtual void signal(int events);
116 bool timeoutEnabled_;
117 ClockService::clock_type timeout_;
123 ///////////////////////////////hh.e////////////////////////////////////////
124 #include "TimerSource.cci"
125 //#include "TimerSource.ct"
126 //#include "TimerSource.cti"
133 // comment-column: 40
134 // c-file-style: "senf"
135 // indent-tabs-mode: nil
136 // ispell-local-dictionary: "american"
137 // compile-command: "scons -u test"