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 Events inline template implementation */
29 #include "../Utils/senfassert.hh"
30 #include "detail/EventBinding.hh"
32 #define prefix_ inline
33 ///////////////////////////////cti.p///////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////////////
36 // senf::ppi::EventImplementationHelper<EventType,Self>
38 ////////////////////////////////////////
41 template <class EventType, class Self>
43 senf::ppi::EventImplementationHelper<EventType,Self>::callback(EventArg event,
44 ClockService::clock_type time)
46 binding().callback(event,time);
49 template <class EventType, class Self>
50 prefix_ void senf::ppi::EventImplementationHelper<EventType,Self>::callback(EventArg event)
52 binding().callback(event);
55 ////////////////////////////////////////
58 template <class EventType, class Self>
59 prefix_ senf::ppi::detail::EventBinding<EventType> &
60 senf::ppi::EventImplementationHelper<EventType,Self>::binding()
62 SENF_ASSERT( static_cast<Self*>(this)->binding_ );
63 return * static_cast<Self*>(this)->binding_;
66 ///////////////////////////////////////////////////////////////////////////
67 // senf::ppi::EventImplementationHelper<void,Self>
69 ////////////////////////////////////////
74 senf::ppi::EventImplementationHelper<void,Self>::callback(ClockService::clock_type time)
76 binding().callback(time);
80 prefix_ void senf::ppi::EventImplementationHelper<void,Self>::callback()
85 ////////////////////////////////////////
89 prefix_ senf::ppi::detail::EventBinding<void> &
90 senf::ppi::EventImplementationHelper<void,Self>::binding()
92 SENF_ASSERT( static_cast<Self*>(this)->binding_ );
93 return * static_cast<Self*>(this)->binding_;
96 ///////////////////////////////////////////////////////////////////////////
97 // senf::ppi::EventImplementation<EventType>
99 template <class EventType>
100 prefix_ senf::ppi::module::Module & senf::ppi::EventImplementation<EventType>::module()
103 return binding_->module();
106 template <class EventType>
107 prefix_ senf::ppi::EventManager & senf::ppi::EventImplementation<EventType>::manager()
110 return binding_->manager();
113 ////////////////////////////////////////
116 template <class EventType>
117 prefix_ senf::ppi::EventImplementation<EventType>::EventImplementation()
121 ////////////////////////////////////////
124 template <class EventType>
125 prefix_ bool senf::ppi::EventImplementation<EventType>::v_isRegistered()
130 template <class EventType>
132 senf::ppi::EventImplementation<EventType>::setBinding(detail::EventBinding<Event> & binding)
134 binding_ = & binding;
137 ///////////////////////////////cti.e///////////////////////////////////////
144 // comment-column: 40
145 // c-file-style: "senf"
146 // indent-tabs-mode: nil
147 // ispell-local-dictionary: "american"
148 // compile-command: "scons -u test"