]> git.mxchange.org Git - simgear.git/blob - simgear/metar/MetarStation.h
MSVC++ fixes.
[simgear.git] / simgear / metar / MetarStation.h
1 // Class encapulating the metar station information
2 //
3 // METAR station information is kept in this file:
4 //   http://www.nws.noaa.gov/pub/stninfo/nsd_cccc.gz
5 //   http://www.nws.noaa.gov/pub/stninfo/nsd_cccc.txt
6 // This class looks for the file FG_ROOT/Weather/MetarStations instread of nsd_cccc.
7
8 #ifndef _MetarStation_
9 #define _MetarStation_
10
11 #include <iostream>
12 #include <string>
13 #include <vector>
14 #include <simgear/math/point3d.hxx>
15 #include <simgear/math/polar3d.hxx>
16 //using namespace std;
17
18 class CMetarStation
19 {
20         // Attributes
21 private:
22         std::string m_ID;
23         unsigned long m_number;
24         std::string m_name;
25         std::string m_state;
26         std::string m_country;
27         int m_region;
28         Point3D m_locationPolar;
29         Point3D m_upperLocationPolar;
30         Point3D m_locationCart;
31         Point3D m_upperLocationCart;
32         int m_altitude;
33         int m_upperAltitude;
34         char m_pFlag;
35
36         static int initialized;
37         static std::string tempName;
38
39         // Operations
40 private:
41         double decodeDMS( char *b );
42         static int sameName( CMetarStation *m );
43
44         CMetarStation( 
45                 char *s );
46                         // Constructor
47
48         ~CMetarStation()
49         {
50         }
51                         // Destructor
52
53 public:
54         std::string &ID() { return m_ID; }
55         unsigned long number() { return m_number; }
56         std::string &name() { return m_name; }
57         std::string &state() { return m_state; }
58         std::string &country() { return m_country; }
59         int region() { return m_region; }
60         Point3D &locationPolar() { return m_locationPolar; }
61         Point3D &upperLocationPolar() { return m_upperLocationPolar; }
62         Point3D &locationCart() { return m_locationCart; }
63         Point3D &upperLocationCart() { return m_upperLocationCart; }
64         char pFlag() { return m_pFlag; }
65                         // Get attributes
66
67     friend std::ostream& operator << ( std::ostream&, const CMetarStation& );
68         void dump();
69         
70         static CMetarStation *find( std::string stationID );
71         static CMetarStation *find( Point3D locationCart );
72         static void for_each( void f( CMetarStation *s ) );
73
74 private:
75         CMetarStation(
76                 const CMetarStation &rNewObj );
77                         // Copy constructor.  Not implemented.
78
79         CMetarStation &operator =(
80                 const CMetarStation &rObj );
81                         // Assignment operator.  Not implemented.
82
83         static int initialize();
84 };
85
86
87 #endif