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 Jack public header */
31 #ifndef HH_SENF_PPI_Jack_
32 #define HH_SENF_PPI_Jack_ 1
35 #include <boost/utility.hpp>
36 #include <boost/type_traits.hpp>
37 #include "Connectors.hh"
41 //-/////////////////////////////////////////////////////////////////////////////////////////////////
47 /** \brief Connector Jack base class
48 \see \ref ppi_jacks */
50 : private boost::noncopyable, private ppi::detail::DisableStandardConnect
53 /** \brief Jack referencing an ActiveInput
54 \see \ref ppi_jacks */
55 class GenericActiveInputJack
59 explicit GenericActiveInputJack(GenericActiveInput & input);
61 GenericActiveInput & connector(); ///< Get referenced connector
63 void reset(GenericActiveInput & input); ///< Change connector
64 /**< Will update any existing connection accordingly */
67 GenericActiveInput * input_;
70 /** \brief Jack referencing an ActiveOutput
71 \see \ref ppi_jacks */
72 class GenericActiveOutputJack
76 explicit GenericActiveOutputJack(GenericActiveOutput & output);
78 GenericActiveOutput & connector(); ///< Get referenced connector
80 void reset(GenericActiveOutput & output); ///< Change connector
81 /**< Will update any existing connection accordingly */
84 GenericActiveOutput * output_;
87 /** \brief Jack referencing a PassiveInput
88 \see \ref ppi_jacks */
89 class GenericPassiveInputJack
93 explicit GenericPassiveInputJack(GenericPassiveInput & input);
95 GenericPassiveInput & connector(); ///< Get referenced connector
97 void reset(GenericPassiveInput & input); ///< Change connector
98 /**< Will update any existing connection accordingly */
101 GenericPassiveInput * input_;
104 /** \brief Jack referencing a PassiveOutput
105 \see \ref ppi_jacks */
106 class GenericPassiveOutputJack
110 explicit GenericPassiveOutputJack(GenericPassiveOutput & output);
112 GenericPassiveOutput & connector(); ///< Get referenced connector
114 void reset(GenericPassiveOutput & output); ///< Change connector
115 /**< Will update any existing connection accordingly */
118 GenericPassiveOutput * output_;
121 /** \brief Jack with packet type referencing an ActiveInput
122 \see \ref ppi_jacks */
123 template <class PacketType=Packet>
124 class ActiveInputJack
125 : public GenericActiveInputJack
128 explicit ActiveInputJack(ActiveInput<PacketType> & input);
129 explicit ActiveInputJack(ActiveInput<> & input);
131 explicit ActiveInputJack(ActiveInputJack & input);
132 explicit ActiveInputJack(ActiveInputJack<> & input);
134 void reset(ActiveInput<PacketType> & input);
135 void reset(ActiveInput<> & input);
137 void reset(ActiveInputJack & input);
138 void reset(ActiveInputJack<> & input);
144 class ActiveInputJack<Packet>
145 : public GenericActiveInputJack
148 explicit ActiveInputJack(GenericActiveInput & input);
149 explicit ActiveInputJack(GenericActiveInputJack input);
151 void reset(GenericActiveInput & input);
152 void reset(GenericActiveInputJack input);
157 /** \brief Jack with packet type referencing an ActiveOutput
158 \see \ref ppi_jacks */
159 template <class PacketType=Packet>
160 class ActiveOutputJack
161 : public GenericActiveOutputJack
164 explicit ActiveOutputJack(ActiveOutput<PacketType> & output);
165 explicit ActiveOutputJack(ActiveOutput<> & output);
167 explicit ActiveOutputJack(ActiveOutputJack & output);
168 explicit ActiveOutputJack(ActiveOutputJack<> & output);
170 void reset(ActiveOutput<PacketType> & output);
171 void reset(ActiveOutput<> & output);
173 void reset(ActiveOutputJack & output);
174 void reset(ActiveOutputJack<> & output);
180 class ActiveOutputJack<Packet>
181 : public GenericActiveOutputJack
184 explicit ActiveOutputJack(GenericActiveOutput & output);
185 explicit ActiveOutputJack(GenericActiveOutputJack & output);
187 void reset(GenericActiveOutput & output);
188 void reset(GenericActiveOutputJack & output);
193 /** \brief Jack with packet type referencing a PassiveInput
194 \see \ref ppi_jacks */
195 template <class PacketType=Packet>
196 class PassiveInputJack
197 : public GenericPassiveInputJack
200 explicit PassiveInputJack(PassiveInput<PacketType> & input);
201 explicit PassiveInputJack(PassiveInput<> & input);
203 explicit PassiveInputJack(PassiveInputJack & input);
204 explicit PassiveInputJack(PassiveInputJack<> & input);
206 void reset(PassiveInput<PacketType> & input);
207 void reset(PassiveInput<> & input);
209 void reset(PassiveInputJack & input);
210 void reset(PassiveInputJack<> & input);
216 class PassiveInputJack<Packet>
217 : public GenericPassiveInputJack
220 explicit PassiveInputJack(GenericPassiveInput & input);
221 explicit PassiveInputJack(GenericPassiveInputJack & input);
223 void reset(GenericPassiveInput & input);
224 void reset(GenericPassiveInputJack & input);
229 /** \brief Jack with packet type referencing a PassiveOutput
230 \see \ref ppi_jacks */
231 template <class PacketType=Packet>
232 class PassiveOutputJack
233 : public GenericPassiveOutputJack
236 explicit PassiveOutputJack(PassiveOutput<PacketType> & output);
237 explicit PassiveOutputJack(PassiveOutput<> & output);
239 explicit PassiveOutputJack(PassiveOutputJack & output);
240 explicit PassiveOutputJack(PassiveOutputJack<> & output);
242 void reset(PassiveOutput<PacketType> & output);
243 void reset(PassiveOutput<> & output);
245 void reset(PassiveOutputJack & output);
246 void reset(PassiveOutputJack<> & output);
252 class PassiveOutputJack<Packet>
253 : public GenericPassiveOutputJack
256 explicit PassiveOutputJack(GenericPassiveOutput & output);
257 explicit PassiveOutputJack(GenericPassiveOutputJack & output);
259 void reset(GenericPassiveOutput & output);
260 void reset(GenericPassiveOutputJack & output);
269 void connect(connector::GenericActiveOutputJack & source, T & target,
270 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
272 void connect(connector::GenericPassiveOutputJack & source, T & target,
273 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
276 void connect(T & source, connector::GenericActiveInputJack & target,
277 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
279 void connect(T & source, connector::GenericPassiveInputJack & target,
280 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
282 void connect(connector::GenericActiveOutputJack & source,
283 connector::GenericPassiveInputJack & target);
284 void connect(connector::GenericPassiveOutputJack & source,
285 connector::GenericActiveInputJack & target);
287 void connect(connector::GenericActiveOutputJack & source,
288 connector::GenericPassiveInput & target);
289 void connect(connector::GenericPassiveOutputJack & source,
290 connector::GenericActiveInput & target);
292 void connect(connector::GenericActiveOutput & source,
293 connector::GenericPassiveInputJack & target);
294 void connect(connector::GenericPassiveOutput & source,
295 connector::GenericActiveInputJack & target);
300 //-/////////////////////////////////////////////////////////////////////////////////////////////////
310 // comment-column: 40
311 // c-file-style: "senf"
312 // indent-tabs-mode: nil
313 // ispell-local-dictionary: "american"
314 // compile-command: "scons -u test"