PassiveQueue.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 "PassiveQueue.hh"
18 //#include "PassiveQueue.ih"
19 
20 // Custom includes
21 
22 //#include "PassiveQueue.mpp"
23 #define prefix_
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 
26 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 // senf::ppi::module::PassiveQueue
28 
30 {
32  input.onRequest(&PassiveQueue::onInput);
33  output.onRequest(&PassiveQueue::onOutput);
34 }
35 
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
37 // private members
38 
39 prefix_ void senf::ppi::module::PassiveQueue::v_init()
40 {
41  if (!input)
42  output.throttle();
43 }
44 
45 prefix_ void senf::ppi::module::PassiveQueue::onInput()
46 {
48 }
49 
50 prefix_ void senf::ppi::module::PassiveQueue::onOutput()
51 {
52  if (input)
53  output(input());
54  if (!input)
55  output.throttle();
56 }
57 
58 //-/////////////////////////////////////////////////////////////////////////////////////////////////
59 #undef prefix_
60 //#include "PassiveQueue.mpp"
61 
62 
63 // Local Variables:
64 // mode: c++
65 // fill-column: 100
66 // comment-column: 40
67 // c-file-style: "senf"
68 // indent-tabs-mode: nil
69 // ispell-local-dictionary: "american"
70 // compile-command: "scons -u test"
71 // End:
connector::PassiveInput input
Definition: PassiveQueue.hh:48
Route< connector::InputConnector, connector::OutputConnector > & route(connector::InputConnector &input, connector::OutputConnector &output)
Define flow information.
Definition: Module.cc:39
void unthrottle()
Revoke native throttling.
void throttle()
Set native throttling.
void onRequest(Handler handler)
Register I/O event handler.
#define prefix_
Definition: PassiveQueue.cc:23
connector::PassiveOutput output
Definition: PassiveQueue.hh:51
PassiveQueue public header.