use CopyObject and not Create to copy RttMeanDeviation. Implement the copy constructor correctly.
This commit is contained in:
@@ -74,12 +74,9 @@ RttEstimator::RttEstimator () : next (1), history (),
|
||||
//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::ClearSent ()
|
||||
|
||||
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 @@ Time RttMeanDeviation::RetransmitTimeout ()
|
||||
|
||||
Ptr<RttEstimator> RttMeanDeviation::Copy () const
|
||||
{
|
||||
return Create<RttMeanDeviation> (*this);
|
||||
return CopyObject<RttMeanDeviation> (this);
|
||||
}
|
||||
|
||||
void RttMeanDeviation::Reset ()
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
static TypeId GetTypeId (void);
|
||||
|
||||
RttEstimator();
|
||||
RttEstimator(Time e);
|
||||
RttEstimator(const RttEstimator&); // Copy constructor
|
||||
virtual ~RttEstimator();
|
||||
|
||||
@@ -71,7 +70,6 @@ private:
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user