--- a/samples/main-grid-topology.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/samples/main-grid-topology.cc Thu Feb 21 00:09:16 2008 +0100
@@ -33,7 +33,7 @@
"MinY", FpValue (-100.0),
"DeltaX", FpValue (5.0),
"DeltaY", FpValue (20.0),
- "GridWidth", UintValue (20),
+ "GridWidth", Uinteger (20),
"LayoutType", "RowFirst");
// each object will be attached a static position.
// i.e., once set by the "position allocator", the
--- a/src/core/initial-value.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/initial-value.cc Thu Feb 21 00:09:16 2008 +0100
@@ -96,8 +96,8 @@
namespace {
static ns3::InitialValue g_uint = ns3::InitialValue ("TestUint", "help text",
- ns3::UintValue (10),
- ns3::MakeUintChecker<uint32_t> ());
+ ns3::Uinteger (10),
+ ns3::MakeUintegerChecker<uint32_t> ());
}
@@ -120,7 +120,7 @@
{
bool result = true;
- NS_TEST_ASSERT_EQUAL (10, UintValue (g_uint.GetValue ()).Get ());
+ NS_TEST_ASSERT_EQUAL (10, Uinteger (g_uint.GetValue ()).Get ());
return result;
}
--- a/src/core/int-value.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/int-value.cc Thu Feb 21 00:09:16 2008 +0100
@@ -4,80 +4,65 @@
namespace ns3 {
-IntValue::IntValue (int64_t value)
+Integer::Integer (int64_t value)
: m_value (value)
{}
-Attribute
-IntValue::Copy (void) const
-{
- return Attribute::Create<IntValue> (*this);
-}
-
+Integer::Integer ()
+ : m_value (0)
+{}
void
-IntValue::Set (int64_t value)
+Integer::Set (int64_t value)
{
m_value = value;
}
int64_t
-IntValue::Get (void) const
+Integer::Get (void) const
+{
+ return m_value;
+}
+
+Integer::operator int64_t () const
{
return m_value;
}
-std::string
-IntValue::SerializeToString (Ptr<const AttributeChecker> checker) const
+
+ATTRIBUTE_VALUE_IMPLEMENT (Integer);
+
+std::ostream &operator << (std::ostream &os, const Integer &integer)
{
- std::ostringstream oss;
- oss << m_value;
- return oss.str ();
+ os << integer.Get ();
+ return os;
}
-bool
-IntValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker)
+std::istream &operator >> (std::istream &is, Integer &integer)
{
int64_t v;
- std::istringstream iss;
- iss.str (value);
- iss >> v;
- bool ok = !iss.bad () && !iss.fail ();
- if (ok)
- {
- m_value = v;
- }
- return ok;
+ is >> v;
+ integer.Set (v);
+ return is;
}
-IntValue::IntValue (Attribute value)
-{
- const IntValue *v = value.DynCast<const IntValue *> ();
- if (v == 0)
- {
- NS_FATAL_ERROR ("assigning non-Int value to Int value.");
- }
- m_value = v->m_value;
-}
-IntValue::operator Attribute () const
-{
- return Attribute::Create<IntValue> (*this);
-}
+ATTRIBUTE_CONVERTER_IMPLEMENT (Integer);
+
Ptr<const AttributeChecker>
-MakeIntChecker (int64_t min, int64_t max)
+MakeIntegerChecker (int64_t min, int64_t max)
{
- struct IntChecker : public AttributeChecker
+ struct IntegerChecker : public AttributeChecker
{
- IntChecker (int64_t minValue, int64_t maxValue)
+ IntegerChecker (int64_t minValue, int64_t maxValue)
: m_minValue (minValue),
m_maxValue (maxValue) {}
virtual bool Check (Attribute value) const {
- const IntValue *v = value.DynCast<const IntValue *> ();
+ const IntegerValue *v = value.DynCast<const IntegerValue *> ();
if (v == 0)
{
return false;
}
- return v->Get () >= m_minValue && v->Get () <= m_maxValue;
+ return v->Get ().Get () >= m_minValue && v->Get ().Get() <= m_maxValue;
}
int64_t m_minValue;
int64_t m_maxValue;
- } *checker = new IntChecker (min, max);
+ } *checker = new IntegerChecker (min, max);
return Ptr<AttributeChecker> (checker, false);
}
--- a/src/core/int-value.h Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/int-value.h Thu Feb 21 00:09:16 2008 +0100
@@ -1,65 +1,49 @@
-#ifndef INT_VALUE_H
-#define INT_VALUE_H
+#ifndef INTEGER_H
+#define INTEGER_H
#include "attribute.h"
-#include "param-spec-helper.h"
+#include "value-helper.h"
#include <stdint.h>
namespace ns3 {
-class IntValue : public AttributeValue
+class Integer
{
public:
- IntValue (int64_t value);
+ Integer (int64_t value);
+ Integer ();
void Set (int64_t value);
int64_t Get (void) const;
- virtual Attribute Copy (void) const;
- virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const;
- virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker);
-
- IntValue (Attribute value);
- operator Attribute () const;
+ operator int64_t () const;
+ ATTRIBUTE_CONVERTER_DEFINE (Integer);
private:
int64_t m_value;
};
-class IntAccessor : public AttributeAccessor {};
+std::ostream &operator << (std::ostream &os, const Integer &integer);
+std::istream &operator >> (std::istream &is, Integer &integer);
-template <typename T1>
-Ptr<const AttributeAccessor> MakeIntAccessor (T1 a1);
-template <typename T1, typename T2>
-Ptr<const AttributeAccessor> MakeIntAccessor (T1 a1, T2 a2);
+ATTRIBUTE_VALUE_DEFINE(Integer);
+ATTRIBUTE_ACCESSOR_DEFINE(Integer);
template <typename T>
-Ptr<const AttributeChecker> MakeIntChecker (void);
+Ptr<const AttributeChecker> MakeIntegerChecker (void);
-Ptr<const AttributeChecker> MakeIntChecker (int64_t min, int64_t max);
+Ptr<const AttributeChecker> MakeIntegerChecker (int64_t min, int64_t max);
} // namespace ns3
namespace ns3 {
-template <typename T1>
-Ptr<const AttributeAccessor>
-MakeIntAccessor (T1 a1)
-{
- return MakeAccessorHelper<IntAccessor,IntValue> (a1);
-}
-template <typename T1, typename T2>
-Ptr<const AttributeAccessor> MakeIntAccessor (T1 a1, T2 a2)
-{
- return MakeAccessorHelper<IntAccessor,IntValue> (a1, a2);
-}
-
template <typename T>
Ptr<const AttributeChecker>
-MakeIntChecker (void)
+MakeIntegerChecker (void)
{
- return MakeIntChecker (std::numeric_limits<T>::min (),
- std::numeric_limits<T>::max ());
+ return MakeIntegerChecker (std::numeric_limits<T>::min (),
+ std::numeric_limits<T>::max ());
}
} // namespace ns3
-#endif /* INT_VALUE_H */
+#endif /* INTEGER_H */
--- a/src/core/random-variable.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/random-variable.cc Thu Feb 21 00:09:16 2008 +0100
@@ -52,7 +52,7 @@
RandomVariableBase (const RandomVariableBase &o);
virtual ~RandomVariableBase();
virtual double GetValue() = 0;
- virtual uint32_t GetIntValue();
+ virtual uint32_t GetInteger();
virtual RandomVariableBase* Copy(void) const = 0;
virtual void GetSeed(uint32_t seed[6]);
@@ -127,7 +127,7 @@
delete m_generator;
}
-uint32_t RandomVariableBase::GetIntValue()
+uint32_t RandomVariableBase::GetInteger()
{
return (uint32_t)GetValue();
}
@@ -269,9 +269,9 @@
}
uint32_t
-RandomVariable::GetIntValue (void) const
+RandomVariable::GetInteger (void) const
{
- return m_variable->GetIntValue ();
+ return m_variable->GetInteger ();
}
void
RandomVariable::GetSeed(uint32_t seed[6]) const
@@ -455,7 +455,7 @@
* \return The constant value specified
*/
virtual double GetValue();
- virtual uint32_t GetIntValue();
+ virtual uint32_t GetInteger();
virtual RandomVariableBase* Copy(void) const;
private:
double m_const;
@@ -478,7 +478,7 @@
return m_const;
}
-uint32_t ConstantVariableImpl::GetIntValue()
+uint32_t ConstantVariableImpl::GetInteger()
{
return (uint32_t)m_const;
}
@@ -1276,7 +1276,7 @@
/**
* \return An integer value from this empirical distribution
*/
- virtual uint32_t GetIntValue();
+ virtual uint32_t GetInteger();
private:
virtual double Interpolate(double, double, double, double, double);
};
@@ -1284,7 +1284,7 @@
IntEmpiricalVariableImpl::IntEmpiricalVariableImpl() { }
-uint32_t IntEmpiricalVariableImpl::GetIntValue()
+uint32_t IntEmpiricalVariableImpl::GetInteger()
{
return (uint32_t)GetValue();
}
--- a/src/core/random-variable.h Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/random-variable.h Thu Feb 21 00:09:16 2008 +0100
@@ -72,7 +72,7 @@
* \brief Returns a random integer integer from the underlying distribution
* \return Integer cast of ::GetValue()
*/
- uint32_t GetIntValue (void) const;
+ uint32_t GetInteger (void) const;
/**
* \brief Get the internal state of the RNG
--- a/src/core/uint-value.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/uint-value.cc Thu Feb 21 00:09:16 2008 +0100
@@ -4,63 +4,43 @@
namespace ns3 {
-UintValue::UintValue (uint64_t value)
+Uinteger::Uinteger (uint64_t value)
: m_value (value)
{}
-Attribute
-UintValue::Copy (void) const
-{
- return Attribute::Create<UintValue> (*this);
-}
-
+Uinteger::Uinteger ()
+{}
void
-UintValue::Set (uint64_t value)
+Uinteger::Set (uint64_t value)
{
m_value = value;
}
uint64_t
-UintValue::Get (void) const
+Uinteger::Get (void) const
+{
+ return m_value;
+}
+Uinteger::operator uint64_t () const
{
return m_value;
}
-std::string
-UintValue::SerializeToString (Ptr<const AttributeChecker> checker) const
+std::ostream & operator << (std::ostream &os, const Uinteger &uinteger)
{
- std::ostringstream oss;
- oss << m_value;
- return oss.str ();
+ os << uinteger.Get ();
+ return os;
}
-bool
-UintValue::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker)
+std::istream & operator >> (std::istream &is, Uinteger &uinteger)
{
uint64_t v;
- std::istringstream iss;
- iss.str (value);
- iss >> v;
- bool ok = !iss.bad () && !iss.fail ();
- if (ok)
- {
- m_value = v;
- }
- return ok;
+ is >> v;
+ uinteger.Set (v);
+ return is;
}
-UintValue::UintValue (Attribute value)
-{
- const UintValue *v = value.DynCast<const UintValue *> ();
- if (v == 0)
- {
- NS_FATAL_ERROR ("assigning non-Uint value to Uint value.");
- }
- m_value = v->m_value;
-}
-UintValue::operator Attribute () const
-{
- return Attribute::Create<UintValue> (*this);
-}
+ATTRIBUTE_CONVERTER_IMPLEMENT(Uinteger);
+ATTRIBUTE_VALUE_IMPLEMENT(Uinteger);
-Ptr<const AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max)
+Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max)
{
struct Checker : public AttributeChecker
{
@@ -68,12 +48,12 @@
: m_minValue (minValue),
m_maxValue (maxValue) {}
virtual bool Check (Attribute value) const {
- const UintValue *v = value.DynCast<const UintValue *> ();
+ const UintegerValue *v = value.DynCast<const UintegerValue *> ();
if (v == 0)
{
return false;
}
- return v->Get () >= m_minValue && v->Get () <= m_maxValue;
+ return v->Get ().Get () >= m_minValue && v->Get ().Get () <= m_maxValue;
}
uint64_t m_minValue;
uint64_t m_maxValue;
--- a/src/core/uint-value.h Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/uint-value.h Thu Feb 21 00:09:16 2008 +0100
@@ -1,65 +1,50 @@
-#ifndef UINT_VALUE_H
-#define UINT_VALUE_H
+#ifndef UINTEGER_H
+#define UINTEGER_H
#include "attribute.h"
-#include "param-spec-helper.h"
+#include "value-helper.h"
#include <stdint.h>
namespace ns3 {
-class UintValue : public AttributeValue
+class Uinteger
{
public:
- UintValue (uint64_t value);
- virtual Attribute Copy (void) const;
- virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const;
- virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker);
+ Uinteger (uint64_t value);
+ Uinteger ();
void Set (uint64_t value);
uint64_t Get (void) const;
- UintValue (Attribute value);
- operator Attribute () const;
+ operator uint64_t () const;
+
+ ATTRIBUTE_CONVERTER_DEFINE (Uinteger);
private:
uint64_t m_value;
};
-class UintAccessor : public AttributeAccessor {};
+std::ostream & operator << (std::ostream &os, const Uinteger &uinteger);
+std::istream & operator >> (std::istream &is, Uinteger &uinteger);
-template <typename T1>
-Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1);
-template <typename T1, typename T2>
-Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1, T2 a2);
+ATTRIBUTE_VALUE_DEFINE (Uinteger);
+ATTRIBUTE_ACCESSOR_DEFINE (Uinteger);
template <typename T>
-Ptr<const AttributeChecker> MakeUintChecker (void);
+Ptr<const AttributeChecker> MakeUintegerChecker (void);
-Ptr<const AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max);
+Ptr<const AttributeChecker> MakeUintegerChecker (uint64_t min, uint64_t max);
} // namespace ns3
namespace ns3 {
-template <typename T1>
-Ptr<const AttributeAccessor>
-MakeUintAccessor (T1 a1)
+template <typename T>
+Ptr<const AttributeChecker> MakeUintegerChecker (void)
{
- return MakeAccessorHelper<UintAccessor,UintValue> (a1);
-}
-
-template <typename T1, typename T2>
-Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1, T2 a2)
-{
- return MakeAccessorHelper<UintAccessor,UintValue> (a1, a2);
-}
-
-template <typename T>
-Ptr<const AttributeChecker> MakeUintChecker (void)
-{
- return MakeUintChecker (std::numeric_limits<T>::min (),
- std::numeric_limits<T>::max ());
+ return MakeUintegerChecker (std::numeric_limits<T>::min (),
+ std::numeric_limits<T>::max ());
}
} // namespace ns3
-#endif /* UINT_PARAMETER_H */
+#endif /* UINTEGER_H */
--- a/src/core/value-helper.h Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/value-helper.h Thu Feb 21 00:09:16 2008 +0100
@@ -3,39 +3,118 @@
#include "class-value-helper.h"
-#define VALUE_HELPER_HEADER_1(type) \
- type (Attribute value); \
- operator Attribute () const;
-#define VALUE_HELPER_HEADER_2(type) \
- class type##Value : public AttributeValue {}; \
+#define ATTRIBUTE_ACCESSOR_DEFINE(type) \
class type##Accessor : public AttributeAccessor {}; \
- Ptr<const AttributeChecker> Make##type##Checker (void); \
template <typename T1> \
Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1) \
{ \
- return MakeClassValueHelperAccessor< type , \
- type##Value, type##Accessor> (a1); \
+ return MakeAccessorHelper<type##Accessor,type##Value> (a1); \
} \
template <typename T1, typename T2> \
Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1, T2 a2) \
{ \
- return MakeClassValueHelperAccessor<type, \
- type##Value,type##Accessor> (a1, a2); \
+ return MakeAccessorHelper<type##Accessor,type##Value> (a1, a2); \
}
-#define VALUE_HELPER_CPP(type) \
+#define ATTRIBUTE_VALUE_DEFINE(type) \
+ class type##Value : public AttributeValue \
+ { \
+ public: \
+ type##Value (const type &value); \
+ void Set (const type &value); \
+ type Get (void) const; \
+ virtual Attribute Copy (void) const; \
+ virtual std::string SerializeToString (Ptr<const AttributeChecker> checker) const; \
+ virtual bool DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker); \
+ type##Value (Attribute value); \
+ operator Attribute () const; \
+ private: \
+ type m_value; \
+ };
+
+#define ATTRIBUTE_CONVERTER_DEFINE(type) \
+ type (Attribute value); \
+ operator Attribute () const;
+
+#define ATTRIBUTE_CHECKER_DEFINE(type) \
+ Ptr<const AttributeChecker> Make##type##Checker (void); \
+
+#define ATTRIBUTE_VALUE_IMPLEMENT(type) \
+ type##Value::type##Value (const type &value) \
+ : m_value (value) {} \
+ void type##Value::Set (const type &v) { \
+ m_value = v; \
+ } \
+ type type##Value::Get (void) const { \
+ return m_value; \
+ } \
+ Attribute \
+ type##Value::Copy (void) const { \
+ return Attribute::Create<type##Value> (*this); \
+ } \
+ std::string \
+ type##Value::SerializeToString (Ptr<const AttributeChecker> checker) const { \
+ std::ostringstream oss; \
+ oss << m_value; \
+ return oss.str (); \
+ } \
+ bool \
+ type##Value::DeserializeFromString (std::string value, Ptr<const AttributeChecker> checker) { \
+ std::istringstream iss; \
+ iss.str (value); \
+ iss >> m_value; \
+ return !iss.bad () && !iss.fail (); \
+ } \
+ type##Value::type##Value (Attribute value) \
+ { \
+ type##Value *v = value.DynCast<type##Value *> (); \
+ if (v == 0) \
+ { \
+ NS_FATAL_ERROR ("Unexpected type of value. Expected \"" << #type << "Value\""); \
+ } \
+ m_value = v->Get (); \
+ } \
+ type##Value::operator Attribute () const \
+ { \
+ return Attribute::Create<type##Value> (*this); \
+ }
+
+#define ATTRIBUTE_CHECKER_IMPLEMENT(type) \
Ptr<const AttributeChecker> Make##type##Checker (void) \
{ \
return MakeSimpleAttributeChecker<type> (); \
} \
+
+#define ATTRIBUTE_CONVERTER_IMPLEMENT(type) \
type::type (Attribute value) \
{ \
- *this = ClassValueHelperExtractFrom<type,type##Value> (value); \
+ const type##Value *v = value.DynCast<const type##Value *> (); \
+ if (v == 0) \
+ { \
+ NS_FATAL_ERROR ("Unexpected type of value. Expected \"" << #type << "Value\""); \
+ } \
+ *this = v->Get (); \
} \
type::operator Attribute () const \
{ \
- return ClassValueHelperConvertTo<type,type##Value> (this); \
+ return Attribute::Create<type##Value> (*this); \
}
+
+#define VALUE_HELPER_HEADER_1(type) \
+ ATTRIBUTE_CONVERTER_DEFINE (type)
+
+#define VALUE_HELPER_HEADER_2(type) \
+ ATTRIBUTE_VALUE_DEFINE (type); \
+ ATTRIBUTE_ACCESSOR_DEFINE (type); \
+ ATTRIBUTE_CHECKER_DEFINE (type);
+
+#define VALUE_HELPER_CPP(type) \
+ ATTRIBUTE_CHECKER_IMPLEMENT (type); \
+ ATTRIBUTE_CONVERTER_IMPLEMENT (type); \
+ ATTRIBUTE_VALUE_IMPLEMENT (type);
+
+
+
#endif /* VALUE_HELPER_H */
--- a/src/core/value-test.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/core/value-test.cc Thu Feb 21 00:09:16 2008 +0100
@@ -55,22 +55,22 @@
MakePtrAccessor (&AccessorObjectTest::m_derived),
MakePtrChecker<Derived> ())
.AddParameter ("TestInt16", "help text",
- IntValue (-2),
- MakeIntAccessor (&AccessorObjectTest::m_int16),
- MakeIntChecker<int16_t> ())
+ Integer (-2),
+ MakeIntegerAccessor (&AccessorObjectTest::m_int16),
+ MakeIntegerChecker<int16_t> ())
.AddParameter ("TestInt16WithBounds", "help text",
- IntValue (-2),
- MakeIntAccessor (&AccessorObjectTest::m_int16WithBounds),
- MakeIntChecker (-5, 10))
+ Integer (-2),
+ MakeIntegerAccessor (&AccessorObjectTest::m_int16WithBounds),
+ MakeIntegerChecker (-5, 10))
.AddParameter ("TestInt16SetGet", "help text",
- IntValue (6),
- MakeIntAccessor (&AccessorObjectTest::DoSetInt16,
+ Integer (6),
+ MakeIntegerAccessor (&AccessorObjectTest::DoSetInt16,
&AccessorObjectTest::DoGetInt16),
- MakeIntChecker<int16_t> ())
+ MakeIntegerChecker<int16_t> ())
.AddParameter ("TestUint8", "help text",
- UintValue (1),
- MakeUintAccessor (&AccessorObjectTest::m_uint8),
- MakeUintChecker<uint8_t> ())
+ Uinteger (1),
+ MakeUintegerAccessor (&AccessorObjectTest::m_uint8),
+ MakeUintegerChecker<uint8_t> ())
.AddParameter ("TestEnum", "help text",
EnumValue (TEST_A),
MakeEnumAccessor (&AccessorObjectTest::m_enum),
@@ -152,8 +152,7 @@
{ \
const type expected = value; \
type got = value; \
- Attribute v = p->Get (name); \
- NS_TEST_ASSERT (v.DynCast<type *> () != 0); \
+ Attribute v = p->Get (name); \
got = v; \
NS_TEST_ASSERT_EQUAL (got.Get (), expected.Get ()); \
}
@@ -218,72 +217,72 @@
NS_TEST_ASSERT (derived != 0);
CHECK_GET_STR (p, "TestInt16", "-2");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, -2);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, -2);
NS_TEST_ASSERT (p->Set ("TestInt16", "-5"));
CHECK_GET_STR (p, "TestInt16", "-5");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, -5);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, -5);
- NS_TEST_ASSERT (p->Set ("TestInt16", IntValue (+2)));
+ NS_TEST_ASSERT (p->Set ("TestInt16", Integer (+2)));
CHECK_GET_STR (p, "TestInt16", "2");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, +2);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, +2);
- NS_TEST_ASSERT (p->Set ("TestInt16", IntValue (-32768)));
+ NS_TEST_ASSERT (p->Set ("TestInt16", Integer (-32768)));
CHECK_GET_STR (p, "TestInt16", "-32768");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, -32768);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, -32768);
- NS_TEST_ASSERT (!p->Set ("TestInt16", IntValue (-32769)));
+ NS_TEST_ASSERT (!p->Set ("TestInt16", Integer (-32769)));
CHECK_GET_STR (p, "TestInt16", "-32768");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, -32768);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, -32768);
- NS_TEST_ASSERT (p->Set ("TestInt16", IntValue (32767)));
+ NS_TEST_ASSERT (p->Set ("TestInt16", Integer (32767)));
CHECK_GET_STR (p, "TestInt16", "32767");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, 32767);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, 32767);
- NS_TEST_ASSERT (!p->Set ("TestInt16", IntValue (32768)));
+ NS_TEST_ASSERT (!p->Set ("TestInt16", Integer (32768)));
CHECK_GET_STR (p, "TestInt16", "32767");
- CHECK_GET_PARAM (p, "TestInt16", IntValue, 32767);
+ CHECK_GET_PARAM (p, "TestInt16", Integer, 32767);
- NS_TEST_ASSERT (p->Set ("TestInt16WithBounds", IntValue (10)));
+ NS_TEST_ASSERT (p->Set ("TestInt16WithBounds", Integer (10)));
CHECK_GET_STR (p, "TestInt16WithBounds", "10");
- CHECK_GET_PARAM (p, "TestInt16WithBounds", IntValue, 10);
- NS_TEST_ASSERT (!p->Set ("TestInt16WithBounds", IntValue (11)));
+ CHECK_GET_PARAM (p, "TestInt16WithBounds", Integer, 10);
+ NS_TEST_ASSERT (!p->Set ("TestInt16WithBounds", Integer (11)));
CHECK_GET_STR (p, "TestInt16WithBounds", "10");
- CHECK_GET_PARAM (p, "TestInt16WithBounds", IntValue, 10);
+ CHECK_GET_PARAM (p, "TestInt16WithBounds", Integer, 10);
- NS_TEST_ASSERT (p->Set ("TestInt16WithBounds", IntValue (-5)));
+ NS_TEST_ASSERT (p->Set ("TestInt16WithBounds", Integer (-5)));
CHECK_GET_STR (p, "TestInt16WithBounds", "-5");
- CHECK_GET_PARAM (p, "TestInt16WithBounds", IntValue, -5);
- NS_TEST_ASSERT (!p->Set ("TestInt16WithBounds", IntValue (-6)));
+ CHECK_GET_PARAM (p, "TestInt16WithBounds", Integer, -5);
+ NS_TEST_ASSERT (!p->Set ("TestInt16WithBounds", Integer (-6)));
CHECK_GET_STR (p, "TestInt16WithBounds", "-5");
- CHECK_GET_PARAM (p, "TestInt16WithBounds", IntValue, -5);
+ CHECK_GET_PARAM (p, "TestInt16WithBounds", Integer, -5);
CHECK_GET_STR (p, "TestInt16SetGet", "6");
- CHECK_GET_PARAM (p, "TestInt16SetGet", IntValue, 6);
- NS_TEST_ASSERT (p->Set ("TestInt16SetGet", IntValue (0)));
+ CHECK_GET_PARAM (p, "TestInt16SetGet", Integer, 6);
+ NS_TEST_ASSERT (p->Set ("TestInt16SetGet", Integer (0)));
CHECK_GET_STR (p, "TestInt16SetGet", "0");
- CHECK_GET_PARAM (p, "TestInt16SetGet", IntValue, 0);
+ CHECK_GET_PARAM (p, "TestInt16SetGet", Integer, 0);
CHECK_GET_STR (p, "TestUint8", "1");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 1);
- NS_TEST_ASSERT (p->Set ("TestUint8", UintValue (0)));
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 1);
+ NS_TEST_ASSERT (p->Set ("TestUint8", Uinteger (0)));
CHECK_GET_STR (p, "TestUint8", "0");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 0);
- NS_TEST_ASSERT (p->Set ("TestUint8", UintValue (255)));
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 0);
+ NS_TEST_ASSERT (p->Set ("TestUint8", Uinteger (255)));
CHECK_GET_STR (p, "TestUint8", "255");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 255);
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 255);
NS_TEST_ASSERT (p->Set ("TestUint8", "255"));
CHECK_GET_STR (p, "TestUint8", "255");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 255);
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 255);
NS_TEST_ASSERT (!p->Set ("TestUint8", "256"));
CHECK_GET_STR (p, "TestUint8", "255");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 255);
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 255);
NS_TEST_ASSERT (!p->Set ("TestUint8", "-1"));
CHECK_GET_STR (p, "TestUint8", "255");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 255);
- NS_TEST_ASSERT (!p->Set ("TestUint8", UintValue (-1)));
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 255);
+ NS_TEST_ASSERT (!p->Set ("TestUint8", Uinteger (-1)));
CHECK_GET_STR (p, "TestUint8", "255");
- CHECK_GET_PARAM (p, "TestUint8", UintValue, 255);
+ CHECK_GET_PARAM (p, "TestUint8", Uinteger, 255);
CHECK_GET_STR (p, "TestFloat", "-1.1");
NS_TEST_ASSERT (p->Set ("TestFloat", FpValue ((float)+2.3)));
--- a/src/mobility/position-allocator.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/mobility/position-allocator.cc Thu Feb 21 00:09:16 2008 +0100
@@ -54,9 +54,9 @@
.SetGroupName ("Mobility")
.AddConstructor<GridPositionAllocator> ()
.AddParameter ("GridWidth", "The number of objects layed out on a line.",
- IntValue (10),
- MakeIntAccessor (&GridPositionAllocator::m_n),
- MakeIntChecker<uint32_t> ())
+ Integer (10),
+ MakeIntegerAccessor (&GridPositionAllocator::m_n),
+ MakeIntegerChecker<uint32_t> ())
.AddParameter ("MinX", "The x coordinate where the grid starts.",
FpValue (1.0),
MakeFpAccessor (&GridPositionAllocator::m_xMin),
--- a/src/node/drop-tail-queue.cc Wed Feb 20 21:45:42 2008 +0100
+++ b/src/node/drop-tail-queue.cc Thu Feb 21 00:09:16 2008 +0100
@@ -33,9 +33,9 @@
.SetParent<Queue> ()
.AddConstructor<DropTailQueue> ()
.AddParameter ("MaxPackets", "The maximum number of packets accepted by this DropTailQueue.",
- UintValue (100),
- MakeUintAccessor (&DropTailQueue::m_maxPackets),
- MakeUintChecker<uint32_t> ())
+ Uinteger (100),
+ MakeUintegerAccessor (&DropTailQueue::m_maxPackets),
+ MakeUintegerChecker<uint32_t> ())
;
return tid;
@@ -133,7 +133,7 @@
bool result = true;
Ptr<DropTailQueue> queue = CreateObject<DropTailQueue> ();
- NS_TEST_ASSERT (queue->Set ("MaxPackets", UintValue (3)));
+ NS_TEST_ASSERT (queue->Set ("MaxPackets", Uinteger (3)));
Ptr<Packet> p1, p2, p3, p4;
p1 = Create<Packet> ();