]> git.mxchange.org Git - simgear.git/blobdiff - simgear/route/waypoint.hxx
Don't waste space with too huge stl containers.
[simgear.git] / simgear / route / waypoint.hxx
index f9835977c9b15d20a6c4cd0122708f31beee4473..206dcb3b8f0bb2d9688bcd355ae52e0aec3fd2c1 100644 (file)
@@ -19,7 +19,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
 #define _WAYPOINT_HXX
 
 
-#ifndef __cplusplus                                                          
+#ifndef __cplusplus
 # error This library requires C++
-#endif                                   
+#endif
 
 
 #include <simgear/compiler.h>
 
-#include STL_STRING
+#include <string>
 
-SG_USING_STD(string);
+using std::string;
 
 
 /**
@@ -76,6 +76,7 @@ private:
     double distance;
 
     string id;
+    string name;
 
 public:
 
@@ -86,10 +87,11 @@ public:
      * @param alt target altitude
      * @param mode type of coordinates/math to use
      * @param s waypoint identifier
+     * @param n waypoint name
      */
     SGWayPoint( const double lon = 0.0, const double lat = 0.0,
                const double alt = 0.0, const modetype m = WGS84,
-               const string s = "" );
+               const string& s = "", const string& n = "" );
 
     /** Destructor */
     ~SGWayPoint();
@@ -104,21 +106,21 @@ public:
      * @param cur_lat (in) current latitude
      * @param cur_alt (in) current altitude
      * @param course (out) heading from current location to this waypoint
-     * @param distance (out) distance from current location to this waypoint
+     * @param dist (out) distance from current location to this waypoint
      */
     void CourseAndDistance( const double cur_lon, const double cur_lat,
                            const double cur_alt,
-                           double *course, double *distance ) const;
+                           double *course, double *dist ) const;
 
     /**
      * Calculate course and distances between a specified starting waypoint
      * and this waypoint.
      * @param wp (in) original waypoint
      * @param course (out) heading from current location to this waypoint
-     * @param distance (out) distance from current location to this waypoint
+     * @param dist (out) distance from current location to this waypoint
      */
     void CourseAndDistance( const SGWayPoint &wp,
-                           double *course, double *distance ) const;
+                           double *course, double *dist ) const;
 
     /** @return waypoint mode */
     inline modetype get_mode() const { return mode; }
@@ -151,7 +153,10 @@ public:
     inline void set_distance( double d ) { distance = d; }
 
     /** @return waypoint id */
-    inline string get_id() const { return id; }
+    inline const string& get_id() const { return id; }
+
+    /** @return waypoint name */
+    inline const string& get_name() const { return name; }
 
 };