--- a/src/core/boolean-value.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/boolean-value.cc Wed Feb 20 20:57:59 2008 +0100
@@ -71,7 +71,7 @@
return Attribute::Create<BooleanValue> (*this);
}
-Ptr<AttributeChecker> MakeBooleanChecker (void)
+Ptr<const AttributeChecker> MakeBooleanChecker (void)
{
return MakeSimpleAttributeChecker<BooleanValue> ();
}
--- a/src/core/boolean-value.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/boolean-value.h Wed Feb 20 20:57:59 2008 +0100
@@ -24,16 +24,16 @@
bool m_value;
};
-class BooleanAccessor : public Accessor {};
+class BooleanAccessor : public AttributeAccessor {};
template <typename T1>
-Ptr<Accessor> MakeBooleanAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeBooleanAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeBooleanAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeBooleanAccessor (T1 a1, T2 a2);
-Ptr<AttributeChecker> MakeBooleanChecker (void);
+Ptr<const AttributeChecker> MakeBooleanChecker (void);
} // namespace ns3
@@ -42,13 +42,13 @@
namespace ns3 {
template <typename T1>
-Ptr<Accessor> MakeBooleanAccessor (T1 a1)
+Ptr<const AttributeAccessor> MakeBooleanAccessor (T1 a1)
{
return MakeAccessorHelper<BooleanAccessor,BooleanValue> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeBooleanAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeBooleanAccessor (T1 a1, T2 a2)
{
return MakeAccessorHelper<BooleanAccessor,BooleanValue> (a1, a2);
}
--- a/src/core/class-value-helper.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/class-value-helper.h Wed Feb 20 20:57:59 2008 +0100
@@ -77,7 +77,7 @@
template <typename T, typename U, typename BASE, typename T1>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeClassValueHelperAccessor (T1 a1)
{
return MakeAccessorHelper<BASE,ClassValue<T,U> > (a1);
@@ -85,7 +85,7 @@
template <typename T, typename U, typename BASE, typename T1, typename T2>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeClassValueHelperAccessor (T1 a1, T2 a2)
{
return MakeAccessorHelper<BASE,ClassValue<T,U> > (a1, a2);
--- a/src/core/enum-value.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/enum-value.cc Wed Feb 20 20:57:59 2008 +0100
@@ -104,7 +104,7 @@
return false;
}
-Ptr<AttributeChecker>
+Ptr<const AttributeChecker>
MakeEnumChecker (int v1, std::string n1,
int v2, std::string n2,
int v3, std::string n3,
--- a/src/core/enum-value.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/enum-value.h Wed Feb 20 20:57:59 2008 +0100
@@ -24,7 +24,7 @@
int m_v;
};
-class EnumAccessor : public Accessor {};
+class EnumAccessor : public AttributeAccessor {};
class EnumChecker : public AttributeChecker
{
public:
@@ -42,23 +42,23 @@
};
template <typename T1>
-Ptr<Accessor> MakeEnumAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeEnumAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeEnumAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeEnumAccessor (T1 a1, T2 a2);
-Ptr<AttributeChecker> MakeEnumChecker (int v1, std::string n1,
- int v2 = 0, std::string n2 = "",
- int v3 = 0, std::string n3 = "",
- int v4 = 0, std::string n4 = "",
- int v5 = 0, std::string n5 = "",
- int v6 = 0, std::string n6 = "",
- int v7 = 0, std::string n7 = "",
- int v8 = 0, std::string n8 = "",
- int v9 = 0, std::string n9 = "",
- int v10 = 0, std::string n10 = "",
- int v11 = 0, std::string n11 = "",
- int v12 = 0, std::string n12 = "");
+Ptr<const AttributeChecker> MakeEnumChecker (int v1, std::string n1,
+ int v2 = 0, std::string n2 = "",
+ int v3 = 0, std::string n3 = "",
+ int v4 = 0, std::string n4 = "",
+ int v5 = 0, std::string n5 = "",
+ int v6 = 0, std::string n6 = "",
+ int v7 = 0, std::string n7 = "",
+ int v8 = 0, std::string n8 = "",
+ int v9 = 0, std::string n9 = "",
+ int v10 = 0, std::string n10 = "",
+ int v11 = 0, std::string n11 = "",
+ int v12 = 0, std::string n12 = "");
} // namespace ns3
@@ -66,13 +66,13 @@
namespace ns3 {
template <typename T1>
-Ptr<Accessor> MakeEnumAccessor (T1 a1)
+Ptr<const AttributeAccessor> MakeEnumAccessor (T1 a1)
{
return MakeAccessorHelper<EnumAccessor,EnumValue> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeEnumAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeEnumAccessor (T1 a1, T2 a2)
{
return MakeAccessorHelper<EnumAccessor,EnumValue> (a1, a2);
}
--- a/src/core/fp-value.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/fp-value.cc Wed Feb 20 20:57:59 2008 +0100
@@ -59,7 +59,7 @@
return Attribute::Create<FpValue> (*this);
}
-Ptr<AttributeChecker> MakeFpChecker (double min, double max)
+Ptr<const AttributeChecker> MakeFpChecker (double min, double max)
{
struct Checker : public AttributeChecker
{
@@ -77,7 +77,7 @@
double m_minValue;
double m_maxValue;
} *checker = new Checker (min, max);
- return Ptr<AttributeChecker> (checker, false);
+ return Ptr<const AttributeChecker> (checker, false);
}
--- a/src/core/fp-value.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/fp-value.h Wed Feb 20 20:57:59 2008 +0100
@@ -25,17 +25,17 @@
double m_value;
};
-class FpAccessor : public Accessor {};
+class FpAccessor : public AttributeAccessor {};
template <typename T1>
-Ptr<Accessor> MakeFpAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeFpAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeFpAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeFpAccessor (T1 a1, T2 a2);
template <typename T>
-Ptr<AttributeChecker> MakeFpChecker (void);
+Ptr<const AttributeChecker> MakeFpChecker (void);
-Ptr<AttributeChecker> MakeFpChecker (double min, double max);
+Ptr<const AttributeChecker> MakeFpChecker (double min, double max);
@@ -44,18 +44,18 @@
namespace ns3 {
template <typename T1>
-Ptr<Accessor> MakeFpAccessor (T1 a1)
+Ptr<const AttributeAccessor> MakeFpAccessor (T1 a1)
{
return MakeAccessorHelper<FpAccessor,FpValue> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeFpAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeFpAccessor (T1 a1, T2 a2)
{
return MakeAccessorHelper<FpAccessor,FpValue> (a1, a2);
}
template <typename T>
-Ptr<AttributeChecker> MakeFpChecker (void)
+Ptr<const AttributeChecker> MakeFpChecker (void)
{
return MakeFpChecker (-std::numeric_limits<T>::max (),
std::numeric_limits<T>::max ());
--- a/src/core/int-value.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/int-value.cc Wed Feb 20 20:57:59 2008 +0100
@@ -59,7 +59,7 @@
return Attribute::Create<IntValue> (*this);
}
-Ptr<AttributeChecker>
+Ptr<const AttributeChecker>
MakeIntChecker (int64_t min, int64_t max)
{
struct IntChecker : public AttributeChecker
--- a/src/core/int-value.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/int-value.h Wed Feb 20 20:57:59 2008 +0100
@@ -24,36 +24,36 @@
int64_t m_value;
};
-class IntAccessor : public Accessor {};
+class IntAccessor : public AttributeAccessor {};
template <typename T1>
-Ptr<Accessor> MakeIntAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeIntAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeIntAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeIntAccessor (T1 a1, T2 a2);
template <typename T>
-Ptr<AttributeChecker> MakeIntChecker (void);
+Ptr<const AttributeChecker> MakeIntChecker (void);
-Ptr<AttributeChecker> MakeIntChecker (int64_t min, int64_t max);
+Ptr<const AttributeChecker> MakeIntChecker (int64_t min, int64_t max);
} // namespace ns3
namespace ns3 {
template <typename T1>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeIntAccessor (T1 a1)
{
return MakeAccessorHelper<IntAccessor,IntValue> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeIntAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeIntAccessor (T1 a1, T2 a2)
{
return MakeAccessorHelper<IntAccessor,IntValue> (a1, a2);
}
template <typename T>
-Ptr<AttributeChecker>
+Ptr<const AttributeChecker>
MakeIntChecker (void)
{
return MakeIntChecker (std::numeric_limits<T>::min (),
--- a/src/core/object-vector.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/object-vector.cc Wed Feb 20 20:57:59 2008 +0100
@@ -101,7 +101,7 @@
}
return true;
}
-Ptr<AttributeChecker>
+Ptr<const AttributeChecker>
MakeObjectVectorChecker (void)
{
return MakeSimpleAttributeChecker<ObjectVectorValue> ();
--- a/src/core/object-vector.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/object-vector.h Wed Feb 20 20:57:59 2008 +0100
@@ -28,21 +28,21 @@
};
template <typename T, typename U>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeObjectVectorAccessor (U T::*memberVector);
template <typename T, typename U, typename INDEX>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeObjectVectorAccessor (Ptr<U> (T::*get) (INDEX) const,
INDEX (T::*getN) (void) const);
template <typename T, typename U, typename INDEX>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeObjectVectorAccessor (INDEX (T::*getN) (void) const,
Ptr<U> (T::*get) (INDEX) const);
-Ptr<AttributeChecker> MakeObjectVectorChecker (void);
+Ptr<const AttributeChecker> MakeObjectVectorChecker (void);
} // namespace ns3
@@ -65,7 +65,7 @@
ObjectVector m_vector;
};
-class ObjectVectorAccessor : public Accessor
+class ObjectVectorAccessor : public AttributeAccessor
{
public:
virtual bool Set (ObjectBase * object, Attribute value) const;
@@ -76,7 +76,7 @@
};
template <typename T, typename U>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeObjectVectorAccessor (U T::*memberVector)
{
struct MemberStdContainer : public ObjectVectorAccessor
@@ -97,11 +97,11 @@
U T::*m_memberVector;
} *spec = new MemberStdContainer ();
spec->m_memberVector = memberVector;
- return Ptr<Accessor> (spec, false);
+ return Ptr<const AttributeAccessor> (spec, false);
}
template <typename T, typename U, typename INDEX>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeObjectVectorAccessor (Ptr<U> (T::*get) (INDEX) const,
INDEX (T::*getN) (void) const)
{
@@ -125,11 +125,11 @@
} *spec = new MemberGetters ();
spec->m_get = get;
spec->m_getN = getN;
- return Ptr<Accessor> (spec, false);
+ return Ptr<const AttributeAccessor> (spec, false);
}
template <typename T, typename U, typename INDEX>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeObjectVectorAccessor (INDEX (T::*getN) (void) const,
Ptr<U> (T::*get) (INDEX) const)
{
--- a/src/core/object.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/object.cc Wed Feb 20 20:57:59 2008 +0100
@@ -58,13 +58,13 @@
std::string help,
uint32_t flags,
ns3::Attribute initialValue,
- ns3::Ptr<const ns3::Accessor> spec,
+ ns3::Ptr<const ns3::AttributeAccessor> spec,
ns3::Ptr<const ns3::AttributeChecker> checker);
uint32_t GetParametersN (uint16_t uid) const;
std::string GetParameterName (uint16_t uid, uint32_t i) const;
uint32_t GetParameterFlags (uint16_t uid, uint32_t i) const;
ns3::Attribute GetParameterInitialValue (uint16_t uid, uint32_t i) const;
- ns3::Ptr<const ns3::Accessor> GetParameterAccessor (uint16_t uid, uint32_t i) const;
+ ns3::Ptr<const ns3::AttributeAccessor> GetParameterAccessor (uint16_t uid, uint32_t i) const;
ns3::Ptr<const ns3::AttributeChecker> GetParameterChecker (uint16_t uid, uint32_t i) const;
private:
struct ConstructorInformation {
@@ -76,7 +76,7 @@
std::string help;
uint32_t flags;
ns3::Attribute initialValue;
- ns3::Ptr<const ns3::Accessor> param;
+ ns3::Ptr<const ns3::AttributeAccessor> param;
ns3::Ptr<const ns3::AttributeChecker> checker;
};
struct IidInformation {
@@ -247,7 +247,7 @@
std::string help,
uint32_t flags,
ns3::Attribute initialValue,
- ns3::Ptr<const ns3::Accessor> spec,
+ ns3::Ptr<const ns3::AttributeAccessor> spec,
ns3::Ptr<const ns3::AttributeChecker> checker)
{
struct IidInformation *information = LookupInformation (uid);
@@ -298,7 +298,7 @@
NS_ASSERT (i < information->parameters.size ());
return information->parameters[i].initialValue;
}
-ns3::Ptr<const ns3::Accessor>
+ns3::Ptr<const ns3::AttributeAccessor>
IidManager::GetParameterAccessor (uint16_t uid, uint32_t i) const
{
struct IidInformation *information = LookupInformation (uid);
@@ -544,7 +544,7 @@
TypeId::AddParameter (std::string name,
std::string help,
Attribute initialValue,
- Ptr<const Accessor> param,
+ Ptr<const AttributeAccessor> param,
Ptr<const AttributeChecker> checker)
{
Singleton<IidManager>::Get ()->AddParameter (m_tid, name, help, ATTR_SGC, initialValue, param, checker);
@@ -556,7 +556,7 @@
std::string help,
uint32_t flags,
Attribute initialValue,
- Ptr<const Accessor> param,
+ Ptr<const AttributeAccessor> param,
Ptr<const AttributeChecker> checker)
{
Singleton<IidManager>::Get ()->AddParameter (m_tid, name, help, flags, initialValue, param, checker);
@@ -609,11 +609,11 @@
Attribute value = Singleton<IidManager>::Get ()->GetParameterInitialValue (m_tid, i);
return value;
}
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
TypeId::GetParameterAccessor (uint32_t i) const
{
// Used exclusively by the Object class.
- Ptr<const Accessor> param = Singleton<IidManager>::Get ()->GetParameterAccessor (m_tid, i);
+ Ptr<const AttributeAccessor> param = Singleton<IidManager>::Get ()->GetParameterAccessor (m_tid, i);
return param;
}
uint32_t
@@ -896,7 +896,7 @@
NS_LOG_DEBUG ("construct tid="<<tid.GetName ()<<", params="<<tid.GetParametersN ());
for (uint32_t i = 0; i < tid.GetParametersN (); i++)
{
- Ptr<const Accessor> paramSpec = tid.GetParameterAccessor (i);
+ Ptr<const AttributeAccessor> paramSpec = tid.GetParameterAccessor (i);
Attribute initial = tid.GetParameterInitialValue (i);
Ptr<const AttributeChecker> checker = tid.GetParameterChecker (i);
NS_LOG_DEBUG ("try to construct \""<< tid.GetName ()<<"::"<<
@@ -950,7 +950,7 @@
NotifyConstructionCompleted ();
}
bool
-Object::DoSet (Ptr<const Accessor> spec, Attribute initialValue,
+Object::DoSet (Ptr<const AttributeAccessor> spec, Attribute initialValue,
Ptr<const AttributeChecker> checker, Attribute value)
{
bool ok = checker->Check (value);
--- a/src/core/object.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/object.h Wed Feb 20 20:57:59 2008 +0100
@@ -44,7 +44,7 @@
class TraceContext;
class CallbackBase;
class Object;
-class Accessor;
+class AttributeAccessor;
class Value;
class Parameters;
@@ -210,7 +210,7 @@
TypeId AddParameter (std::string name,
std::string help,
Attribute initialValue,
- Ptr<const Accessor> spec,
+ Ptr<const AttributeAccessor> spec,
Ptr<const AttributeChecker> checker);
/**
@@ -227,7 +227,7 @@
std::string help,
uint32_t flags,
Attribute initialValue,
- Ptr<const Accessor> spec,
+ Ptr<const AttributeAccessor> spec,
Ptr<const AttributeChecker> checker);
// construct an invalid TypeId.
@@ -240,7 +240,7 @@
friend bool operator != (TypeId a, TypeId b);
struct ParameterInfo {
- Ptr<const Accessor> spec;
+ Ptr<const AttributeAccessor> spec;
Attribute initialValue;
uint32_t flags;
Ptr<const AttributeChecker> checker;
@@ -265,7 +265,7 @@
explicit TypeId (uint16_t tid);
void DoAddConstructor (CallbackBase callback, uint32_t nArguments);
CallbackBase LookupConstructor (uint32_t nArguments) const;
- Ptr<const Accessor> GetParameterAccessor (uint32_t i) const;
+ Ptr<const AttributeAccessor> GetParameterAccessor (uint32_t i) const;
uint32_t GetParameterFlags (uint32_t i) const;
Ptr<const AttributeChecker> GetParameterChecker (uint32_t i) const;
@@ -470,7 +470,7 @@
friend Ptr<T> CreateObject (T1 a1, T2 a2, T3 a3, T4 a4, T5 a5, T6 a6, T7 a7);
- bool DoSet (Ptr<const Accessor> spec, Attribute intialValue,
+ bool DoSet (Ptr<const AttributeAccessor> spec, Attribute intialValue,
Ptr<const AttributeChecker> checker, Attribute value);
Ptr<Object> DoGetObject (TypeId tid) const;
void DoCollectSources (std::string path, const TraceContext &context,
--- a/src/core/param-spec-helper.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/param-spec-helper.h Wed Feb 20 20:57:59 2008 +0100
@@ -4,11 +4,11 @@
namespace ns3 {
template <typename BASE, typename V, typename T1>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1);
template <typename BASE, typename V, typename T1, typename T2>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1, T2 a2);
} // namespace ns3
@@ -62,7 +62,7 @@
};
template <typename BASE, typename V, typename T, typename U>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
DoMakeAccessorHelperOne (U T::*memberVariable)
{
class MemberVariable : public AccessorHelper<BASE,T,V>
@@ -84,11 +84,11 @@
U T::*m_memberVariable;
};
- return Ptr<Accessor> (new MemberVariable (memberVariable), false);
+ return Ptr<const AttributeAccessor> (new MemberVariable (memberVariable), false);
}
template <typename BASE, typename V, typename T, typename U>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
DoMakeAccessorHelperOne (U (T::*getter) (void) const)
{
class MemberMethod : public AccessorHelper<BASE,T,V>
@@ -108,12 +108,12 @@
}
U (T::*m_getter) (void) const;
};
- return Ptr<Accessor> (new MemberMethod (getter), false);
+ return Ptr<const AttributeAccessor> (new MemberMethod (getter), false);
}
template <typename BASE, typename V, typename T, typename U>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
DoMakeAccessorHelperOne (void (T::*setter) (U))
{
class MemberMethod : public AccessorHelper<BASE,T,V>
@@ -133,11 +133,11 @@
}
void (T::*m_setter) (U);
};
- return Ptr<Accessor> (new MemberMethod (setter), false);
+ return Ptr<const AttributeAccessor> (new MemberMethod (setter), false);
}
template <typename BASE, typename W, typename T, typename U, typename V>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (void (T::*setter) (U),
V (T::*getter) (void) const)
{
@@ -162,11 +162,11 @@
void (T::*m_setter) (U);
V (T::*m_getter) (void) const;
};
- return Ptr<Accessor> (new MemberMethod (setter, getter), false);
+ return Ptr<const AttributeAccessor> (new MemberMethod (setter, getter), false);
}
template <typename BASE, typename W, typename T, typename U, typename V>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
DoMakeAccessorHelperTwo (V (T::*getter) (void) const,
void (T::*setter) (U))
{
@@ -174,14 +174,14 @@
}
template <typename BASE, typename V, typename T1>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1)
{
return DoMakeAccessorHelperOne<BASE,V> (a1);
}
template <typename BASE, typename V, typename T1, typename T2>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeAccessorHelper (T1 a1, T2 a2)
{
return DoMakeAccessorHelperTwo<BASE,V> (a1, a2);
--- a/src/core/random-variable.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/random-variable.cc Wed Feb 20 20:57:59 2008 +0100
@@ -309,7 +309,7 @@
return ClassValueHelperConvertTo<RandomVariable,RandomVariableValue> (this);
}
-Ptr<AttributeChecker>
+Ptr<const AttributeChecker>
MakeRandomVariableChecker (void)
{
return MakeSimpleAttributeChecker<RandomVariableValue> ();
--- a/src/core/random-variable.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/random-variable.h Wed Feb 20 20:57:59 2008 +0100
@@ -666,14 +666,14 @@
class RandomVariableValue : public Value {};
-class RandomVariableAccessor : public Accessor {};
+class RandomVariableAccessor : public AttributeAccessor {};
template <typename T1>
-Ptr<Accessor> MakeRandomVariableAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeRandomVariableAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeRandomVariableAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeRandomVariableAccessor (T1 a1, T2 a2);
-Ptr<AttributeChecker> MakeRandomVariableChecker (void);
+Ptr<const AttributeChecker> MakeRandomVariableChecker (void);
}//namespace ns3
@@ -681,14 +681,14 @@
namespace ns3 {
template <typename T1>
-Ptr<Accessor> MakeRandomVariableAccessor (T1 a1)
+Ptr<const AttributeAccessor> MakeRandomVariableAccessor (T1 a1)
{
return MakeClassValueHelperAccessor<RandomVariable,
RandomVariableValue, RandomVariableAccessor> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeRandomVariableAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeRandomVariableAccessor (T1 a1, T2 a2)
{
return MakeClassValueHelperAccessor<RandomVariable,
RandomVariableValue,RandomVariableAccessor> (a1, a2);
--- a/src/core/uint-value.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/uint-value.cc Wed Feb 20 20:57:59 2008 +0100
@@ -60,7 +60,7 @@
}
-Ptr<AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max)
+Ptr<const AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max)
{
struct Checker : public AttributeChecker
{
@@ -78,7 +78,7 @@
uint64_t m_minValue;
uint64_t m_maxValue;
} *checker = new Checker (min, max);
- return Ptr<AttributeChecker> (checker, false);
+ return Ptr<const AttributeChecker> (checker, false);
}
--- a/src/core/uint-value.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/uint-value.h Wed Feb 20 20:57:59 2008 +0100
@@ -24,37 +24,37 @@
uint64_t m_value;
};
-class UintAccessor : public Accessor {};
+class UintAccessor : public AttributeAccessor {};
template <typename T1>
-Ptr<Accessor> MakeUintAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeUintAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1, T2 a2);
template <typename T>
-Ptr<AttributeChecker> MakeUintChecker (void);
+Ptr<const AttributeChecker> MakeUintChecker (void);
-Ptr<AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max);
+Ptr<const AttributeChecker> MakeUintChecker (uint64_t min, uint64_t max);
} // namespace ns3
namespace ns3 {
template <typename T1>
-Ptr<Accessor>
+Ptr<const AttributeAccessor>
MakeUintAccessor (T1 a1)
{
return MakeAccessorHelper<UintAccessor,UintValue> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeUintAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeUintAccessor (T1 a1, T2 a2)
{
return MakeAccessorHelper<UintAccessor,UintValue> (a1, a2);
}
template <typename T>
-Ptr<AttributeChecker> MakeUintChecker (void)
+Ptr<const AttributeChecker> MakeUintChecker (void)
{
return MakeUintChecker (std::numeric_limits<T>::min (),
std::numeric_limits<T>::max ());
--- a/src/core/value-helper.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/value-helper.h Wed Feb 20 20:57:59 2008 +0100
@@ -7,25 +7,25 @@
type (Attribute value); \
operator Attribute () const;
-#define VALUE_HELPER_HEADER_2(type) \
- class type##Value : public Value {}; \
- class type##Accessor : public Accessor {}; \
- Ptr<AttributeChecker> Make##type##Checker (void); \
- template <typename T1> \
- Ptr<Accessor> Make##type##Accessor (T1 a1) \
- { \
- return MakeClassValueHelperAccessor< type , \
- type##Value, type##Accessor> (a1); \
- } \
- template <typename T1, typename T2> \
- Ptr<Accessor> Make##type##Accessor (T1 a1, T2 a2) \
- { \
- return MakeClassValueHelperAccessor<type, \
- type##Value,type##Accessor> (a1, a2); \
+#define VALUE_HELPER_HEADER_2(type) \
+ class type##Value : public Value {}; \
+ 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); \
+ } \
+ template <typename T1, typename T2> \
+ Ptr<const AttributeAccessor> Make##type##Accessor (T1 a1, T2 a2) \
+ { \
+ return MakeClassValueHelperAccessor<type, \
+ type##Value,type##Accessor> (a1, a2); \
}
#define VALUE_HELPER_CPP(type) \
- Ptr<AttributeChecker> Make##type##Checker (void) \
+ Ptr<const AttributeChecker> Make##type##Checker (void) \
{ \
return MakeSimpleAttributeChecker<type> (); \
} \
--- a/src/core/value.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/value.cc Wed Feb 20 20:57:59 2008 +0100
@@ -121,16 +121,16 @@
{}
-Accessor::Accessor ()
+AttributeAccessor::AttributeAccessor ()
: m_count (1)
{}
void
-Accessor::Ref (void) const
+AttributeAccessor::Ref (void) const
{
m_count++;
}
void
-Accessor::Unref (void) const
+AttributeAccessor::Unref (void) const
{
m_count--;
if (m_count == 0)
@@ -138,7 +138,7 @@
delete this;
}
}
-Accessor::~Accessor ()
+AttributeAccessor::~AttributeAccessor ()
{}
AttributeChecker::AttributeChecker ()
--- a/src/core/value.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/core/value.h Wed Feb 20 20:57:59 2008 +0100
@@ -8,7 +8,7 @@
namespace ns3 {
-class Accessor;
+class AttributeAccessor;
class AttributeChecker;
class Attribute;
@@ -60,13 +60,13 @@
Value *m_value;
};
-class Accessor : public ObjectBase
+class AttributeAccessor : public ObjectBase
{
public:
- Accessor ();
+ AttributeAccessor ();
void Ref (void) const;
void Unref (void) const;
- virtual ~Accessor ();
+ virtual ~AttributeAccessor ();
/**
* \param object the object instance to set the value in
@@ -97,14 +97,14 @@
MakeSimpleAttributeChecker (void);
template <typename T, typename U>
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
MakePtrAccessor (Ptr<U> T::*memberVariable);
template <typename T, typename U>
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
MakePtrAccessor (void (T::*setter) (Ptr<U>));
template <typename T, typename U>
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
MakePtrAccessor (Ptr<U> (T::*getter) (void) const);
@@ -232,7 +232,7 @@
********************************************************/
template <typename T, typename U>
-class PtrAccessor : public Accessor
+class PtrAccessor : public AttributeAccessor
{
public:
virtual ~PtrAccessor () {}
@@ -275,7 +275,7 @@
template <typename T, typename U>
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
MakePtrAccessor (Ptr<U> T::*memberVariable)
{
struct MemberVariable : public PtrAccessor<T,U>
@@ -292,11 +292,11 @@
}
} *spec = new MemberVariable ();
spec->m_memberVariable = memberVariable;
- return Ptr<const Accessor> (spec, false);
+ return Ptr<const AttributeAccessor> (spec, false);
}
template <typename T, typename U>
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
MakePtrAccessor (void (T::*setter) (Ptr<U>))
{
struct MemberMethod : public PtrAccessor<T,U>
@@ -314,11 +314,11 @@
}
} *spec = new MemberMethod ();
spec->m_setter = setter;
- return Ptr<const Accessor> (spec, false);
+ return Ptr<const AttributeAccessor> (spec, false);
}
template <typename T, typename U>
-Ptr<const Accessor>
+Ptr<const AttributeAccessor>
MakePtrAccessor (Ptr<U> (T::*getter) (void) const)
{
struct MemberMethod : public PtrAccessor<T,U>
@@ -335,7 +335,7 @@
}
} *spec = new MemberMethod ();
spec->m_getter = getter;
- return Ptr<const Accessor> (spec, false);
+ return Ptr<const AttributeAccessor> (spec, false);
}
template <typename T>
--- a/src/simulator/nstime.h Wed Feb 20 20:24:52 2008 +0100
+++ b/src/simulator/nstime.h Wed Feb 20 20:57:59 2008 +0100
@@ -671,14 +671,14 @@
class TimeValue : public Value {};
-class TimeAccessor : public Accessor {};
+class TimeAccessor : public AttributeAccessor {};
template <typename T1>
-Ptr<Accessor> MakeTimeAccessor (T1 a1);
+Ptr<const AttributeAccessor> MakeTimeAccessor (T1 a1);
template <typename T1, typename T2>
-Ptr<Accessor> MakeTimeAccessor (T1 a1, T2 a2);
+Ptr<const AttributeAccessor> MakeTimeAccessor (T1 a1, T2 a2);
-Ptr<AttributeChecker> MakeTimeChecker (void);
+Ptr<const AttributeChecker> MakeTimeChecker (void);
@@ -687,13 +687,13 @@
namespace ns3 {
template <typename T1>
-Ptr<Accessor> MakeTimeAccessor (T1 a1)
+Ptr<const AttributeAccessor> MakeTimeAccessor (T1 a1)
{
return MakeClassValueHelperAccessor<Time,TimeValue,TimeAccessor> (a1);
}
template <typename T1, typename T2>
-Ptr<Accessor> MakeTimeAccessor (T1 a1, T2 a2)
+Ptr<const AttributeAccessor> MakeTimeAccessor (T1 a1, T2 a2)
{
return MakeClassValueHelperAccessor<Time,TimeValue,TimeAccessor> (a1, a2);
}
--- a/src/simulator/time.cc Wed Feb 20 20:24:52 2008 +0100
+++ b/src/simulator/time.cc Wed Feb 20 20:57:59 2008 +0100
@@ -305,7 +305,7 @@
return ClassValueHelperConvertTo<Time,TimeValue> (this);
}
-Ptr<AttributeChecker> MakeTimeChecker (void)
+Ptr<const AttributeChecker> MakeTimeChecker (void)
{
return MakeSimpleAttributeChecker<Time> ();
}