QueueingSocketSink.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_QueueingSocketSink_
18 #define HH_SENF_PPI_QueueingSocketSink_ 1
19 
20 // Custom includes
21 #include "QueueingAlgorithm.hh"
22 #include "SocketSink.hh"
23 
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 
26 namespace senf {
27 namespace ppi {
28 namespace module {
29 
34  template <class Writer=ConnectedDgramWriter>
36  {
38 
39  public:
40  typedef typename Writer::Handle Handle;
41  typedef typename Writer::PacketType PacketType;
42 
45 
47 
48  Writer & writer();
49  Handle & handle();
50  void handle(Handle const & handle);
52 
54  QueueingAlgorithm & qAlgorithm() const;
56 
57  private:
58  void write();
59  void writable();
60  void checkThrottle();
61  void setQAlgorithm(std::string const & key);
62 
63  Handle handle_;
64  Writer writer_;
65  boost::scoped_ptr<QueueingAlgorithm> qAlgo_;
66  IOEvent event_;
67  };
68 
69 }}}
70 
71 //-/////////////////////////////////////////////////////////////////////////////////////////////////
72 //#include "QueueingSocketSink.cci"
73 #include "QueueingSocketSink.ct"
74 #include "QueueingSocketSink.cti"
75 #endif
76 
77 
78 // Local Variables:
79 // mode: c++
80 // fill-column: 100
81 // c-file-style: "senf"
82 // indent-tabs-mode: nil
83 // ispell-local-dictionary: "american"
84 // compile-command: "scons -u test"
85 // comment-column: 40
86 // End:
Module base-class.
Definition: Module.hh:169
QueueingAlgorithm public header.
Writer::Handle Handle
Handle type requested by writer.
connector::PassiveInput< PacketType > input
Input connector from which data is received.
std::unique_ptr< QueueingAlgorithm > ptr
PassiveQueueingSocketSink(Handle const &handle, QueueingAlgorithm::ptr qAlgorithm)
SocketSink public header.
#define SENF_PPI_MODULE(name)
Define PPI Module.
Definition: Module.hh:346
FileHandle based I/O read/write event.
Definition: IOEvent.hh:61
QueueingAlgorithm & qAlgorithm() const
Writer & writer()
Access the Writer.
Connector passively receiving packets.
Definition: Connectors.hh:655