use CopyObject and not Create to copy RttMeanDeviation. Implement the copy constructor correctly.
--- a/src/internet-node/rtt-estimator.cc Fri Apr 18 14:35:10 2008 -0700
+++ b/src/internet-node/rtt-estimator.cc Fri Apr 18 14:35:38 2008 -0700
@@ -74,12 +74,9 @@
//note next=1 everywhere since first segment will have sequence 1
}
-RttEstimator::RttEstimator (Time e) : next (1), history (), est (e),
- nSamples (0), multiplier (1.0)
-{ }
-
RttEstimator::RttEstimator(const RttEstimator& c)
- : next(c.next), history(c.history), est(c.est), nSamples(c.nSamples),
+ : Object (c), next(c.next), history(c.history),
+ m_maxMultiplier (c.m_maxMultiplier), est(c.est), nSamples(c.nSamples),
multiplier(c.multiplier)
{}
@@ -144,6 +141,10 @@
void RttEstimator::IncreaseMultiplier ()
{
+ double a;
+ a = multiplier * 2.0;
+ double b;
+ b = m_maxMultiplier * 2.0;
multiplier = std::min (multiplier * 2.0, m_maxMultiplier);
}
@@ -223,7 +224,7 @@
Ptr<RttEstimator> RttMeanDeviation::Copy () const
{
- return Create<RttMeanDeviation> (*this);
+ return CopyObject<RttMeanDeviation> (this);
}
void RttMeanDeviation::Reset ()
--- a/src/internet-node/rtt-estimator.h Fri Apr 18 14:35:10 2008 -0700
+++ b/src/internet-node/rtt-estimator.h Fri Apr 18 14:35:38 2008 -0700
@@ -51,7 +51,6 @@
static TypeId GetTypeId (void);
RttEstimator();
- RttEstimator(Time e);
RttEstimator(const RttEstimator&); // Copy constructor
virtual ~RttEstimator();
@@ -71,7 +70,6 @@
SequenceNumber next; // Next expected sequence to be sent
RttHistory_t history; // List of sent packet
double m_maxMultiplier;
- Time m_initialEstimate;
public:
Time est; // Current estimate
uint32_t nSamples;// Number of samples