Bug 1048 - suggested MatrixPropagationLossModel::SetLoss() API change
suggested MatrixPropagationLossModel::SetLoss() API change
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: propagation
pre-release
All All
: P5 normal
Assigned To: Pavel Boyko
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-28 17:57 EST by Tom Henderson
Modified: 2011-02-06 04:45 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2011-01-28 17:57:56 EST
Pavel,
I would like to suggest the below API change for your consideration.  

In the course of removing dependency of mobility module to the node module, Mitch changed the type of these parameters from Node to Object.  However, if one looks at what is implemented, there is immediately a call to GetObject<Mobility Model>() on these object pointers.  So it seems like it may be cleaner (but breaking API) to just pass in the mobility model pointers.

I would be OK with leaving it as is if people don't want to break this API, but wanted to suggest it for consideration in case others may prefer the change.

diff -r 7dfe87d4b790 src/propagation/model/propagation-loss-model.h
--- a/src/propagation/model/propagation-loss-model.h	Fri Jan 28 14:11:42 2011 -0800
+++ b/src/propagation/model/propagation-loss-model.h	Fri Jan 28 14:23:33 2011 -0800
@@ -495,14 +495,14 @@
   
   /**
    * \brief Set loss (in dB, positive) between pair of ns-3 objects
-   * (typically, nodes).
+   * whose position is stored in a mobility model
    * 
-   * \param a           Source object
-   * \param b           Destination object
+   * \param ma          Source mobility model
+   * \param mb          Destination mobility model
    * \param loss        a -> b path loss, positive in dB
    * \param symmetric   If true (default), both a->b and b->a paths will be affected
    */ 
-  void SetLoss (Ptr<Object> a, Ptr<Object> b, double loss, bool symmetric = true);
+  void SetLoss (Ptr<MobilityModel> ma, Ptr<MobilityModel> mb, double loss, bool symmetric = true);
   /// Set default loss (in dB, positive) to be used, infinity if not set
   void SetDefaultLoss (double);
Comment 1 Pavel Boyko 2011-02-06 04:45:07 EST
fixed in [f07c4f00b07e]