use new MobilityModel::Get and remove old one.
--- 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