4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
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 Route internal header */
31 ///////////////////////////////ih.p////////////////////////////////////////
37 // Valid Forwarding routes:
39 // ActiveInput -> PassiveOutput
40 // tempalte<> RouteImplementation<ActiveInput,PassiveOutput,false,false>
41 // ActiveInput -> Event
42 // template<class Event> class RouteImplementation<ActiveInput, Event, false, true>
43 // Backward throttling
44 // PassiveInput -> ActiveOutput
45 // template<> RouteImplementation<PassiveInput, ActiveOutput, false, false>
46 // Event -> ActiveOutput
47 // template<class Event> class RouteImplementation<Event, ActiveOutput, true, false>
49 class NonForwardingRouteImplementation
53 NonForwardingRouteImplementation(module::Module & module,
54 connector::InputConnector & source,
55 connector::OutputConnector & target);
58 connector::InputConnector * source_;
59 connector::OutputConnector * target_;
62 class NonForwardingRouteToEventImplementation
66 NonForwardingRouteToEventImplementation(module::Module & module,
67 connector::InputConnector & source,
68 EventDescriptor & target);
71 connector::InputConnector * source_;
72 EventDescriptor * target_;
75 class NonForwardingRouteFromEventImplementation
79 NonForwardingRouteFromEventImplementation(module::Module & module,
80 EventDescriptor & source,
81 connector::OutputConnector & target);
84 EventDescriptor * source_;
85 connector::OutputConnector * target_;
88 class ForwardForwardingRouteImplementation
89 : public ForwardingRoute
92 ForwardForwardingRouteImplementation(module::Module & module,
93 connector::ActiveInput & source,
94 connector::PassiveOutput & target);
97 virtual void v_notifyThrottle();
98 virtual void v_notifyUnthrottle();
100 connector::ActiveInput * source_;
101 connector::PassiveOutput * target_;
104 class BackwardForwardingRouteImplementation
105 : public ForwardingRoute
108 BackwardForwardingRouteImplementation(module::Module & module,
109 connector::PassiveInput & source,
110 connector::ActiveOutput & target);
113 virtual void v_notifyThrottle();
114 virtual void v_notifyUnthrottle();
116 connector::PassiveInput * source_;
117 connector::ActiveOutput * target_;
120 class ForwardForwardingRouteToEventImplementation
121 : public ForwardingRoute
124 ForwardForwardingRouteToEventImplementation(module::Module & module,
125 connector::ActiveInput & source,
126 EventDescriptor & target);
129 virtual void v_notifyThrottle();
130 virtual void v_notifyUnthrottle();
132 connector::ActiveInput * source_;
133 EventDescriptor * target_;
136 class BackwardForwardingRouteFromEventImplementation
137 : public ForwardingRoute
140 BackwardForwardingRouteFromEventImplementation(module::Module & module,
141 EventDescriptor & source,
142 connector::ActiveOutput & target);
145 virtual void v_notifyThrottle();
146 virtual void v_notifyUnthrottle();
148 EventDescriptor * source_;
149 connector::ActiveOutput * target_;
152 template <class Source, class Target, bool srcEvent, bool trgEvent>
153 class RouteImplementation
154 : public NonForwardingRouteImplementation
157 RouteImplementation(module::Module & module, Source & source, Target & target);
162 template <class Source, class Target>
163 class RouteImplementation<Source, Target, true, false>
164 : public NonForwardingRouteFromEventImplementation
167 RouteImplementation(module::Module & module, Source & source, Target & target);
170 template<class Source, class Target>
171 class RouteImplementation<Source, Target, false, true>
172 : public NonForwardingRouteToEventImplementation
175 RouteImplementation(module::Module & module, Source & source, Target & target);
179 class RouteImplementation<connector::ActiveInput, connector::PassiveOutput, false, false>
180 : public ForwardForwardingRouteImplementation
183 RouteImplementation(module::Module & module, connector::ActiveInput & source,
184 connector::PassiveOutput & target);
187 template <class Event>
188 class RouteImplementation<connector::ActiveInput, Event, false, true>
189 : public ForwardForwardingRouteToEventImplementation
192 RouteImplementation(module::Module & module, connector::ActiveInput & source,
197 class RouteImplementation<connector::PassiveInput, connector::ActiveOutput, false, false>
198 : public BackwardForwardingRouteImplementation
201 RouteImplementation(module::Module & module, connector::PassiveInput & source,
202 connector::ActiveOutput & target);
205 template <class Event>
206 class RouteImplementation<Event, connector::ActiveOutput, true, false>
207 : public BackwardForwardingRouteFromEventImplementation
210 RouteImplementation(module::Module & module, Event & source,
211 connector::ActiveOutput & target);
218 ///////////////////////////////ih.e////////////////////////////////////////
225 // comment-column: 40
226 // c-file-style: "senf"
227 // indent-tabs-mode: nil
228 // ispell-local-dictionary: "american"
229 // compile-command: "scons -u test"