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
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
15 \brief QueueingSocketSink inline non-template implementation */
17 //#include "QueueingSocketSink.ih"
21 #define prefix_ inline
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
24 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 // senf::ppi::QueueingAlgorithm
27 prefix_ unsigned senf::ppi::QueueingAlgorithm::size()
33 prefix_ unsigned senf::ppi::QueueingAlgorithm::peek(unsigned maxSize)
36 return v_peek(maxSize);
39 prefix_ void senf::ppi::QueueingAlgorithm::clear()
44 prefix_ bool senf::ppi::QueueingAlgorithm::empty()
50 prefix_ senf::Packet const & senf::ppi::QueueingAlgorithm::front()
56 prefix_ bool senf::ppi::QueueingAlgorithm::enqueue(Packet const & packet, bool force)
58 return v_enqueue( packet, force);
61 prefix_ void senf::ppi::QueueingAlgorithm::pop()
67 //-/////////////////////////////////////////////////////////////////////////////////////////////////
68 // senf::ppi::FIFOQueueingAlgorithm
70 prefix_ unsigned senf::ppi::FIFOQueueingAlgorithm::v_size()
76 prefix_ unsigned senf::ppi::FIFOQueueingAlgorithm::v_peek(unsigned maxSize)
79 if (!queue_.empty() and (queue_.front().size() <= maxSize))
80 return queue_.front().size();
84 prefix_ senf::Packet const & senf::ppi::FIFOQueueingAlgorithm::v_front()
87 return queue_.front();
91 prefix_ void senf::ppi::FIFOQueueingAlgorithm::v_pop()
96 prefix_ bool senf::ppi::FIFOQueueingAlgorithm::v_empty()
99 return queue_.empty();
102 //-/////////////////////////////////////////////////////////////////////////////////////////////////
103 // senf::ppi::NoneQueueingAlgorithm
105 prefix_ unsigned senf::ppi::NoneQueueingAlgorithm::v_size()
111 prefix_ unsigned senf::ppi::NoneQueueingAlgorithm::v_peek(unsigned maxSize)
117 prefix_ senf::Packet const & senf::ppi::NoneQueueingAlgorithm::v_front()
120 static senf::Packet _pkt_;
124 prefix_ void senf::ppi::NoneQueueingAlgorithm::v_pop()
128 prefix_ void senf::ppi::NoneQueueingAlgorithm::v_clear()
131 prefix_ bool senf::ppi::NoneQueueingAlgorithm::v_enqueue(Packet const & packet, bool force)
136 prefix_ bool senf::ppi::NoneQueueingAlgorithm::v_empty()
142 prefix_ senf::ppi::QueueingAlgorithm::ptr senf::ppi::NoneQueueingAlgorithm::create()
144 return QueueingAlgorithm::ptr(new NoneQueueingAlgorithm());
147 //-/////////////////////////////////////////////////////////////////////////////////////////////////
154 // comment-column: 40
155 // c-file-style: "senf"
156 // indent-tabs-mode: nil
157 // ispell-local-dictionary: "american"
158 // compile-command: "scons -u test"