diff -r 854dbe96e04c -r 28ce210b91bb src/core/random-variable-default-value.cc --- a/src/core/random-variable-default-value.cc Fri Feb 15 19:14:35 2008 +0100 +++ b/src/core/random-variable-default-value.cc Fri Feb 15 20:03:48 2008 +0100 @@ -39,17 +39,17 @@ DefaultValueList::Add (this); } -RandomVariable * -RandomVariableDefaultValue::GetCopy (void) +RandomVariable +RandomVariableDefaultValue::Get (void) const { - RandomVariable *variable; + RandomVariable variable; bool ok; ok = Parse (m_value, true, &variable); NS_ASSERT (ok); return variable; } double -RandomVariableDefaultValue::ReadAsDouble (std::string value, bool &ok) +RandomVariableDefaultValue::ReadAsDouble (std::string value, bool &ok) const { double v; std::istringstream iss; @@ -60,7 +60,7 @@ } bool RandomVariableDefaultValue::Parse (const std::string &value, - bool mustCreate, RandomVariable **pVariable) + bool mustCreate, RandomVariable *pVariable) const { std::string::size_type pos = value.find_first_of(":"); if (pos == std::string::npos) @@ -76,7 +76,7 @@ if (mustCreate) { NS_LOG_LOGIC ("create Constant constant=" << constant); - *pVariable = new ConstantVariable (constant); + *pVariable = ConstantVariable (constant); } else { @@ -100,7 +100,7 @@ if (mustCreate) { NS_LOG_LOGIC ("create Uniform min=" << min << ", max=" << max); - *pVariable = new UniformVariable (minVal, maxVal); + *pVariable = UniformVariable (minVal, maxVal); } else {