A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
queue-limits.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Universita' degli Studi di Napoli Federico II
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Authors: Pasquale Imputato <p.imputato@gmail.com>
18 * Stefano Avallone <stefano.avallone@unina.it>
19 */
20
21#ifndef QUEUE_LIMITS_H
22#define QUEUE_LIMITS_H
23
24#include "ns3/object.h"
25
26namespace ns3
27{
28
29/**
30 * \ingroup network
31 *
32 * \brief Abstract base class for NetDevice queue length controller
33 *
34 * QueueLimits is an abstract base class providing the interface to
35 * the NetDevice queue length controller.
36 *
37 * Child classes need to implement the methods used for a byte-based
38 * measure of the queue length.
39 *
40 * The design and implementation of this class is inspired by Linux.
41 * For more details, see the queue limits Sphinx documentation.
42 */
43class QueueLimits : public Object
44{
45 public:
46 /**
47 * \brief Get the type ID.
48 * \return the object TypeId
49 */
50 static TypeId GetTypeId();
51
52 ~QueueLimits() override;
53
54 /**
55 * \brief Reset queue limits state
56 */
57 virtual void Reset() = 0;
58
59 /**
60 * \brief Record number of completed bytes and recalculate the limit
61 * \param count the number of completed bytes
62 */
63 virtual void Completed(uint32_t count) = 0;
64
65 /**
66 * Available is called from NotifyTransmittedBytes to calculate the
67 * number of bytes that can be passed again to the NetDevice.
68 * A negative value means that no packets can be passed to the NetDevice.
69 * In this case, NotifyTransmittedBytes stops the transmission queue.
70 * \brief Returns how many bytes can be queued
71 * \return the number of bytes that can be queued
72 */
73 virtual int32_t Available() const = 0;
74
75 /**
76 * \brief Record the number of bytes queued
77 * \param count the number of bytes queued
78 */
79 virtual void Queued(uint32_t count) = 0;
80};
81
82} // namespace ns3
83
84#endif /* QUEUE_LIMITS_H */
A base class which provides memory management and object aggregation.
Definition: object.h:89
Abstract base class for NetDevice queue length controller.
Definition: queue-limits.h:44
virtual void Reset()=0
Reset queue limits state.
virtual void Queued(uint32_t count)=0
Record the number of bytes queued.
static TypeId GetTypeId()
Get the type ID.
Definition: queue-limits.cc:33
~QueueLimits() override
Definition: queue-limits.cc:39
virtual void Completed(uint32_t count)=0
Record number of completed bytes and recalculate the limit.
virtual int32_t Available() const =0
Available is called from NotifyTransmittedBytes to calculate the number of bytes that can be passed a...
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.