4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
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 EventManager public header */
26 #ifndef HH_EventManager_
27 #define HH_EventManager_ 1
30 #include <boost/ptr_container/ptr_vector.hpp>
31 #include "../Scheduler/ClockService.hh"
33 #include "detail/Callback.hh"
34 #include "detail/EventBinding.hh"
36 //#include "EventManager.mpp"
37 ///////////////////////////////hh.p////////////////////////////////////////
42 /** \brief Event registry and control
44 The EventManager control event registration and manages global event parameters. The
45 EventManager controls event dispatch but does \e not control event generation. This is the
46 responsibility of an external component (the Scheduler)
51 ///////////////////////////////////////////////////////////////////////////
55 // Somehow doxygen barfs on this definition
56 template <class Descriptor>
58 : public detail::Callback<typename Descriptor::EventArg>
62 ///////////////////////////////////////////////////////////////////////////
63 ///\name Structors and default members
66 static EventManager & instance();
68 // default default constructor
69 // default copy constructor
70 // default copy assignment
73 // no conversion constructors
76 ///////////////////////////////////////////////////////////////////////////
78 ClockService::clock_type now(); ///< Current time at last event dispatch
79 ClockService::clock_type time(); ///< Expected time of the last event
84 template <class Descriptor>
85 void registerEvent(module::Module & module,
86 typename Callback<Descriptor>::type callback,
87 Descriptor & descriptor);
89 void destroyModule(module::Module & module);
91 typedef boost::ptr_vector<detail::EventBindingBase> EventRegistrations;
92 EventRegistrations registrations_;
94 void eventTime(ClockService::clock_type time);
96 ClockService::clock_type eventTime_;
98 friend class detail::EventBindingBase;
99 friend class module::Module;
104 ///////////////////////////////hh.e////////////////////////////////////////
105 #include "EventManager.cci"
106 #include "EventManager.ct"
107 //#include "EventManager.cti"
114 // comment-column: 40
115 // c-file-style: "senf"
116 // indent-tabs-mode: nil
117 // ispell-local-dictionary: "american"
118 // compile-command: "scons -u test"