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 "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
64 return * static_cast<Self*>(this)->binding_;
67 ///////////////////////////////////////////////////////////////////////////
68 // senf::ppi::EventImplementationHelper<void,Self>
70 ////////////////////////////////////////
75 senf::ppi::EventImplementationHelper<void,Self>::callback(ClockService::clock_type time)
77 binding().callback(time);
81 prefix_ void senf::ppi::EventImplementationHelper<void,Self>::callback()
86 ////////////////////////////////////////
90 prefix_ senf::ppi::detail::EventBinding<void> &
91 senf::ppi::EventImplementationHelper<void,Self>::binding()
93 SENF_ASSERT( static_cast<Self*>(this)->binding_ &&
94 "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
95 return * static_cast<Self*>(this)->binding_;
98 ///////////////////////////////////////////////////////////////////////////
99 // senf::ppi::EventImplementation<EventType>
101 template <class EventType>
102 prefix_ senf::ppi::module::Module & senf::ppi::EventImplementation<EventType>::module()
105 return binding_->module();
108 template <class EventType>
109 prefix_ senf::ppi::EventManager & senf::ppi::EventImplementation<EventType>::manager()
112 return binding_->manager();
115 ////////////////////////////////////////
118 template <class EventType>
119 prefix_ senf::ppi::EventImplementation<EventType>::EventImplementation()
123 ////////////////////////////////////////
126 template <class EventType>
127 prefix_ bool senf::ppi::EventImplementation<EventType>::v_isRegistered()
132 template <class EventType>
134 senf::ppi::EventImplementation<EventType>::setBinding(detail::EventBinding<Event> & binding)
136 binding_ = & binding;
139 ///////////////////////////////cti.e///////////////////////////////////////
146 // comment-column: 40
147 // c-file-style: "senf"
148 // indent-tabs-mode: nil
149 // ispell-local-dictionary: "american"
150 // compile-command: "scons -u test"