diff --git a/CHANGES.html b/CHANGES.html
index d564d396a..b42bac8ef 100644
--- a/CHANGES.html
+++ b/CHANGES.html
@@ -93,6 +93,7 @@ or with a string value with 'b' (bytes) or 'p' (packets) suffix, such as:
QueueDisc::DequeuePeeked has been merged into QueueDisc::Dequeue and hence no longer exists.
The QueueDisc base class now provides a default implementation of the DoPeek private method
based on the QueueDisc::PeekDequeue method, which is now no longer available.
+
The QueueDisc::SojournTime trace source is changed from a TracedValue to a TracedCallback; callbacks that hook this trace must provide one ns3::Time argument, not two.
Changes to build system:
diff --git a/examples/traffic-control/traffic-control.cc b/examples/traffic-control/traffic-control.cc
index 23761495c..ea7a3eea0 100644
--- a/examples/traffic-control/traffic-control.cc
+++ b/examples/traffic-control/traffic-control.cc
@@ -79,9 +79,9 @@ DevicePacketsInQueueTrace (uint32_t oldValue, uint32_t newValue)
}
void
-SojournTimeTrace (Time oldValue, Time newValue)
+SojournTimeTrace (Time sojournTime)
{
- std::cout << "Sojourn time " << newValue.ToDouble (Time::MS) << "ms" << std::endl;
+ std::cout << "Sojourn time " << sojournTime.ToDouble (Time::MS) << "ms" << std::endl;
}
int
diff --git a/src/traffic-control/model/queue-disc.cc b/src/traffic-control/model/queue-disc.cc
index bcfb40ce2..3034340dc 100644
--- a/src/traffic-control/model/queue-disc.cc
+++ b/src/traffic-control/model/queue-disc.cc
@@ -317,7 +317,7 @@ TypeId QueueDisc::GetTypeId (void)
.AddTraceSource ("SojournTime",
"Sojourn time of the last packet dequeued from the queue disc",
MakeTraceSourceAccessor (&QueueDisc::m_sojourn),
- "ns3::TracedValueCallback::Time")
+ "ns3::Time::TracedCallback")
;
return tid;
}
@@ -325,7 +325,6 @@ TypeId QueueDisc::GetTypeId (void)
QueueDisc::QueueDisc (QueueDiscSizePolicy policy)
: m_nPackets (0),
m_nBytes (0),
- m_sojourn (0),
m_maxSize (QueueSize ("1p")), // to avoid that setting the mode at construction time is ignored
m_running (false),
m_peeked (false),
@@ -702,7 +701,7 @@ QueueDisc::PacketDequeued (Ptr item)
m_stats.nTotalDequeuedPackets++;
m_stats.nTotalDequeuedBytes += item->GetSize ();
- m_sojourn = Simulator::Now () - item->GetTimeStamp ();
+ m_sojourn (Simulator::Now () - item->GetTimeStamp ());
NS_LOG_LOGIC ("m_traceDequeue (p)");
m_traceDequeue (item);
diff --git a/src/traffic-control/model/queue-disc.h b/src/traffic-control/model/queue-disc.h
index 2408cf2cc..493803dbb 100644
--- a/src/traffic-control/model/queue-disc.h
+++ b/src/traffic-control/model/queue-disc.h
@@ -22,6 +22,7 @@
#include "ns3/object.h"
#include "ns3/traced-value.h"
+#include "ns3/traced-callback.h"
#include "ns3/net-device.h"
#include "ns3/queue-item.h"
#include "ns3/queue-size.h"
@@ -665,7 +666,7 @@ private:
TracedValue m_nPackets; //!< Number of packets in the queue
TracedValue m_nBytes; //!< Number of bytes in the queue
- TracedValue