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 Jack public header */
26 #ifndef HH_SENF_PPI_Jack_
27 #define HH_SENF_PPI_Jack_ 1
30 #include <boost/utility.hpp>
31 #include <boost/type_traits.hpp>
32 #include "Connectors.hh"
36 ///////////////////////////////hh.p////////////////////////////////////////
42 /** \brief Connector Jack base class
43 \see \ref ppi_jacks */
45 : private boost::noncopyable, private ppi::detail::DisableStandardConnect
48 /** \brief Jack referencing an ActiveInput
49 \see \ref ppi_jacks */
50 class GenericActiveInputJack
54 explicit GenericActiveInputJack(GenericActiveInput & input);
56 GenericActiveInput & connector(); ///< Get referenced connector
58 void reset(GenericActiveInput & input); ///< Change connector
59 /**< Will update any existing connection accordingly */
62 GenericActiveInput * input_;
65 /** \brief Jack referencing an ActiveOutput
66 \see \ref ppi_jacks */
67 class GenericActiveOutputJack
71 explicit GenericActiveOutputJack(GenericActiveOutput & output);
73 GenericActiveOutput & connector(); ///< Get referenced connector
75 void reset(GenericActiveOutput & output); ///< Change connector
76 /**< Will update any existing connection accordingly */
79 GenericActiveOutput * output_;
82 /** \brief Jack referencing a PassiveInput
83 \see \ref ppi_jacks */
84 class GenericPassiveInputJack
88 explicit GenericPassiveInputJack(GenericPassiveInput & input);
90 GenericPassiveInput & connector(); ///< Get referenced connector
92 void reset(GenericPassiveInput & input); ///< Change connector
93 /**< Will update any existing connection accordingly */
96 GenericPassiveInput * input_;
99 /** \brief Jack referencing a PassiveOutput
100 \see \ref ppi_jacks */
101 class GenericPassiveOutputJack
105 explicit GenericPassiveOutputJack(GenericPassiveOutput & output);
107 GenericPassiveOutput & connector(); ///< Get referenced connector
109 void reset(GenericPassiveOutput & output); ///< Change connector
110 /**< Will update any existing connection accordingly */
113 GenericPassiveOutput * output_;
116 /** \brief Jack with packet type referencing an ActiveInput
117 \see \ref ppi_jacks */
118 template <class PacketType=Packet>
119 class ActiveInputJack
120 : public GenericActiveInputJack
123 explicit ActiveInputJack(ActiveInput<PacketType> & input);
124 explicit ActiveInputJack(ActiveInput<> & input);
126 explicit ActiveInputJack(ActiveInputJack & input);
127 explicit ActiveInputJack(ActiveInputJack<> & input);
129 void reset(ActiveInput<PacketType> & input);
130 void reset(ActiveInput<> & input);
132 void reset(ActiveInputJack & input);
133 void reset(ActiveInputJack<> & input);
139 class ActiveInputJack<Packet>
140 : public GenericActiveInputJack
143 explicit ActiveInputJack(GenericActiveInput & input);
144 explicit ActiveInputJack(GenericActiveInputJack input);
146 void reset(GenericActiveInput & input);
147 void reset(GenericActiveInputJack input);
152 /** \brief Jack with packet type referencing an ActiveOutput
153 \see \ref ppi_jacks */
154 template <class PacketType=Packet>
155 class ActiveOutputJack
156 : public GenericActiveOutputJack
159 explicit ActiveOutputJack(ActiveOutput<PacketType> & output);
160 explicit ActiveOutputJack(ActiveOutput<> & output);
162 explicit ActiveOutputJack(ActiveOutputJack & output);
163 explicit ActiveOutputJack(ActiveOutputJack<> & output);
165 void reset(ActiveOutput<PacketType> & output);
166 void reset(ActiveOutput<> & output);
168 void reset(ActiveOutputJack & output);
169 void reset(ActiveOutputJack<> & output);
175 class ActiveOutputJack<Packet>
176 : public GenericActiveOutputJack
179 explicit ActiveOutputJack(GenericActiveOutput & output);
180 explicit ActiveOutputJack(GenericActiveOutputJack & output);
182 void reset(GenericActiveOutput & output);
183 void reset(GenericActiveOutputJack & output);
188 /** \brief Jack with packet type referencing a PassiveInput
189 \see \ref ppi_jacks */
190 template <class PacketType=Packet>
191 class PassiveInputJack
192 : public GenericPassiveInputJack
195 explicit PassiveInputJack(PassiveInput<PacketType> & input);
196 explicit PassiveInputJack(PassiveInput<> & input);
198 explicit PassiveInputJack(PassiveInputJack & input);
199 explicit PassiveInputJack(PassiveInputJack<> & input);
201 void reset(PassiveInput<PacketType> & input);
202 void reset(PassiveInput<> & input);
204 void reset(PassiveInputJack & input);
205 void reset(PassiveInputJack<> & input);
211 class PassiveInputJack<Packet>
212 : public GenericPassiveInputJack
215 explicit PassiveInputJack(GenericPassiveInput & input);
216 explicit PassiveInputJack(GenericPassiveInputJack & input);
218 void reset(GenericPassiveInput & input);
219 void reset(GenericPassiveInputJack & input);
224 /** \brief Jack with packet type referencing a PassiveOutput
225 \see \ref ppi_jacks */
226 template <class PacketType=Packet>
227 class PassiveOutputJack
228 : public GenericPassiveOutputJack
231 explicit PassiveOutputJack(PassiveOutput<PacketType> & output);
232 explicit PassiveOutputJack(PassiveOutput<> & output);
234 explicit PassiveOutputJack(PassiveOutputJack & output);
235 explicit PassiveOutputJack(PassiveOutputJack<> & output);
237 void reset(PassiveOutput<PacketType> & output);
238 void reset(PassiveOutput<> & output);
240 void reset(PassiveOutputJack & output);
241 void reset(PassiveOutputJack<> & output);
247 class PassiveOutputJack<Packet>
248 : public GenericPassiveOutputJack
251 explicit PassiveOutputJack(GenericPassiveOutput & output);
252 explicit PassiveOutputJack(GenericPassiveOutputJack & output);
254 void reset(GenericPassiveOutput & output);
255 void reset(GenericPassiveOutputJack & output);
264 void connect(connector::GenericActiveOutputJack & source, T & target,
265 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
267 void connect(connector::GenericPassiveOutputJack & source, T & target,
268 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
271 void connect(T & source, connector::GenericActiveInputJack & target,
272 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
274 void connect(T & source, connector::GenericPassiveInputJack & target,
275 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
277 void connect(connector::GenericActiveOutputJack & source,
278 connector::GenericPassiveInputJack & target);
279 void connect(connector::GenericPassiveOutputJack & source,
280 connector::GenericActiveInputJack & target);
282 void connect(connector::GenericActiveOutputJack & source,
283 connector::GenericPassiveInput & target);
284 void connect(connector::GenericPassiveOutputJack & source,
285 connector::GenericActiveInput & target);
287 void connect(connector::GenericActiveOutput & source,
288 connector::GenericPassiveInputJack & target);
289 void connect(connector::GenericPassiveOutput & source,
290 connector::GenericActiveInputJack & target);
295 ///////////////////////////////hh.e////////////////////////////////////////
305 // comment-column: 40
306 // c-file-style: "senf"
307 // indent-tabs-mode: nil
308 // ispell-local-dictionary: "american"
309 // compile-command: "scons -u test"