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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Authors: Pasquale Imputato <p.imputato@gmail.com>
7 * Stefano Avallone <stefano.avallone@unina.it>
8 */
9
10#ifndef QUEUE_LIMITS_H
11#define QUEUE_LIMITS_H
12
13#include "ns3/object.h"
14
15namespace ns3
16{
17
18/**
19 * \ingroup network
20 *
21 * \brief Abstract base class for NetDevice queue length controller
22 *
23 * QueueLimits is an abstract base class providing the interface to
24 * the NetDevice queue length controller.
25 *
26 * Child classes need to implement the methods used for a byte-based
27 * measure of the queue length.
28 *
29 * The design and implementation of this class is inspired by Linux.
30 * For more details, see the queue limits Sphinx documentation.
31 */
32class QueueLimits : public Object
33{
34 public:
35 /**
36 * \brief Get the type ID.
37 * \return the object TypeId
38 */
39 static TypeId GetTypeId();
40
41 ~QueueLimits() override;
42
43 /**
44 * \brief Reset queue limits state
45 */
46 virtual void Reset() = 0;
47
48 /**
49 * \brief Record number of completed bytes and recalculate the limit
50 * \param count the number of completed bytes
51 */
52 virtual void Completed(uint32_t count) = 0;
53
54 /**
55 * Available is called from NotifyTransmittedBytes to calculate the
56 * number of bytes that can be passed again to the NetDevice.
57 * A negative value means that no packets can be passed to the NetDevice.
58 * In this case, NotifyTransmittedBytes stops the transmission queue.
59 * \brief Returns how many bytes can be queued
60 * \return the number of bytes that can be queued
61 */
62 virtual int32_t Available() const = 0;
63
64 /**
65 * \brief Record the number of bytes queued
66 * \param count the number of bytes queued
67 */
68 virtual void Queued(uint32_t count) = 0;
69};
70
71} // namespace ns3
72
73#endif /* QUEUE_LIMITS_H */
A base class which provides memory management and object aggregation.
Definition object.h:78
Abstract base class for NetDevice queue length controller.
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.
~QueueLimits() override
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:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.