]> git.mxchange.org Git - flightgear.git/blob - src/Navaids/fix.hxx
Attached patches remove BORLANDC, and hence SG_MATH_EXCEPTION_CLASH and SG_INCOM
[flightgear.git] / src / Navaids / fix.hxx
1 // fix.hxx -- fix class
2 //
3 // Written by Curtis Olson, started April 2000.
4 //
5 // Copyright (C) 2000  Curtis L. Olson - http://www.flightgear.org/~curt
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 //
21 // $Id$
22
23
24 #ifndef _FG_FIX_HXX
25 #define _FG_FIX_HXX
26
27
28 #ifdef HAVE_CONFIG_H
29 #  include <config.h>
30 #endif
31
32 #include <simgear/compiler.h>
33 #include <simgear/misc/sgstream.hxx>
34
35 #  include <istream>
36
37 #include STL_STRING
38
39 // SG_USING_STD(cout);
40 // SG_USING_STD(endl);
41
42
43 class FGFix {
44
45     std::string ident;
46     double lon, lat;
47
48 public:
49
50     inline FGFix(void);
51     inline ~FGFix(void) {}
52
53     inline const std::string& get_ident() const { return ident; }
54     inline double get_lon() const { return lon; }
55     inline double get_lat() const { return lat; }
56
57     friend std::istream& operator>> ( std::istream&, FGFix& );
58 };
59
60
61 inline
62 FGFix::FGFix()
63   : ident(""),
64     lon(0.0),
65     lat(0.0)
66 {
67 }
68
69
70 inline std::istream&
71 operator >> ( std::istream& in, FGFix& f )
72 {
73     in >> f.lat;
74
75     if ( f.lat > 95.0 ) {
76         return in >> skipeol;
77     }
78     in >> f.lon >> f.ident;
79
80     // cout << "id = " << f.ident << endl;
81
82     return in >> skipeol;
83 }
84
85
86 #endif // _FG_FIX_HXX