use new MobilityModel::Get and remove old one.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed, 04 Jul 2007 10:27:49 +0200
changeset 1583 470803bf9961
parent 1582 92a3e76ec1c5
child 1584 b612c5fe9e6b
use new MobilityModel::Get and remove old one.
samples/main-grid-topology.cc
samples/main-random-walk.cc
src/node/mobility-model.cc
src/node/mobility-model.h
--- a/samples/main-grid-topology.cc	Wed Jul 04 10:24:45 2007 +0200
+++ b/samples/main-grid-topology.cc	Wed Jul 04 10:27:49 2007 +0200
@@ -41,9 +41,8 @@
       Ptr<Object> object = *j;
       Ptr<MobilityModel> position = object->QueryInterface<MobilityModel> (MobilityModel::iid);
       NS_ASSERT (position != 0);
-      double x, y, z;
-      position->Get (x,y,z);
-      std::cout << "x=" << x << ", y=" << y << ", z=" << z << std::endl;
+      Position pos = position->Get ();
+      std::cout << "x=" << pos.x << ", y=" << pos.y << ", z=" << pos.z << std::endl;
     }
 
   return 0;
--- a/samples/main-random-walk.cc	Wed Jul 04 10:24:45 2007 +0200
+++ b/samples/main-random-walk.cc	Wed Jul 04 10:27:49 2007 +0200
@@ -14,9 +14,9 @@
 static void 
 CourseChange (Ptr<const MobilityModel> position)
 {
-  double x, y, z;
-  position->Get (x, y, z);
-  std::cout << Simulator::Now () << ", pos=" << position << ", x=" << x << ", y=" << y << ", z=" << z << std::endl;
+  Position pos = position->Get ();
+  std::cout << Simulator::Now () << ", pos=" << position << ", x=" << pos.x << ", y=" << pos.y
+            << ", z=" << pos.z << std::endl;
 }
 
 int main (int argc, char *argv[])
--- a/src/node/mobility-model.cc	Wed Jul 04 10:24:45 2007 +0200
+++ b/src/node/mobility-model.cc	Wed Jul 04 10:27:49 2007 +0200
@@ -34,11 +34,6 @@
 MobilityModel::~MobilityModel ()
 {}
 
-void
-MobilityModel::Get (double &x, double &y, double &z) const
-{
-  DoGet (x,y,z);
-}
 Position
 MobilityModel::Get (void) const
 {
--- a/src/node/mobility-model.h	Wed Jul 04 10:24:45 2007 +0200
+++ b/src/node/mobility-model.h	Wed Jul 04 10:27:49 2007 +0200
@@ -62,15 +62,9 @@
   virtual ~MobilityModel () = 0;
 
   /**
-   * \param x reference to floating-point variable for x coordinate.
-   * \param y reference to floating-point variable for y coordinate.
-   * \param z reference to floating-point variable for z coordinate.
-   *
-   * Store in the x, y, and z variables the current coordinates
-   * managed by this position object.
+   * \returns the current position
    * Unit is meters
    */
-  void Get (double &x, double &y, double &z) const;
   Position Get (void) const;
   /**
    * \returns the current x coordinate