Jack.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
6 //
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
11 //
12 
13 
17 //#include "Jack.ih"
18 
19 // Custom includes
20 #include "Setup.hh"
21 
22 #define prefix_
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 
26 {
27  if (input_->connected()) {
28  GenericPassiveOutput & peer (input_->peer());
29  input_->disconnect();
30  connect(peer, input);
31  }
32  input_ = & input;
33 }
34 
36 {
37  if (output_->connected()) {
38  GenericPassiveInput & peer (output_->peer());
39  output_->disconnect();
40  connect(output, peer);
41  }
42  output_ = & output;
43 }
44 
46 {
47  if (input_->connected()) {
48  GenericActiveOutput & peer (input_->peer());
49  input_->disconnect();
50  connect(peer, input);
51  }
52  input_ = & input;
53 }
54 
56 {
57  if (output_->connected()) {
58  GenericActiveInput & peer (output_->peer());
59  output_->disconnect();
60  connect(output, peer);
61  }
62  output_ = & output;
63 }
64 
65 //-/////////////////////////////////////////////////////////////////////////////////////////////////
66 #undef prefix_
67 
68 
69 // Local Variables:
70 // mode: c++
71 // fill-column: 100
72 // comment-column: 40
73 // c-file-style: "senf"
74 // indent-tabs-mode: nil
75 // ispell-local-dictionary: "american"
76 // compile-command: "scons -u test"
77 // End:
void reset(GenericActiveInput &input)
Change connector.
Definition: Jack.cc:25
Combination of PassiveConnector and OutputConnector.
Definition: Connectors.hh:513
Combination of ActiveConnector and InputConnector.
Definition: Connectors.hh:538
void reset(GenericPassiveOutput &output)
Change connector.
Definition: Jack.cc:55
Combination of ActiveConnector and OutputConnector.
Definition: Connectors.hh:563
void connect(connector::FastActiveOutput< PacketType > &source, connector::FastPassiveInput< PacketType > &target)
#define prefix_
Definition: Jack.cc:22
GenericPassiveOutput & peer() const
Setup public header.
bool connected() const
true, if connector connected, false otherwise
void reset(GenericPassiveInput &input)
Change connector.
Definition: Jack.cc:45
void disconnect()
Disconnect connector from peer.
Definition: Connectors.cc:206
Combination of PassiveConnector and InputConnector.
Definition: Connectors.hh:478
void reset(GenericActiveOutput &output)
Change connector.
Definition: Jack.cc:35