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"
35 ///////////////////////////////hh.p////////////////////////////////////////
41 /** \brief Connector Jack base class
42 \see \ref ppi_jacks */
44 : private boost::noncopyable
47 /** \brief Jack referencing an ActiveInput
48 \see \ref ppi_jacks */
49 class GenericActiveInputJack
53 explicit GenericActiveInputJack(GenericActiveInput & input);
55 GenericActiveInput & connector(); ///< Get referenced connector
58 GenericActiveInput & input_;
61 /** \brief Jack referencing an ActiveOutput
62 \see \ref ppi_jacks */
63 class GenericActiveOutputJack
67 explicit GenericActiveOutputJack(GenericActiveOutput & output);
69 GenericActiveOutput & connector(); ///< Get referenced connector
72 GenericActiveOutput & output_;
75 /** \brief Jack referencing a PassiveInput
76 \see \ref ppi_jacks */
77 class GenericPassiveInputJack
81 explicit GenericPassiveInputJack(GenericPassiveInput & input);
83 GenericPassiveInput & connector(); ///< Get referenced connector
86 GenericPassiveInput & input_;
89 /** \brief Jack referencing a PassiveOutput
90 \see \ref ppi_jacks */
91 class GenericPassiveOutputJack
95 explicit GenericPassiveOutputJack(GenericPassiveOutput & output);
97 GenericPassiveOutput & connector(); ///< Get referenced connector
100 GenericPassiveOutput & output_;
103 /** \brief Jack with packet type referencing an ActiveInput
104 \see \ref ppi_jacks */
105 template <class PacketType=Packet>
106 class ActiveInputJack
107 : public GenericActiveInputJack
110 explicit ActiveInputJack(ActiveInput<PacketType> & input);
111 explicit ActiveInputJack(ActiveInput<> & input);
113 explicit ActiveInputJack(ActiveInputJack & input);
114 explicit ActiveInputJack(ActiveInputJack<> & input);
120 class ActiveInputJack<Packet>
121 : public GenericActiveInputJack
124 explicit ActiveInputJack(GenericActiveInput & input);
125 explicit ActiveInputJack(GenericActiveInputJack input);
130 /** \brief Jack with packet type referencing an ActiveOutput
131 \see \ref ppi_jacks */
132 template <class PacketType=Packet>
133 class ActiveOutputJack
134 : public GenericActiveOutputJack
137 explicit ActiveOutputJack(ActiveOutput<PacketType> & output);
138 explicit ActiveOutputJack(ActiveOutput<> & output);
140 explicit ActiveOutputJack(ActiveOutputJack & output);
141 explicit ActiveOutputJack(ActiveOutputJack<> & output);
147 class ActiveOutputJack<Packet>
148 : public GenericActiveOutputJack
151 explicit ActiveOutputJack(GenericActiveOutput & output);
152 explicit ActiveOutputJack(GenericActiveOutputJack & output);
157 /** \brief Jack with packet type referencing a PassiveInput
158 \see \ref ppi_jacks */
159 template <class PacketType=Packet>
160 class PassiveInputJack
161 : public GenericPassiveInputJack
164 explicit PassiveInputJack(PassiveInput<PacketType> & input);
165 explicit PassiveInputJack(PassiveInput<> & input);
167 explicit PassiveInputJack(PassiveInputJack & input);
168 explicit PassiveInputJack(PassiveInputJack<> & input);
174 class PassiveInputJack<Packet>
175 : public GenericPassiveInputJack
178 explicit PassiveInputJack(GenericPassiveInput & input);
179 explicit PassiveInputJack(GenericPassiveInputJack & input);
184 /** \brief Jack with packet type referencing a PassiveOutput
185 \see \ref ppi_jacks */
186 template <class PacketType=Packet>
187 class PassiveOutputJack
188 : public GenericPassiveOutputJack
191 explicit PassiveOutputJack(PassiveOutput<PacketType> & output);
192 explicit PassiveOutputJack(PassiveOutput<> & output);
194 explicit PassiveOutputJack(PassiveOutputJack & output);
195 explicit PassiveOutputJack(PassiveOutputJack<> & output);
201 class PassiveOutputJack<Packet>
202 : public GenericPassiveOutputJack
205 explicit PassiveOutputJack(GenericPassiveOutput & output);
206 explicit PassiveOutputJack(GenericPassiveOutputJack & output);
215 void connect(connector::GenericActiveOutputJack & source, T & target,
216 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
218 void connect(connector::GenericPassiveOutputJack & source, T & target,
219 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
222 void connect(T & source, connector::GenericActiveInputJack & target,
223 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
225 void connect(T & source, connector::GenericPassiveInputJack & target,
226 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
228 void connect(connector::GenericActiveOutputJack & source,
229 connector::GenericPassiveInputJack & target);
230 void connect(connector::GenericPassiveOutputJack & source,
231 connector::GenericActiveInputJack & target);
233 void connect(connector::GenericActiveOutputJack & source,
234 connector::GenericPassiveInput & target);
235 void connect(connector::GenericPassiveOutputJack & source,
236 connector::GenericActiveInput & target);
238 void connect(connector::GenericActiveOutput & source,
239 connector::GenericPassiveInputJack & target);
240 void connect(connector::GenericPassiveOutput & source,
241 connector::GenericActiveInputJack & target);
246 ///////////////////////////////hh.e////////////////////////////////////////
256 // comment-column: 40
257 // c-file-style: "senf"
258 // indent-tabs-mode: nil
259 // ispell-local-dictionary: "american"
260 // compile-command: "scons -u test"