small tweaking

This commit is contained in:
Mathieu Lacage
2008-02-18 05:53:51 +01:00
parent 4dce1b28b8
commit cccdb1f6d6
2 changed files with 9 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ InitialValue::GetHelp (void) const
return m_help;
}
PValue
InitialValue::GetInitialValue (void) const
InitialValue::GetValue (void) const
{
return m_initialValue;
}
@@ -44,7 +44,7 @@ InitialValue::GetChecker (void) const
}
void
InitialValue::SetInitialValue (PValue value)
InitialValue::SetValue (PValue value)
{
if (!m_checker->Check (value))
{
@@ -60,11 +60,13 @@ InitialValue::Bind (std::string name, PValue value)
{
if ((*i)->GetName () == name)
{
(*i)->SetInitialValue (value);
(*i)->SetValue (value);
return;
}
}
NS_FATAL_ERROR ("InitialValue name=\""<<name<<"\" not found.");
// since we did not find a matching InitialValue,
// we attempt to configure the global parameters list.
Parameters::GetGlobal ()->Set (name, value);
}
InitialValue::Iterator
InitialValue::Begin (void)
@@ -117,7 +119,7 @@ InitialValueTests::RunTests (void)
{
bool result = true;
NS_TEST_ASSERT_EQUAL (10, UintValue (g_uint.GetInitialValue ()).Get ());
NS_TEST_ASSERT_EQUAL (10, UintValue (g_uint.GetValue ()).Get ());
return result;
}

View File

@@ -21,10 +21,10 @@ public:
std::string GetName (void) const;
std::string GetHelp (void) const;
PValue GetInitialValue (void) const;
PValue GetValue (void) const;
Ptr<const AttributeChecker> GetChecker (void) const;
void SetInitialValue (PValue value);
void SetValue (PValue value);
static void Bind (std::string name, PValue value);