Base class to represent items of packet Queues. More...
#include "queue-item.h"
Public Types | |
typedef void(* | TracedCallback) (Ptr< const QueueItem > item) |
TracedCallback signature for Ptr<QueueItem> More... | |
enum | Uint8Values { IP_DSFIELD } |
1-byte fields of the packet whose value can be retrieved, if present More... | |
Public Member Functions | |
QueueItem ()=delete | |
QueueItem (const QueueItem &)=delete | |
QueueItem (Ptr< Packet > p) | |
Create a queue item containing a packet. More... | |
virtual | ~QueueItem () |
Ptr< Packet > | GetPacket () const |
virtual uint32_t | GetSize () const |
Use this method (instead of GetPacket ()->GetSize ()) to get the packet size. More... | |
virtual bool | GetUint8Value (Uint8Values field, uint8_t &value) const |
Retrieve the value of a given field from the packet, if present. More... | |
QueueItem & | operator= (const QueueItem &)=delete |
virtual void | Print (std::ostream &os) const |
Print the item contents. More... | |
Public Member Functions inherited from ns3::SimpleRefCount< QueueItem > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= (const SimpleRefCount &o[[maybe_unused]]) |
Assignment operator. More... | |
void | Ref () const |
Increment the reference count. More... | |
void | Unref () const |
Decrement the reference count. More... | |
Private Attributes | |
Ptr< Packet > | m_packet |
The packet contained in the queue item. 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 46 of file queue-item.h.
TracedCallback signature for Ptr<QueueItem>
[in] | item | The queue item. |
Definition at line 106 of file queue-item.h.
1-byte fields of the packet whose value can be retrieved, if present
Enumerator | |
---|---|
IP_DSFIELD |
Definition at line 81 of file queue-item.h.
Create a queue item containing a packet.
p | the packet included in the created item. |
Definition at line 30 of file queue-item.cc.
References m_packet, and NS_LOG_FUNCTION.
|
virtual |
Definition at line 36 of file queue-item.cc.
References m_packet, and NS_LOG_FUNCTION.
|
delete |
|
delete |
Definition at line 43 of file queue-item.cc.
References m_packet, and NS_LOG_FUNCTION.
Referenced by ns3::ArpQueueDiscItem::AddHeader(), ns3::Ipv4QueueDiscItem::AddHeader(), ns3::Ipv6QueueDiscItem::AddHeader(), UdpSocketImplTest::GetPriority(), ns3::ArpQueueDiscItem::GetSize(), ns3::Ipv4QueueDiscItem::GetSize(), ns3::Ipv6QueueDiscItem::GetSize(), ns3::Ipv4QueueDiscItem::Hash(), ns3::Ipv6QueueDiscItem::Hash(), Print(), ns3::ArpQueueDiscItem::Print(), ns3::Ipv4QueueDiscItem::Print(), ns3::Ipv6QueueDiscItem::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::Ipv6QueueDiscItem, ns3::Ipv4QueueDiscItem, and ns3::ArpQueueDiscItem.
Definition at line 50 of file queue-item.cc.
References ns3::Packet::GetSize(), m_packet, NS_ASSERT, and NS_LOG_FUNCTION.
|
virtual |
Retrieve the value of a given field from the packet, if present.
field | the field whose value has to be retrieved |
value | the output parameter to store the retrieved value |
Reimplemented in ns3::Ipv6QueueDiscItem, and ns3::Ipv4QueueDiscItem.
Definition at line 58 of file queue-item.cc.
References NS_LOG_FUNCTION.
|
virtual |
Print the item contents.
os | output stream in which the data should be printed. |
Reimplemented in ns3::QueueDiscItem, ns3::Ipv6QueueDiscItem, ns3::Ipv4QueueDiscItem, and ns3::ArpQueueDiscItem.
Definition at line 65 of file queue-item.cc.
References GetPacket().
Referenced by ns3::operator<<().
The packet contained in the queue item.
Definition at line 112 of file queue-item.h.
Referenced by QueueItem(), ~QueueItem(), GetPacket(), and GetSize().