A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ns3::dsr::DsrNetworkQueue Class Reference

Doxygen introspection did not find any typical Config paths. More...

#include <dsr-network-queue.h>

+ Inheritance diagram for ns3::dsr::DsrNetworkQueue:
+ Collaboration diagram for ns3::dsr::DsrNetworkQueue:

Public Member Functions

 DsrNetworkQueue ()
 
 DsrNetworkQueue (uint32_t maxLen, Time maxDelay)
 Construct a DsrNetworkQueue with the given maximum length and maximum delay. More...
 
 ~DsrNetworkQueue ()
 
bool Dequeue (DsrNetworkQueueEntry &entry)
 Return first found (the earliest) entry for given destination. More...
 
bool Enqueue (DsrNetworkQueueEntry &entry)
 Push entry in queue, if there is no entry with the same packet and destination address in queue. More...
 
void Flush (void)
 Clear the queue. More...
 
Time GetMaxNetworkDelay (void) const
 Return the maximum entry lifetime for this queue. More...
 
uint32_t GetMaxNetworkSize (void) const
 Return the maximum queue size. More...
 
std::vector
< DsrNetworkQueueEntry > & 
GetQueue ()
 
uint32_t GetSize ()
 Number of entries. More...
 
void SetMaxNetworkDelay (Time delay)
 Set the maximum entry lifetime in the queue. More...
 
void SetMaxNetworkSize (uint32_t maxSize)
 Set the maximum queue size. More...
 
- Public Member Functions inherited from ns3::Object
 Object ()
 
virtual ~Object ()
 
void AggregateObject (Ptr< Object > other)
 
void Dispose (void)
 Run the DoDispose methods of this object and all the objects aggregated to it. More...
 
AggregateIterator GetAggregateIterator (void) const
 
virtual TypeId GetInstanceTypeId (void) const
 
template<typename T >
Ptr< T > GetObject (void) const
 
template<typename T >
Ptr< T > GetObject (TypeId tid) const
 
void Initialize (void)
 This method calls the virtual DoInitialize method on all the objects aggregated to this object. More...
 
- Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
 SimpleRefCount ()
 Constructor. More...
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor. More...
 
uint32_t GetReferenceCount (void) const
 Get the reference count of the object. More...
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment. More...
 
void Ref (void) const
 Increment the reference count. More...
 
void Unref (void) const
 Decrement the reference count. More...
 
- Public Member Functions inherited from ns3::ObjectBase
virtual ~ObjectBase ()
 Virtual destructor. More...
 
void GetAttribute (std::string name, AttributeValue &value) const
 
bool GetAttributeFailSafe (std::string name, AttributeValue &attribute) const
 
void SetAttribute (std::string name, const AttributeValue &value)
 
bool SetAttributeFailSafe (std::string name, const AttributeValue &value)
 
bool TraceConnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceConnectWithoutContext (std::string name, const CallbackBase &cb)
 
bool TraceDisconnect (std::string name, std::string context, const CallbackBase &cb)
 
bool TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb)
 

Static Public Member Functions

static TypeId GetTypeId (void)
 
- Static Public Member Functions inherited from ns3::Object
static TypeId GetTypeId (void)
 Register this type. More...
 
- Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter >
static void Cleanup (void)
 Noop. More...
 
- Static Public Member Functions inherited from ns3::ObjectBase
static TypeId GetTypeId (void)
 Get the type ID. More...
 

Private Member Functions

void Cleanup (void)
 Clean the queue by removing entries that exceeded lifetime. More...
 

Private Attributes

std::vector< DsrNetworkQueueEntrym_dsrNetworkQueue
 Queue (vector) of entries. More...
 
Time m_maxDelay
 Maximum entry lifetime. More...
 
uint32_t m_maxSize
 Maximum queue size. More...
 
uint32_t m_size
 Current queue size. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::Object
 Object (const Object &o)
 
virtual void DoDispose (void)
 This method is called by Object::Dispose or by the object's destructor, whichever comes first. More...
 
virtual void DoInitialize (void)
 This method is called only once by Object::Initialize. More...
 
virtual void NotifyNewAggregate (void)
 This method is invoked whenever two sets of objects are aggregated together. More...
 
- Protected Member Functions inherited from ns3::ObjectBase
void ConstructSelf (const AttributeConstructionList &attributes)
 
virtual void NotifyConstructionCompleted (void)
 This method is invoked once all member attributes have been initialized. More...
 

Detailed Description

Doxygen introspection did not find any typical Config paths.


No Attributes are defined for this type.
No TraceSources are defined for this type.

Definition at line 138 of file dsr-network-queue.h.

Constructor & Destructor Documentation

ns3::dsr::DsrNetworkQueue::DsrNetworkQueue ( )

Definition at line 67 of file dsr-network-queue.cc.

References NS_LOG_FUNCTION.

ns3::dsr::DsrNetworkQueue::DsrNetworkQueue ( uint32_t  maxLen,
Time  maxDelay 
)

Construct a DsrNetworkQueue with the given maximum length and maximum delay.

Parameters
maxLenMaximum queue size
maxDelayMaximum entry lifetime in the queue

Definition at line 59 of file dsr-network-queue.cc.

References NS_LOG_FUNCTION.

ns3::dsr::DsrNetworkQueue::~DsrNetworkQueue ( )

Definition at line 72 of file dsr-network-queue.cc.

References Flush(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

Member Function Documentation

void ns3::dsr::DsrNetworkQueue::Cleanup ( void  )
private

Clean the queue by removing entries that exceeded lifetime.

Definition at line 137 of file dsr-network-queue.cc.

References m_dsrNetworkQueue, m_maxDelay, m_size, ns3::Simulator::Now(), NS_LOG_FUNCTION, and NS_LOG_LOGIC.

Referenced by Dequeue().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool ns3::dsr::DsrNetworkQueue::Dequeue ( DsrNetworkQueueEntry entry)

Return first found (the earliest) entry for given destination.

Parameters
entrypointer to the return entry
Returns
true if an entry is returned, false otherwise

Definition at line 119 of file dsr-network-queue.cc.

References Cleanup(), m_dsrNetworkQueue, m_size, NS_LOG_FUNCTION, and NS_LOG_LOGIC.

+ Here is the call graph for this function:

bool ns3::dsr::DsrNetworkQueue::Enqueue ( DsrNetworkQueueEntry entry)

Push entry in queue, if there is no entry with the same packet and destination address in queue.

Parameters
entrypacket entry
Returns
true if the given entry was put in the queue, false otherwise

Definition at line 103 of file dsr-network-queue.cc.

References m_dsrNetworkQueue, m_maxSize, m_size, ns3::Simulator::Now(), NS_LOG_FUNCTION, NS_LOG_LOGIC, and ns3::dsr::DsrNetworkQueueEntry::SetInsertedTimeStamp().

+ Here is the call graph for this function:

void ns3::dsr::DsrNetworkQueue::Flush ( void  )

Clear the queue.

Definition at line 171 of file dsr-network-queue.cc.

References m_dsrNetworkQueue, m_size, and NS_LOG_FUNCTION.

Referenced by ~DsrNetworkQueue().

+ Here is the caller graph for this function:

Time ns3::dsr::DsrNetworkQueue::GetMaxNetworkDelay ( void  ) const

Return the maximum entry lifetime for this queue.

Returns
the maximum entry lifetime for this queue

Definition at line 97 of file dsr-network-queue.cc.

References m_maxDelay.

uint32_t ns3::dsr::DsrNetworkQueue::GetMaxNetworkSize ( void  ) const

Return the maximum queue size.

Returns
the maximum queue size

Definition at line 91 of file dsr-network-queue.cc.

References m_maxSize.

std::vector<DsrNetworkQueueEntry>& ns3::dsr::DsrNetworkQueue::GetQueue ( void  )
inline

Definition at line 207 of file dsr-network-queue.h.

References m_dsrNetworkQueue.

uint32_t ns3::dsr::DsrNetworkQueue::GetSize ( )

Number of entries.

Returns
the current queue size/length

Definition at line 164 of file dsr-network-queue.cc.

References m_size, and NS_LOG_FUNCTION.

TypeId ns3::dsr::DsrNetworkQueue::GetTypeId ( void  )
static

Definition at line 50 of file dsr-network-queue.cc.

References ns3::TypeId::SetParent().

+ Here is the call graph for this function:

void ns3::dsr::DsrNetworkQueue::SetMaxNetworkDelay ( Time  delay)

Set the maximum entry lifetime in the queue.

Parameters
delaythe maximum entry lifetime

Definition at line 85 of file dsr-network-queue.cc.

References m_maxDelay.

void ns3::dsr::DsrNetworkQueue::SetMaxNetworkSize ( uint32_t  maxSize)

Set the maximum queue size.

Parameters
maxSizethe maximum queue size

Definition at line 79 of file dsr-network-queue.cc.

References m_maxSize.

Member Data Documentation

std::vector<DsrNetworkQueueEntry> ns3::dsr::DsrNetworkQueue::m_dsrNetworkQueue
private

Queue (vector) of entries.

Definition at line 217 of file dsr-network-queue.h.

Referenced by Cleanup(), Dequeue(), Enqueue(), Flush(), and GetQueue().

Time ns3::dsr::DsrNetworkQueue::m_maxDelay
private

Maximum entry lifetime.

Definition at line 220 of file dsr-network-queue.h.

Referenced by Cleanup(), GetMaxNetworkDelay(), and SetMaxNetworkDelay().

uint32_t ns3::dsr::DsrNetworkQueue::m_maxSize
private

Maximum queue size.

Definition at line 219 of file dsr-network-queue.h.

Referenced by Enqueue(), GetMaxNetworkSize(), and SetMaxNetworkSize().

uint32_t ns3::dsr::DsrNetworkQueue::m_size
private

Current queue size.

Definition at line 218 of file dsr-network-queue.h.

Referenced by Cleanup(), Dequeue(), Enqueue(), Flush(), and GetSize().


The documentation for this class was generated from the following files: