DebugModules.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 "DebugModules.hh"
18 //#include "DebugModules.ih"
19 
20 // Custom includes
21 
22 //#include "DebugModules.mpp"
23 #define prefix_
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 
26 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 // senf::ppi::module::debug::PassiveSource
28 
29 prefix_ void senf::ppi::module::debug::PassiveSource::request()
30 {
31  SENF_ASSERT( ! packets_.empty(),
32  "senf::ppi::module::debug::PassiveSource::request(): "
33  "Requesting packet from empty source." );
34  output(packets_.front());
35  packets_.pop_front();
36  if (packets_.empty())
37  output.throttle();
38 }
39 
40 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41 // senf::ppi::module::debug::PassiveSink
42 
43 prefix_ void senf::ppi::module::debug::PassiveSink::request()
44 {
45  packets_.push_back(input());
46 }
47 
48 //-/////////////////////////////////////////////////////////////////////////////////////////////////
49 #undef prefix_
50 //#include "DebugModules.mpp"
51 
52 
53 // Local Variables:
54 // mode: c++
55 // fill-column: 100
56 // comment-column: 40
57 // c-file-style: "senf"
58 // indent-tabs-mode: nil
59 // ispell-local-dictionary: "american"
60 // compile-command: "scons -u test"
61 // End:
#define prefix_
Definition: DebugModules.cc:23
void throttle()
Set native throttling.
#define SENF_ASSERT(x, comment)
DebugModules public header.