Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / PPI / Route.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 Route inline template implementation */
25
26 #include "Route.ih"
27
28 // Custom includes
29
30 #define prefix_ inline
31 //-/////////////////////////////////////////////////////////////////////////////////////////////////
32
33 //-/////////////////////////////////////////////////////////////////////////////////////////////////
34 // senf::ppi::Route<Source,Target>
35
36 template <class Source, class Target>
37 prefix_ senf::ppi::Route<Source,Target>::Route(module::Module & module, Source & source,
38                                                Target & target)
39     : Base(module,source,target)
40 {}
41
42 //-/////////////////////////////////////////////////////////////////////////////////////////////////
43 // senf::ppi::ForwardingRoute
44
45 //-/////////////////////////////////////////////////////////////////////////////////////////////////
46 // protected members
47
48 template <class T>
49 prefix_ void senf::ppi::ForwardingRoute::registerRoute(T & ob)
50 {
51     ob.registerRoute(*this);
52 }
53
54 template <class T>
55 prefix_ void senf::ppi::ForwardingRoute::unregisterRoute(T & ob)
56 {
57     ob.unregisterRoute(*this);
58 }
59
60 template <class T>
61 prefix_ void senf::ppi::ForwardingRoute::notifyThrottle(T & ob)
62 {
63     ob.notifyThrottle();
64 }
65
66 template <class T>
67 prefix_ void senf::ppi::ForwardingRoute::notifyUnthrottle(T & ob)
68 {
69     ob.notifyUnthrottle();
70 }
71
72 //-/////////////////////////////////////////////////////////////////////////////////////////////////
73 // senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>
74
75 template <class Source, class Target, class Base>
76 prefix_ Source & senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::source()
77     const
78 {
79     return *source_;
80 }
81
82 template <class Source, class Target, class Base>
83 prefix_ Target & senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::target()
84     const
85 {
86     return *target_;
87 }
88
89 //-/////////////////////////////////////////////////////////////////////////////////////////////////
90 // protected members
91
92 template <class Source, class Target, class Base>
93 prefix_ senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
94 BaseRouteImplementation(module::Module & module, Source & source, Target & target)
95     : Base(module), source_(&source), target_(&target)
96 {}
97
98 //-/////////////////////////////////////////////////////////////////////////////////////////////////
99 // private members
100
101 template <class Source, class Target, class Base>
102 prefix_ bool senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
103 v_hasConnector(connector::Connector const & conn)
104     const
105 {
106     return isSame(conn, source()) || isSame(conn, target());
107 }
108
109 template <class Source, class Target, class Base>
110 prefix_ bool senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
111 v_hasEvent(EventDescriptor const & event)
112     const
113 {
114     return isSame(event, source()) || isSame(event, target());
115 }
116
117 template <class Source, class Target, class Base>
118 prefix_ bool senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
119 isSame(connector::Connector const & conn, connector::Connector const & other)
120     const
121 {
122     return &conn == &other;
123 }
124
125 template <class Source, class Target, class Base>
126 prefix_ bool senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
127 isSame(connector::Connector const & conn, EventDescriptor const & other)
128     const
129 {
130     return false;
131 }
132
133 template <class Source, class Target, class Base>
134 prefix_ bool senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
135 isSame(EventDescriptor const & event, connector::Connector const & other)
136     const
137 {
138     return false;
139 }
140
141 template <class Source, class Target, class Base>
142 prefix_ bool senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::
143 isSame(EventDescriptor const & event, EventDescriptor const & other)
144     const
145 {
146     return &event == &other;
147 }
148
149 //-/////////////////////////////////////////////////////////////////////////////////////////////////
150 // senf::ppi::detail::ForwardingRouteImplementation<Source,Target>
151
152 //-/////////////////////////////////////////////////////////////////////////////////////////////////
153 // protected members
154
155 template <class Source, class Target>
156 prefix_
157 senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
158 ForwardingRouteImplementation(module::Module & module, Source & source, Target & target)
159     : Base(module,source,target)
160 {
161     registerRoute(source);
162     registerRoute(target);
163 }
164
165 template <class Source, class Target>
166 prefix_
167 senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
168 ~ForwardingRouteImplementation()
169 {
170     unregisterRoute(this->source());
171     unregisterRoute(this->target());
172 }
173
174 //-/////////////////////////////////////////////////////////////////////////////////////////////////
175 // private members
176
177 template <class Source, class Target>
178 template <class T>
179 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
180 notifyThrottle(T & ob, boost::mpl::bool_<true> const &)
181 {
182     ForwardingRoute::notifyThrottle(ob);
183 }
184
185 template <class Source, class Target>
186 template <class T>
187 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
188 notifyThrottle(T & ob, boost::mpl::bool_<false> const &)
189 {}
190
191 template <class Source, class Target>
192 template <class T>
193 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
194 notifyUnthrottle(T & ob, boost::mpl::bool_<true> const &)
195 {
196     ForwardingRoute::notifyUnthrottle(ob);
197 }
198
199 template <class Source, class Target>
200 template <class T>
201 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
202 notifyUnthrottle(T & ob, boost::mpl::bool_<false> const &)
203 {}
204
205 template <class Source, class Target>
206 template <class T>
207 prefix_ bool senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
208 throttled(T & ob, boost::mpl::bool_<true> const &)
209     const
210 {
211     return ob.throttled();
212 }
213
214 template <class Source, class Target>
215 template <class T>
216 prefix_ bool senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
217 throttled(T & ob, boost::mpl::bool_<false> const &)
218     const
219 {
220     return false;
221 }
222
223 //-/////////////////////////////////////////////////////////////////////////////////////////////////
224 // senf::ppi::detail::RouteImplementation2<Source,Target>
225
226 //-/////////////////////////////////////////////////////////////////////////////////////////////////
227 // protected members
228
229 template <class Source, class Target>
230 prefix_ senf::ppi::detail::RouteImplementation2<Source,Target>::
231 RouteImplementation2(module::Module & module, Source & source, Target & target)
232     : Base(module,source,target)
233 {}
234
235 //-/////////////////////////////////////////////////////////////////////////////////////////////////
236 // senf::ppi::detail::RouteImplementation<Source,Target>
237
238 //-/////////////////////////////////////////////////////////////////////////////////////////////////
239 // protected members
240
241 template <class Source, class Target>
242 prefix_ senf::ppi::detail::RouteImplementation<Source,Target>::
243 RouteImplementation(module::Module & module, Source & source, Target & target)
244     : Base(module,source,target)
245 {}
246
247 //-/////////////////////////////////////////////////////////////////////////////////////////////////
248 #undef prefix_
249
250 \f
251 // Local Variables:
252 // mode: c++
253 // fill-column: 100
254 // comment-column: 40
255 // c-file-style: "senf"
256 // indent-tabs-mode: nil
257 // ispell-local-dictionary: "american"
258 // compile-command: "scons -u test"
259 // End: