Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / PPI / detail / EventBinding.cti
1 // $Id$
2 //
3 // Copyright (C) 2007
4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 //     Stefan Bund <g0dil@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief EventBinding inline template implementation */
25
26 //#include "EventBinding.ih"
27
28 // Custom includes
29 #include <senf/PPI/EventManager.hh>
30
31 #define prefix_ inline
32 //-/////////////////////////////////////////////////////////////////////////////////////////////////
33
34 //-/////////////////////////////////////////////////////////////////////////////////////////////////
35 // senf::ppi::detail::EventBindingHelper<EventType,Self>
36
37 template <class EventType, class Self>
38 prefix_ void
39 senf::ppi::detail::EventBindingHelper<EventType,Self>::callback(EventArg event,
40                                                                 ClockService::clock_type time)
41 {
42     self().eventTime(time);
43     self().callback_(event);
44 }
45
46 template <class EventType, class Self>
47 prefix_ void senf::ppi::detail::EventBindingHelper<EventType,Self>::callback(EventArg event)
48 {
49     callback(event, self().manager().now());
50 }
51
52 //-/////////////////////////////////////////////////////////////////////////////////////////////////
53 // private members
54
55 template <class EventType, class Self>
56 prefix_ Self & senf::ppi::detail::EventBindingHelper<EventType,Self>::self()
57 {
58     return * static_cast<Self*>(this);
59 }
60
61 //-/////////////////////////////////////////////////////////////////////////////////////////////////
62 // senf::ppi::detail::EventBindingHelper<void,Self>
63
64 template <class Self>
65 prefix_ void
66 senf::ppi::detail::EventBindingHelper<void,Self>::callback(ClockService::clock_type time)
67 {
68     self().eventTime(time);
69     self().callback_();
70 }
71
72 template <class Self>
73 prefix_ void senf::ppi::detail::EventBindingHelper<void,Self>::callback()
74 {
75     callback(self().manager().now());
76 }
77
78 //-/////////////////////////////////////////////////////////////////////////////////////////////////
79 // private members
80
81 template <class Self>
82 prefix_ Self & senf::ppi::detail::EventBindingHelper<void,Self>::self()
83 {
84     return * static_cast<Self*>(this);
85 }
86
87 //-/////////////////////////////////////////////////////////////////////////////////////////////////
88 // senf::ppi::detail::EventBinding<EvImpl>
89
90 template <class EventType>
91 prefix_ senf::ppi::detail::EventBinding<EventType>::EventBinding(EventManager & manager,
92                                                                  module::Module & module,
93                                                                  Callback callback,
94                                                                  EventDescriptor & descriptor)
95     : EventBindingBase(manager, module, descriptor), callback_(callback)
96 {}
97
98 //-/////////////////////////////////////////////////////////////////////////////////////////////////
99 #undef prefix_
100
101 \f
102 // Local Variables:
103 // mode: c++
104 // fill-column: 100
105 // comment-column: 40
106 // c-file-style: "senf"
107 // indent-tabs-mode: nil
108 // ispell-local-dictionary: "american"
109 // compile-command: "scons -u ../test"
110 // End: