diff --git a/src/node/drop-tail-queue.cc b/src/node/drop-tail-queue.cc index 7b88231ab..456af4bcc 100644 --- a/src/node/drop-tail-queue.cc +++ b/src/node/drop-tail-queue.cc @@ -95,7 +95,7 @@ DropTailQueue::DoDequeue (Packet& p) } bool -DropTailQueue::DoPeek (Packet& p) +DropTailQueue::DoPeek (Packet& p) const { NS_LOG_FUNCTION; NS_LOG_PARAMS (this << &p); diff --git a/src/node/drop-tail-queue.h b/src/node/drop-tail-queue.h index 2e4c76461..15fd1faee 100644 --- a/src/node/drop-tail-queue.h +++ b/src/node/drop-tail-queue.h @@ -59,7 +59,7 @@ public: private: virtual bool DoEnqueue (const Packet& p); virtual bool DoDequeue (Packet &p); - virtual bool DoPeek (Packet &p); + virtual bool DoPeek (Packet &p) const; private: std::queue m_packets; diff --git a/src/node/queue.cc b/src/node/queue.cc index ab7f8f894..a6c3ac514 100644 --- a/src/node/queue.cc +++ b/src/node/queue.cc @@ -186,7 +186,7 @@ Queue::DequeueAll (void) } bool -Queue::Peek (Packet &p) +Queue::Peek (Packet &p) const { NS_LOG_FUNCTION; NS_LOG_PARAMS (this << &p); @@ -195,7 +195,7 @@ Queue::Peek (Packet &p) uint32_t -Queue::GetNPackets (void) +Queue::GetNPackets (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC ("returns " << m_nPackets); @@ -203,7 +203,7 @@ Queue::GetNPackets (void) } uint32_t -Queue::GetNBytes (void) +Queue::GetNBytes (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC (" returns " << m_nBytes); @@ -211,7 +211,7 @@ Queue::GetNBytes (void) } bool -Queue::IsEmpty (void) +Queue::IsEmpty (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC ("returns " << (m_nPackets == 0)); @@ -219,7 +219,7 @@ Queue::IsEmpty (void) } uint32_t -Queue::GetTotalReceivedBytes (void) +Queue::GetTotalReceivedBytes (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC("returns " << m_nTotalReceivedBytes); @@ -227,7 +227,7 @@ Queue::GetTotalReceivedBytes (void) } uint32_t -Queue::GetTotalReceivedPackets (void) +Queue::GetTotalReceivedPackets (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC ("returns " << m_nTotalReceivedPackets); @@ -235,7 +235,7 @@ Queue::GetTotalReceivedPackets (void) } uint32_t -Queue:: GetTotalDroppedBytes (void) +Queue:: GetTotalDroppedBytes (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC ("returns " << m_nTotalDroppedBytes); @@ -243,7 +243,7 @@ Queue:: GetTotalDroppedBytes (void) } uint32_t -Queue::GetTotalDroppedPackets (void) +Queue::GetTotalDroppedPackets (void) const { NS_LOG_FUNCTION; NS_LOG_LOGIC("returns " << m_nTotalDroppedPackets); diff --git a/src/node/queue.h b/src/node/queue.h index b8531c9c7..f0f014709 100644 --- a/src/node/queue.h +++ b/src/node/queue.h @@ -86,7 +86,7 @@ public: /** * \return true if the queue is empty; false otherwise */ - bool IsEmpty (void); + bool IsEmpty (void) const; /** * Place a packet into the rear of the Queue * \return True if the operation was successful; false otherwise @@ -101,7 +101,7 @@ public: * Get a copy of the item at the front of the queue without removing it * \return True if the operation was successful; false otherwise */ - bool Peek (Packet &p); + bool Peek (Packet &p) const; /** * XXX Doesn't do anything right now, think its supposed to flush the queue @@ -110,11 +110,11 @@ public: /** * \return The number of packets currently stored in the Queue */ - uint32_t GetNPackets (void); + uint32_t GetNPackets (void) const; /** * \return The number of bytes currently occupied by the packets in the Queue */ - uint32_t GetNBytes (void); + uint32_t GetNBytes (void) const; /** * \return The total number of bytes recieved by this Queue since the @@ -122,25 +122,25 @@ public: * whichever happened more recently * */ - uint32_t GetTotalReceivedBytes (void); + uint32_t GetTotalReceivedBytes (void) const; /** * \return The total number of packets recieved by this Queue since the * simulation began, or since ResetStatistics was called, according to * whichever happened more recently */ - uint32_t GetTotalReceivedPackets (void); + uint32_t GetTotalReceivedPackets (void) const; /** * \return The total number of bytes dropped by this Queue since the * simulation began, or since ResetStatistics was called, according to * whichever happened more recently */ - uint32_t GetTotalDroppedBytes (void); + uint32_t GetTotalDroppedBytes (void) const; /** * \return The total number of bytes dropped by this Queue since the * simulation began, or since ResetStatistics was called, according to * whichever happened more recently */ - uint32_t GetTotalDroppedPackets (void); + uint32_t GetTotalDroppedPackets (void) const; /** * Resets the counts for dropped packets, dropped bytes, recieved packets, and * recieved bytes. @@ -175,7 +175,7 @@ private: virtual bool DoEnqueue (const Packet& p) = 0; virtual bool DoDequeue (Packet &p) = 0; - virtual bool DoPeek (Packet &p) = 0; + virtual bool DoPeek (Packet &p) const = 0; protected: Ptr GetTraceResolver (void) const;