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
59 GenericActiveInput & input_;
62 /** \brief Jack referencing an ActiveOutput
63 \see \ref ppi_jacks */
64 class GenericActiveOutputJack
68 explicit GenericActiveOutputJack(GenericActiveOutput & output);
70 GenericActiveOutput & connector(); ///< Get referenced connector
73 GenericActiveOutput & output_;
76 /** \brief Jack referencing a PassiveInput
77 \see \ref ppi_jacks */
78 class GenericPassiveInputJack
82 explicit GenericPassiveInputJack(GenericPassiveInput & input);
84 GenericPassiveInput & connector(); ///< Get referenced connector
87 GenericPassiveInput & input_;
90 /** \brief Jack referencing a PassiveOutput
91 \see \ref ppi_jacks */
92 class GenericPassiveOutputJack
96 explicit GenericPassiveOutputJack(GenericPassiveOutput & output);
98 GenericPassiveOutput & connector(); ///< Get referenced connector
101 GenericPassiveOutput & output_;
104 /** \brief Jack with packet type referencing an ActiveInput
105 \see \ref ppi_jacks */
106 template <class PacketType=Packet>
107 class ActiveInputJack
108 : public GenericActiveInputJack
111 explicit ActiveInputJack(ActiveInput<PacketType> & input);
112 explicit ActiveInputJack(ActiveInput<> & input);
114 explicit ActiveInputJack(ActiveInputJack & input);
115 explicit ActiveInputJack(ActiveInputJack<> & input);
121 class ActiveInputJack<Packet>
122 : public GenericActiveInputJack
125 explicit ActiveInputJack(GenericActiveInput & input);
126 explicit ActiveInputJack(GenericActiveInputJack input);
131 /** \brief Jack with packet type referencing an ActiveOutput
132 \see \ref ppi_jacks */
133 template <class PacketType=Packet>
134 class ActiveOutputJack
135 : public GenericActiveOutputJack
138 explicit ActiveOutputJack(ActiveOutput<PacketType> & output);
139 explicit ActiveOutputJack(ActiveOutput<> & output);
141 explicit ActiveOutputJack(ActiveOutputJack & output);
142 explicit ActiveOutputJack(ActiveOutputJack<> & output);
148 class ActiveOutputJack<Packet>
149 : public GenericActiveOutputJack
152 explicit ActiveOutputJack(GenericActiveOutput & output);
153 explicit ActiveOutputJack(GenericActiveOutputJack & output);
158 /** \brief Jack with packet type referencing a PassiveInput
159 \see \ref ppi_jacks */
160 template <class PacketType=Packet>
161 class PassiveInputJack
162 : public GenericPassiveInputJack
165 explicit PassiveInputJack(PassiveInput<PacketType> & input);
166 explicit PassiveInputJack(PassiveInput<> & input);
168 explicit PassiveInputJack(PassiveInputJack & input);
169 explicit PassiveInputJack(PassiveInputJack<> & input);
175 class PassiveInputJack<Packet>
176 : public GenericPassiveInputJack
179 explicit PassiveInputJack(GenericPassiveInput & input);
180 explicit PassiveInputJack(GenericPassiveInputJack & input);
185 /** \brief Jack with packet type referencing a PassiveOutput
186 \see \ref ppi_jacks */
187 template <class PacketType=Packet>
188 class PassiveOutputJack
189 : public GenericPassiveOutputJack
192 explicit PassiveOutputJack(PassiveOutput<PacketType> & output);
193 explicit PassiveOutputJack(PassiveOutput<> & output);
195 explicit PassiveOutputJack(PassiveOutputJack & output);
196 explicit PassiveOutputJack(PassiveOutputJack<> & output);
202 class PassiveOutputJack<Packet>
203 : public GenericPassiveOutputJack
206 explicit PassiveOutputJack(GenericPassiveOutput & output);
207 explicit PassiveOutputJack(GenericPassiveOutputJack & output);
216 void connect(connector::GenericActiveOutputJack & source, T & target,
217 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
219 void connect(connector::GenericPassiveOutputJack & source, T & target,
220 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
223 void connect(T & source, connector::GenericActiveInputJack & target,
224 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
226 void connect(T & source, connector::GenericPassiveInputJack & target,
227 typename boost::disable_if< boost::is_base_of<connector::Jack, T> >::type * = 0);
229 void connect(connector::GenericActiveOutputJack & source,
230 connector::GenericPassiveInputJack & target);
231 void connect(connector::GenericPassiveOutputJack & source,
232 connector::GenericActiveInputJack & target);
234 void connect(connector::GenericActiveOutputJack & source,
235 connector::GenericPassiveInput & target);
236 void connect(connector::GenericPassiveOutputJack & source,
237 connector::GenericActiveInput & target);
239 void connect(connector::GenericActiveOutput & source,
240 connector::GenericPassiveInputJack & target);
241 void connect(connector::GenericPassiveOutput & source,
242 connector::GenericActiveInputJack & target);
247 ///////////////////////////////hh.e////////////////////////////////////////
257 // comment-column: 40
258 // c-file-style: "senf"
259 // indent-tabs-mode: nil
260 // ispell-local-dictionary: "american"
261 // compile-command: "scons -u test"