get rid of ParamSpec::CreateValue.
This commit is contained in:
@@ -134,12 +134,4 @@ EnumParamSpec::GetInitialValue (void) const
|
||||
return PValue::Create<EnumValue> (m_valueSet.front ().first);
|
||||
}
|
||||
|
||||
PValue
|
||||
EnumParamSpec::CreateValue (void) const
|
||||
{
|
||||
return PValue::Create<EnumValue> (m_valueSet.front ().first);
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -107,11 +107,5 @@ ObjectVectorParamSpec::GetInitialValue (void) const
|
||||
{
|
||||
return PValue::Create<ObjectVectorValue> ();
|
||||
}
|
||||
PValue
|
||||
ObjectVectorParamSpec::CreateValue (void) const
|
||||
{
|
||||
return PValue::Create<ObjectVectorValue> ();
|
||||
}
|
||||
|
||||
|
||||
} // name
|
||||
|
||||
@@ -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<Object> DoGet (const ObjectBase *object, uint32_t i) const = 0;
|
||||
|
||||
@@ -694,7 +694,7 @@ Parameters::DoSet (Ptr<const ParamSpec> 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<const ParamSpec> 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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<PtrValue<U> > (Ptr<U> (0));
|
||||
}
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user