Use StringValue instead of PointerValue (CreateObject... in AddAttribute calls

This commit is contained in:
Peter D. Barnes, Jr.
2014-10-06 17:22:59 -07:00
parent 6313928fbc
commit b2dc58dcb9
4 changed files with 13 additions and 9 deletions

View File

@@ -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<DropTailQueue> ()),
StringValue ("ns3::DropTailQueue"),
MakePointerAccessor (&SimpleNetDevice::m_queue),
MakePointerChecker<Queue> ())
.AddAttribute ("DataRate",

View File

@@ -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<UanChannel> ()
.AddAttribute ("PropagationModel",
"A pointer to the propagation model.",
PointerValue (CreateObject<UanPropModelIdeal> ()),
StringValue ("ns3::UanPropModelIdeal"),
MakePointerAccessor (&UanChannel::m_prop),
MakePointerChecker<UanPropModel> ())
.AddAttribute ("NoiseModel",
"A pointer to the model of the channel ambient noise.",
PointerValue (CreateObject<UanNoiseModelDefault> ()),
StringValue ("ns3::UanNoiseModelDefault"),
MakePointerAccessor (&UanChannel::m_noise),
MakePointerChecker<UanNoiseModel> ())
;

View File

@@ -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<UanPhyPerGenDefault> ()),
StringValue ("ns3::UanPhyPerGenDefault"),
MakePointerAccessor (&UanPhyDual::GetPerModelPhy1, &UanPhyDual::SetPerModelPhy1),
MakePointerChecker<UanPhyPer> ())
.AddAttribute ("PerModelPhy2",
"Functor to calculate PER based on SINR and TxMode for Phy2.",
PointerValue (CreateObject<UanPhyPerGenDefault> ()),
StringValue ("ns3::UanPhyPerGenDefault"),
MakePointerAccessor (&UanPhyDual::GetPerModelPhy2, &UanPhyDual::SetPerModelPhy2),
MakePointerChecker<UanPhyPer> ())
.AddAttribute ("SinrModelPhy1",
"Functor to calculate SINR based on pkt arrivals and modes for Phy1.",
PointerValue (CreateObject<UanPhyCalcSinrDual> ()),
StringValue ("ns3::UanPhyCalcSinrDual"),
MakePointerAccessor (&UanPhyDual::GetSinrModelPhy1, &UanPhyDual::SetSinrModelPhy1),
MakePointerChecker<UanPhyCalcSinr> ())
.AddAttribute ("SinrModelPhy2",
"Functor to calculate SINR based on pkt arrivals and modes for Phy2.",
PointerValue (CreateObject<UanPhyCalcSinrDual> ()),
StringValue ("ns3::UanPhyCalcSinrDual"),
MakePointerAccessor (&UanPhyDual::GetSinrModelPhy2, &UanPhyDual::SetSinrModelPhy2),
MakePointerChecker<UanPhyCalcSinr> ())
.AddTraceSource ("RxOk",

View File

@@ -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<UanPhyPerGenDefault> ()),
StringValue ("ns3::UanPhyPerGenDefault"),
MakePointerAccessor (&UanPhyGen::m_per),
MakePointerChecker<UanPhyPer> ())
.AddAttribute ("SinrModel",
"Functor to calculate SINR based on pkt arrivals and modes.",
PointerValue (CreateObject<UanPhyCalcSinrDefault> ()),
StringValue ("ns3::UanPhyCalcSinrDefault"),
MakePointerAccessor (&UanPhyGen::m_sinr),
MakePointerChecker<UanPhyCalcSinr> ())
.AddTraceSource ("RxOk",