Base class to represent items of packet Queues. More...
#include "net-device.h"
Public Types | |
typedef void(* | TracedCallback) (Ptr< const QueueItem > item) |
TracedCallback signature for Ptr<QueueItem> More... | |
Public Member Functions | |
QueueItem (Ptr< Packet > p) | |
Create a queue item containing a packet. More... | |
virtual | ~QueueItem () |
Ptr< Packet > | GetPacket (void) const |
virtual uint32_t | GetPacketSize (void) const |
Use this method (instead of GetPacket ()->GetSize ()) to get the packet size. More... | |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
![]() | |
SimpleRefCount () | |
Constructor. More... | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Private Member Functions | |
QueueItem () | |
Default constructor. More... | |
QueueItem (const QueueItem &) | |
Copy constructor. More... | |
QueueItem & | operator= (const QueueItem &) |
Assignment operator. More... | |
Private Attributes | |
Ptr< Packet > | m_packet |
Additional Inherited Members | |
![]() | |
static void | Cleanup (void) |
Noop. More... | |
Base class to represent items of packet Queues.
An item stored in an ns-3 packet Queue contains a packet and possibly other information. An item of the base class only contains a packet. Subclasses can be derived from this base class to allow items to contain additional information.
Definition at line 55 of file net-device.h.
TracedCallback signature for Ptr<QueueItem>
[in] | item | The queue item. |
Definition at line 92 of file net-device.h.
Create a queue item containing a packet.
p | the packet included in the created item. |
Definition at line 32 of file net-device.cc.
References m_packet.
|
virtual |
Definition at line 37 of file net-device.cc.
References m_packet, and NS_LOG_FUNCTION.
|
private |
Default constructor.
Defined and unimplemented to avoid misuse
|
private |
Copy constructor.
Defined and unimplemented to avoid misuse
Definition at line 44 of file net-device.cc.
References m_packet.
Referenced by ns3::Ipv4QueueDiscItem::AddHeader(), ns3::Ipv6QueueDiscItem::AddHeader(), ns3::Ipv6QueueDiscItem::GetPacketSize(), ns3::Ipv4QueueDiscItem::GetPacketSize(), ns3::Ipv6QueueDiscItem::Print(), ns3::Ipv4QueueDiscItem::Print(), Print(), and ns3::QueueDiscItem::Print().
|
virtual |
Use this method (instead of GetPacket ()->GetSize ()) to get the packet size.
Subclasses may keep header and payload separate to allow manipulating the header, so using this method ensures that the correct packet size is returned.
Reimplemented in ns3::Ipv4QueueDiscItem, and ns3::Ipv6QueueDiscItem.
Definition at line 50 of file net-device.cc.
References ns3::Packet::GetSize(), m_packet, and NS_ASSERT.
Assignment operator.
Defined and unimplemented to avoid misuse
|
virtual |
Print the item contents.
os | output stream in which the data should be printed. |
Reimplemented in ns3::QueueDiscItem, ns3::Ipv4QueueDiscItem, and ns3::Ipv6QueueDiscItem.
Definition at line 57 of file net-device.cc.
References GetPacket().
Referenced by ns3::operator<<().
Definition at line 115 of file net-device.h.
Referenced by GetPacket(), GetPacketSize(), QueueItem(), and ~QueueItem().