improved logging and helper class
authorGiuseppe Piro <g.piro@poliba.it>
Thu, 12 Aug 2010 15:58:57 +0200
changeset 6647 5d348b268eac
parent 6646 7a6ff1469eee
child 6648 0c690dc9a1e5
improved logging and helper class
src/devices/lte/amc-module.cc
src/devices/lte/channel-realization.cc
src/devices/lte/enb-lte-spectrum-phy.cc
src/devices/lte/enb-mac-entity.cc
src/devices/lte/enb-phy.cc
src/devices/lte/loss-model.cc
src/devices/lte/lte-mac-queue.cc
src/devices/lte/lte-net-device.cc
src/devices/lte/lte-phy.cc
src/devices/lte/lte-spectrum-error-model.cc
src/devices/lte/mac-entity.cc
src/devices/lte/path-loss-model.cc
src/devices/lte/rlc-entity.cc
src/devices/lte/simple-packet-scheduler.cc
src/devices/lte/ue-manager.cc
src/devices/lte/ue-net-device.cc
src/devices/lte/ue-record.cc
src/helper/lte-helper.h
--- a/src/devices/lte/amc-module.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/amc-module.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -114,7 +114,7 @@
 int
 AmcModule::GetCqiFromFromSpectralEfficiency (double s)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << s);
   int cqi = 1; // == CQIIndex[0]
   while (SpectralEfficiencyForCQIIndex[cqi] < s && cqi <= 14)
     {
@@ -128,7 +128,7 @@
 int
 AmcModule::GetMCSFromCQI (int cqi)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << cqi);
   double spectralEfficiency = SpectralEfficiencyForCQIIndex[cqi - 1];
   int mcs = 1;
   while (SpectralEfficiencyForMCSIndex[mcs] < spectralEfficiency && mcs < 30)
@@ -143,7 +143,7 @@
 int
 AmcModule::GetTBSizeFromMCS (int mcs)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << mcs);
   NS_LOG_FUNCTION (this << mcs << TransportBlockSize[mcs]);
   return TransportBlockSize[mcs];
 }
@@ -152,7 +152,7 @@
 double
 AmcModule::GetSpectralEfficiencyFromCQI (int cqi)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << cqi);
   NS_LOG_FUNCTION (this << cqi << SpectralEfficiencyForCQIIndex[cqi - 1]);
   return SpectralEfficiencyForCQIIndex[cqi - 1];
 }
--- a/src/devices/lte/channel-realization.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/channel-realization.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -67,7 +67,7 @@
 void
 ChannelRealization::SetPathLossModel (Ptr<PathLossModel> l)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << l);
   m_pathloss = l;
 }
 
@@ -75,7 +75,7 @@
 void
 ChannelRealization::SetShadowingLossModel (Ptr<ShadowingLossModel> l)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << l);
   m_shadowing = l;
 }
 
@@ -83,7 +83,7 @@
 void
 ChannelRealization::SetPenetrationLossModel (Ptr<PenetrationLossModel> l)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << l);
   m_penetration = l;
 }
 
--- a/src/devices/lte/enb-lte-spectrum-phy.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/enb-lte-spectrum-phy.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -73,7 +73,7 @@
 void
 EnbLteSpectrumPhy::CalcSinrValues (Ptr <const SpectrumValue> rxPsd,Ptr <const SpectrumValue> noise)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << rxPsd << noise);
   /*
    * TO DO:
    * Compute the SINR of the incoming signal, using the rxPsd and the Noise Psd.
--- a/src/devices/lte/enb-mac-entity.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/enb-mac-entity.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -66,7 +66,7 @@
 void
 EnbMacEntity::SetUplinkPacketScheduler (Ptr<PacketScheduler> s)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << s);
   m_uplinkScheduler = s;
 }
 
@@ -74,7 +74,7 @@
 void
 EnbMacEntity::SetDownlinkPacketScheduler (Ptr<PacketScheduler> s)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << s);
   m_downlinkScheduler = s;
 }
 
--- a/src/devices/lte/enb-phy.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/enb-phy.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -117,14 +117,14 @@
 void
 EnbLtePhy::SendIdealControlMessage (Ptr<IdealControlMessage> msg)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << msg);
 }
 
 
 void
 EnbLtePhy::ReceiveIdealControlMessage (Ptr<IdealControlMessage> msg)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << msg);
   if (msg->GetMessageType () == IdealControlMessage::CQI_FEEDBACKS)
     {
       Ptr<CqiIdealControlMessage> msg2 = msg->GetObject<CqiIdealControlMessage> ();
--- a/src/devices/lte/loss-model.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/loss-model.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -70,7 +70,7 @@
 void
 LossModel::SetSamplingPeriod (double sp)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << sp);
   m_samplingPeriod = sp;
 }
 
--- a/src/devices/lte/lte-mac-queue.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/lte-mac-queue.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -164,7 +164,7 @@
 Ptr<Packet>
 LteMacQueue::Dequeue (uint32_t availableByte)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << availableByte);
   /*
    This functiopn can be called when the UM of AM RLC mode are abilited.
    */
--- a/src/devices/lte/lte-net-device.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/lte-net-device.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -118,7 +118,7 @@
 void
 LteNetDevice::SetPhy (Ptr<LtePhy> phy)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << phy);
   m_phy = phy;
 }
 
@@ -134,7 +134,7 @@
 void
 LteNetDevice::SetIpClassifier (Ptr<IpClassifier> ipc)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ipc);
   m_ipClassifier = ipc;
 }
 
@@ -150,7 +150,7 @@
 void
 LteNetDevice::SetRrcEntity (Ptr<RrcEntity> rrc)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << rrc);
   m_rrcEntity = rrc;
 }
 
@@ -166,7 +166,7 @@
 void
 LteNetDevice::SetRlcEntity (Ptr<RlcEntity> rlc)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << rlc);
   m_rlcEntity = rlc;
 }
 
@@ -182,7 +182,7 @@
 void
 LteNetDevice::SetAddress (Address address)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << address);
   m_address = Mac48Address::ConvertFrom (address);
 }
 
@@ -198,7 +198,7 @@
 void
 LteNetDevice::SetNode (Ptr<Node> node)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << node);
   m_node = node;
 }
 
@@ -229,7 +229,7 @@
 void
 LteNetDevice::ForwardUp (Ptr<Packet> packet)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << packet);
 
   m_macRxTrace (packet);
 
@@ -295,7 +295,7 @@
 void
 LteNetDevice::Receive (Ptr<Packet> p)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << p);
   Ptr<Packet> packet = p->Copy ();
   DoReceive (packet);
 }
@@ -305,7 +305,7 @@
 bool
 LteNetDevice::SetMtu (const uint16_t mtu)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << mtu);
   if (mtu > MAX_MSDU_SIZE)
     {
       return false;
@@ -325,7 +325,7 @@
 void
 LteNetDevice::SetIfIndex (const uint32_t index)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << index);
   m_ifIndex = index;
 }
 
@@ -411,7 +411,7 @@
 Address
 LteNetDevice::GetMulticast (Ipv6Address addr) const
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << addr);
   Mac48Address ad = Mac48Address::GetMulticast (addr);
 
   NS_LOG_LOGIC ("MAC IPv6 multicast address is " << ad);
--- a/src/devices/lte/lte-phy.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/lte-phy.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -64,7 +64,7 @@
 void
 LtePhy::SetDevice (Ptr<LteNetDevice> d)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << d);
   m_netDevice = d;
 }
 
@@ -80,7 +80,7 @@
 void
 LtePhy::SetDownlinkSpectrumPhy (Ptr<LteSpectrumPhy> s)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << s);
   m_downlinkSpectrumPhy = s;
 }
 
@@ -88,7 +88,7 @@
 void
 LtePhy::SetUplinkSpectrumPhy (Ptr<LteSpectrumPhy> s)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << s);
   m_uplinkSpectrumPhy = s;
 }
 
@@ -112,7 +112,7 @@
 void
 LtePhy::SetDownlinkChannel (Ptr<SpectrumChannel> c)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << c);
   m_downlinkSpectrumPhy->SetChannel (c);
 }
 
@@ -128,7 +128,7 @@
 void
 LtePhy::SetUplinkChannel (Ptr<SpectrumChannel> c)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << c);
   m_uplinkSpectrumPhy->SetChannel (c);
 }
 
@@ -232,7 +232,7 @@
 void
 LtePhy::SetNrFrames (uint32_t nrFrames)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << nrFrames);
   m_nrFrames = nrFrames;
 }
 
@@ -248,7 +248,7 @@
 void
 LtePhy::SetNrSubFrames (uint32_t nrSubFrames)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << nrSubFrames);
   m_nrSubFrames = nrSubFrames;
 }
 
--- a/src/devices/lte/lte-spectrum-error-model.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/lte-spectrum-error-model.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -49,7 +49,7 @@
 // LteSpectrumErrorModel::StartRx (Ptr<const PacketBurst> p)
 LteSpectrumErrorModel::StartRx (Ptr<const Packet> p)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << p);
 }
 
 
--- a/src/devices/lte/mac-entity.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/mac-entity.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -58,7 +58,7 @@
 void
 MacEntity::SetDevice (Ptr<LteNetDevice> d)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << d);
   m_device = d;
 }
 
@@ -73,7 +73,7 @@
 void
 MacEntity::SetAmcModule (Ptr<AmcModule> amc)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << amc);
   m_amcModule = amc;
 }
 
--- a/src/devices/lte/path-loss-model.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/path-loss-model.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -61,7 +61,7 @@
 void
 PathLossModel::SetValue (double pl)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << pl);
   m_pl = pl;
 }
 
@@ -69,7 +69,7 @@
 double
 PathLossModel::GetValue (Ptr<const MobilityModel> a, Ptr<const MobilityModel> b)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << a << b);
   /*
    * According to  ---  insert standard 3gpp ---
    * the Path Loss Model For Urban Environment is
--- a/src/devices/lte/rlc-entity.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/rlc-entity.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -53,7 +53,7 @@
 RlcEntity::RlcEntity (Ptr<LteNetDevice> d)
   : m_device (d)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << d);
 }
 
 
@@ -66,7 +66,7 @@
 void
 RlcEntity::SetDevice (Ptr<LteNetDevice> d)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << d);
   m_device = d;
 }
 
--- a/src/devices/lte/simple-packet-scheduler.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/simple-packet-scheduler.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -50,7 +50,7 @@
 
 SimplePacketScheduler::SimplePacketScheduler (Ptr<EnbNetDevice> enb)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << enb);
   SetDevice (enb);
 }
 
--- a/src/devices/lte/ue-manager.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/ue-manager.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -45,7 +45,7 @@
 void
 UeManager::CreateUeRecord (Ptr<UeNetDevice> ue, Ptr<EnbNetDevice> enb)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ue << enb);
   UeRecord *ueRecord = new UeRecord (ue, enb);
   m_ueRecords->push_back (ueRecord);
 }
@@ -54,7 +54,7 @@
 Ptr<UeRecord>
 UeManager::GetUeRecord (Ptr<UeNetDevice> ue)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ue);
   for (std::vector<Ptr<UeRecord> >::iterator iter = m_ueRecords->begin (); iter != m_ueRecords->end (); ++iter)
     {
 
@@ -93,7 +93,7 @@
 bool
 UeManager::IsRegistered (Ptr<UeNetDevice> ue) const
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ue);
   for (std::vector<Ptr<UeRecord> >::iterator iter = m_ueRecords->begin (); iter != m_ueRecords->end (); ++iter)
     {
       if ((*iter)->GetUe ()->GetAddress () == ue->GetAddress ())
@@ -125,7 +125,7 @@
 void
 UeManager::DeleteUeRecord (Ptr<UeNetDevice> ue)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ue);
   for (std::vector<Ptr<UeRecord> >::iterator iter = m_ueRecords->begin (); iter != m_ueRecords->end (); ++iter)
     {
       if ((*iter)->GetUe ()->GetAddress () == ue->GetAddress ())
--- a/src/devices/lte/ue-net-device.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/ue-net-device.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -79,7 +79,7 @@
 
 UeNetDevice::UeNetDevice (Ptr<Node> node, Ptr<LtePhy> phy, Ptr<EnbNetDevice> targetEnb)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << node << phy << targetEnb);
   InitUeNetDevice ();
   SetNode (node);
   SetPhy (phy);
@@ -147,7 +147,7 @@
 void
 UeNetDevice::SetTargetEnb (Ptr<EnbNetDevice> enb)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << enb);
   m_targetEnb = enb;
 }
 
@@ -185,7 +185,7 @@
 void
 UeNetDevice::DoReceive (Ptr<Packet> p)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << p);
 
   Ptr<Packet> packet = p->Copy ();
 
--- a/src/devices/lte/ue-record.cc	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/devices/lte/ue-record.cc	Thu Aug 12 15:58:57 2010 +0200
@@ -39,14 +39,14 @@
   :  m_ue (ue),
     m_enb (enb)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ue << enb);
 }
 
 
 void
 UeRecord::SetUe (Ptr<NetDevice> ue)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << ue);
   m_ue = ue;
 }
 
@@ -62,7 +62,7 @@
 void
 UeRecord::SetEnb (Ptr<NetDevice> enb)
 {
-  NS_LOG_FUNCTION (this);
+  NS_LOG_FUNCTION (this << enb);
   m_enb = enb;
 }
 
--- a/src/helper/lte-helper.h	Wed Aug 11 19:35:21 2010 +0200
+++ b/src/helper/lte-helper.h	Thu Aug 12 15:58:57 2010 +0200
@@ -29,9 +29,7 @@
 #include "ns3/lte-net-device.h"
 #include "ns3/enb-net-device.h"
 #include "ns3/ue-net-device.h"
-#include "ns3/deprecated.h"
 #include "ns3/packet-scheduler.h"
-//#include "ns3/lte-spectrum-channel.h"
 #include "ns3/single-model-spectrum-channel.h"
 #include "ns3/lte-phy.h"
 #include "ns3/ue-phy.h"
@@ -94,7 +92,11 @@
    */
   Ptr<EnbLtePhy> CreateEnbPhy (void);
 
-  
+   /**
+   * \brief Add mobility model to a physical device
+   * \param phy the physical device
+   * \param m the mobility model 
+   */ 
   void AddMobility (Ptr<LtePhy> phy, Ptr<MobilityModel>m);
 
 
@@ -117,12 +119,28 @@
    */
   void EnableLogComponents (void);
 
- 
+   /**
+   * \brief Add a downlink channel realization 
+   * \param enbMobility, the enb mobility model
+   * \param ueMobility the ue mobility model
+   * \param phy the physical layer of the UE 
+   */
   void AddDownlinkChannelRealization (Ptr<MobilityModel> enbMobility, 
                                       Ptr<MobilityModel> ueMobility,
                                       Ptr<LtePhy> phy);
    
+  /**
+   * \brief Get the DL channel
+   * \return the pointer to the DL channel
+   */
+  Ptr<SingleModelSpectrumChannel> GetDownlinkChannel ();
+  /**
+   * \brief Get the UL channel
+   * \return the pointer to the UL channel
+   */
+  Ptr<SingleModelSpectrumChannel> GetUplinkChannel ();
 
+private:
   Ptr<SingleModelSpectrumChannel> m_downlinkChannel;
   Ptr<SingleModelSpectrumChannel> m_uplinkChannel;
 };