4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief Events inline template implementation */
34 #include <senf/Utils/senfassert.hh>
35 #include "detail/EventBinding.hh"
37 #define prefix_ inline
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
40 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41 // senf::ppi::EventImplementationHelper<EventType,Self>
43 //-/////////////////////////////////////////////////////////////////////////////////////////////////
46 template <class EventType, class Self>
48 senf::ppi::EventImplementationHelper<EventType,Self>::callback(EventArg event,
49 ClockService::clock_type time)
51 binding().callback(event,time);
54 template <class EventType, class Self>
55 prefix_ void senf::ppi::EventImplementationHelper<EventType,Self>::callback(EventArg event)
57 binding().callback(event);
60 //-/////////////////////////////////////////////////////////////////////////////////////////////////
63 template <class EventType, class Self>
64 prefix_ senf::ppi::detail::EventBinding<EventType> &
65 senf::ppi::EventImplementationHelper<EventType,Self>::binding()
67 SENF_ASSERT( static_cast<Self*>(this)->binding_,
68 "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
69 return * static_cast<Self*>(this)->binding_;
72 //-/////////////////////////////////////////////////////////////////////////////////////////////////
73 // senf::ppi::EventImplementationHelper<void,Self>
75 //-/////////////////////////////////////////////////////////////////////////////////////////////////
80 senf::ppi::EventImplementationHelper<void,Self>::callback(ClockService::clock_type time)
82 binding().callback(time);
86 prefix_ void senf::ppi::EventImplementationHelper<void,Self>::callback()
91 //-/////////////////////////////////////////////////////////////////////////////////////////////////
95 prefix_ senf::ppi::detail::EventBinding<void> &
96 senf::ppi::EventImplementationHelper<void,Self>::binding()
98 SENF_ASSERT( static_cast<Self*>(this)->binding_,
99 "senf::ppi::EventImplementationHelper::binding(): Missing registerEvent()" );
100 return * static_cast<Self*>(this)->binding_;
103 //-/////////////////////////////////////////////////////////////////////////////////////////////////
104 // senf::ppi::EventImplementation<EventType>
106 template <class EventType>
107 prefix_ senf::ppi::module::Module & senf::ppi::EventImplementation<EventType>::module()
110 return binding_->module();
113 template <class EventType>
114 prefix_ senf::ppi::EventManager & senf::ppi::EventImplementation<EventType>::manager()
117 return binding_->manager();
120 //-/////////////////////////////////////////////////////////////////////////////////////////////////
123 template <class EventType>
124 prefix_ senf::ppi::EventImplementation<EventType>::EventImplementation()
128 //-/////////////////////////////////////////////////////////////////////////////////////////////////
131 template <class EventType>
132 prefix_ bool senf::ppi::EventImplementation<EventType>::v_isRegistered()
137 template <class EventType>
139 senf::ppi::EventImplementation<EventType>::setBinding(detail::EventBinding<Event> & binding)
141 binding_ = & binding;
144 //-/////////////////////////////////////////////////////////////////////////////////////////////////
151 // comment-column: 40
152 // c-file-style: "senf"
153 // indent-tabs-mode: nil
154 // ispell-local-dictionary: "american"
155 // compile-command: "scons -u test"