diff --git a/src/core/enum-value.cc b/src/core/enum-value.cc index 8cc1c110a..1701b2d4d 100644 --- a/src/core/enum-value.cc +++ b/src/core/enum-value.cc @@ -134,12 +134,4 @@ EnumParamSpec::GetInitialValue (void) const return PValue::Create (m_valueSet.front ().first); } -PValue -EnumParamSpec::CreateValue (void) const -{ - return PValue::Create (m_valueSet.front ().first); -} - - - } // namespace ns3 diff --git a/src/core/enum-value.h b/src/core/enum-value.h index 65361f819..af3b5ccee 100644 --- a/src/core/enum-value.h +++ b/src/core/enum-value.h @@ -37,7 +37,6 @@ public: virtual bool Check (PValue value) const; virtual PValue GetInitialValue (void) const; - virtual PValue CreateValue (void) const; private: virtual bool DoSet (ObjectBase *object, const EnumValue *value) const = 0; virtual bool DoGet (const ObjectBase *object, EnumValue *value) const = 0; diff --git a/src/core/object-vector.cc b/src/core/object-vector.cc index 3cef5c8bb..9280439a0 100644 --- a/src/core/object-vector.cc +++ b/src/core/object-vector.cc @@ -107,11 +107,5 @@ ObjectVectorParamSpec::GetInitialValue (void) const { return PValue::Create (); } -PValue -ObjectVectorParamSpec::CreateValue (void) const -{ - return PValue::Create (); -} - } // name diff --git a/src/core/object-vector.h b/src/core/object-vector.h index dbd64733c..d7e258f40 100644 --- a/src/core/object-vector.h +++ b/src/core/object-vector.h @@ -69,7 +69,6 @@ public: virtual bool Get (const ObjectBase * object, PValue value) const; virtual bool Check (PValue value) const; virtual PValue GetInitialValue (void) const; - virtual PValue CreateValue (void) const; private: virtual bool DoGetN (const ObjectBase *object, uint32_t *n) const = 0; virtual Ptr DoGet (const ObjectBase *object, uint32_t i) const = 0; diff --git a/src/core/object.cc b/src/core/object.cc index 72a126c51..63e447da4 100644 --- a/src/core/object.cc +++ b/src/core/object.cc @@ -694,7 +694,7 @@ Parameters::DoSet (Ptr spec, PValue value) // attempt to convert to string. std::string str = value.SerializeToString (0); // attempt to convert back to value. - PValue v = spec->CreateValue (); + PValue v = spec->GetInitialValue ().Copy (); ok = v.DeserializeFromString (str, spec); if (!ok) { @@ -792,7 +792,7 @@ Parameters::DeserializeFromString (std::string str) value = str.substr (equal+1, next - (equal+1)); cur++; } - PValue val = info.spec->CreateValue (); + PValue val = info.spec->GetInitialValue ().Copy (); bool ok = val.DeserializeFromString (value, info.spec); if (!ok) { @@ -915,7 +915,7 @@ Object::DoSet (Ptr spec, PValue value) // attempt to convert to string std::string str = value.SerializeToString (0); // attempt to convert back from string. - PValue v = spec->CreateValue (); + PValue v = spec->GetInitialValue ().Copy (); ok = v.DeserializeFromString (str, spec); if (!ok) { @@ -978,7 +978,7 @@ Object::Get (std::string name, std::string &value) const { return false; } - PValue v = info.spec->CreateValue (); + PValue v = info.spec->GetInitialValue ().Copy (); bool ok = info.spec->Get (this, v); if (ok) { @@ -999,7 +999,7 @@ Object::Get (std::string name) const { return PValue (); } - PValue value = info.spec->CreateValue (); + PValue value = info.spec->GetInitialValue ().Copy (); bool ok = info.spec->Get (this, value); if (!ok) { diff --git a/src/core/param-spec-helper.h b/src/core/param-spec-helper.h index 696db23f1..31730eecf 100644 --- a/src/core/param-spec-helper.h +++ b/src/core/param-spec-helper.h @@ -78,11 +78,6 @@ public: return m_initialValue; } - virtual PValue CreateValue (void) const { - return m_initialValue.Copy (); - } - - private: virtual bool DoSet (T *object, const U *v) const = 0; virtual bool DoGet (const T *object, U *v) const = 0; diff --git a/src/core/value.h b/src/core/value.h index b2a97b7ed..38754ff70 100644 --- a/src/core/value.h +++ b/src/core/value.h @@ -77,7 +77,6 @@ public: virtual bool Get (const ObjectBase * object, PValue value) const = 0; virtual bool Check (PValue value) const = 0; virtual PValue GetInitialValue (void) const = 0; - virtual PValue CreateValue (void) const = 0; private: mutable uint32_t m_count; }; @@ -273,9 +272,6 @@ public: return true; } virtual PValue GetInitialValue (void) const { - return CreateValue (); - } - virtual PValue CreateValue (void) const { return PValue::Create > (Ptr (0)); } private: