MonitorModule.hh
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 #ifndef HH_SENF_PPI_MonitorModule_
18 #define HH_SENF_PPI_MonitorModule_ 1
19 
20 // Custom includes
21 #include "Module.hh"
22 #include "Connectors.hh"
23 
24 //#include "MonitorModule.mpp"
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 
27 namespace senf {
28 namespace ppi {
29 namespace module {
30 
66  template <class PacketType=Packet>
67  class MonitorModule : public Module
68  {
69  public:
72 
73  protected:
74  MonitorModule();
75 
76  virtual void v_handlePacket(PacketType const & p) = 0;
77 
78  private:
79  void request();
80  void throttle();
81  void unthrottle();
82  };
83 
84 
85 }}}
86 
87 //-/////////////////////////////////////////////////////////////////////////////////////////////////
88 //#include "MonitorModule.cci"
89 #include "MonitorModule.ct"
90 #include "MonitorModule.cti"
91 #endif
92 
93 
94 // Local Variables:
95 // mode: c++
96 // fill-column: 100
97 // comment-column: 40
98 // c-file-style: "senf"
99 // indent-tabs-mode: nil
100 // ispell-local-dictionary: "american"
101 // compile-command: "scons -u test"
102 // End:
Connector actively sending packets.
Definition: Connectors.hh:677
Module base-class.
Definition: Module.hh:169
Connectors public header.
Module public header.
senf::ppi::connector::PassiveInput< PacketType > input
senf::ppi::connector::ActiveOutput< PacketType > output
Base class providing simple monitor module support.
virtual void v_handlePacket(PacketType const &p)=0
Called for each packet.
Connector passively receiving packets.
Definition: Connectors.hh:655