From b2dc58dcb9fca096e92fbe5dbf8dd1095b369666 Mon Sep 17 00:00:00 2001 From: "Peter D. Barnes, Jr." Date: Mon, 6 Oct 2014 17:22:59 -0700 Subject: [PATCH] Use StringValue instead of PointerValue (CreateObject... in AddAttribute calls --- src/network/utils/simple-net-device.cc | 3 ++- src/uan/model/uan-channel.cc | 5 +++-- src/uan/model/uan-phy-dual.cc | 9 +++++---- src/uan/model/uan-phy-gen.cc | 5 +++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/network/utils/simple-net-device.cc b/src/network/utils/simple-net-device.cc index fe54b8472..e477a6f96 100644 --- a/src/network/utils/simple-net-device.cc +++ b/src/network/utils/simple-net-device.cc @@ -26,6 +26,7 @@ #include "ns3/error-model.h" #include "ns3/trace-source-accessor.h" #include "ns3/boolean.h" +#include "ns3/string.h" #include "ns3/tag.h" #include "ns3/simulator.h" #include "ns3/drop-tail-queue.h" @@ -171,7 +172,7 @@ SimpleNetDevice::GetTypeId (void) MakeBooleanChecker ()) .AddAttribute ("TxQueue", "A queue to use as the transmit queue in the device.", - PointerValue (CreateObject ()), + StringValue ("ns3::DropTailQueue"), MakePointerAccessor (&SimpleNetDevice::m_queue), MakePointerChecker ()) .AddAttribute ("DataRate", diff --git a/src/uan/model/uan-channel.cc b/src/uan/model/uan-channel.cc index 85bcdcc5e..f02fcffc8 100644 --- a/src/uan/model/uan-channel.cc +++ b/src/uan/model/uan-channel.cc @@ -26,6 +26,7 @@ #include "ns3/node.h" #include "ns3/log.h" #include "ns3/pointer.h" +#include "ns3/string.h" #include "ns3/log.h" #include "uan-channel.h" @@ -51,12 +52,12 @@ UanChannel::GetTypeId () .AddConstructor () .AddAttribute ("PropagationModel", "A pointer to the propagation model.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPropModelIdeal"), MakePointerAccessor (&UanChannel::m_prop), MakePointerChecker ()) .AddAttribute ("NoiseModel", "A pointer to the model of the channel ambient noise.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanNoiseModelDefault"), MakePointerAccessor (&UanChannel::m_noise), MakePointerChecker ()) ; diff --git a/src/uan/model/uan-phy-dual.cc b/src/uan/model/uan-phy-dual.cc index f108dbf99..cc19d43a7 100644 --- a/src/uan/model/uan-phy-dual.cc +++ b/src/uan/model/uan-phy-dual.cc @@ -26,6 +26,7 @@ #include "uan-net-device.h" #include "uan-channel.h" #include "ns3/double.h" +#include "ns3/string.h" #include "ns3/log.h" #include "ns3/ptr.h" #include "ns3/traced-callback.h" @@ -201,22 +202,22 @@ UanPhyDual::GetTypeId (void) MakeUanModesListChecker () ) .AddAttribute ("PerModelPhy1", "Functor to calculate PER based on SINR and TxMode for Phy1.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPhyPerGenDefault"), MakePointerAccessor (&UanPhyDual::GetPerModelPhy1, &UanPhyDual::SetPerModelPhy1), MakePointerChecker ()) .AddAttribute ("PerModelPhy2", "Functor to calculate PER based on SINR and TxMode for Phy2.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPhyPerGenDefault"), MakePointerAccessor (&UanPhyDual::GetPerModelPhy2, &UanPhyDual::SetPerModelPhy2), MakePointerChecker ()) .AddAttribute ("SinrModelPhy1", "Functor to calculate SINR based on pkt arrivals and modes for Phy1.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPhyCalcSinrDual"), MakePointerAccessor (&UanPhyDual::GetSinrModelPhy1, &UanPhyDual::SetSinrModelPhy1), MakePointerChecker ()) .AddAttribute ("SinrModelPhy2", "Functor to calculate SINR based on pkt arrivals and modes for Phy2.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPhyCalcSinrDual"), MakePointerAccessor (&UanPhyDual::GetSinrModelPhy2, &UanPhyDual::SetSinrModelPhy2), MakePointerChecker ()) .AddTraceSource ("RxOk", diff --git a/src/uan/model/uan-phy-gen.cc b/src/uan/model/uan-phy-gen.cc index 86d925e63..4b964c855 100644 --- a/src/uan/model/uan-phy-gen.cc +++ b/src/uan/model/uan-phy-gen.cc @@ -28,6 +28,7 @@ #include "ns3/ptr.h" #include "ns3/trace-source-accessor.h" #include "ns3/double.h" +#include "ns3/string.h" #include "ns3/log.h" #include "ns3/uan-tx-mode.h" #include "ns3/node.h" @@ -458,12 +459,12 @@ UanPhyGen::GetTypeId (void) MakeUanModesListChecker () ) .AddAttribute ("PerModel", "Functor to calculate PER based on SINR and TxMode.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPhyPerGenDefault"), MakePointerAccessor (&UanPhyGen::m_per), MakePointerChecker ()) .AddAttribute ("SinrModel", "Functor to calculate SINR based on pkt arrivals and modes.", - PointerValue (CreateObject ()), + StringValue ("ns3::UanPhyCalcSinrDefault"), MakePointerAccessor (&UanPhyGen::m_sinr), MakePointerChecker ()) .AddTraceSource ("RxOk",