]> git.mxchange.org Git - flightgear.git/blob - src/Airports/parking.hxx
apt.dat parser: clearer log and exception messages
[flightgear.git] / src / Airports / parking.hxx
1 // parking.hxx - A class to handle airport startup locations in
2 // FlightGear. This code is intended to be used by AI code and
3 // initial user-startup location selection.
4 //
5 // Written by Durk Talsma, started December 2004.
6 //
7 // Copyright (C) 2004 Durk Talsma.
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 //
23 // $Id$
24
25 #ifndef _PARKING_HXX_
26 #define _PARKING_HXX_
27
28 #ifndef __cplusplus
29 # error This library requires C++
30 #endif
31
32 #include <simgear/compiler.h>
33 #include <simgear/sg_inlines.h>
34
35 #include <string>
36 #include <memory> // for std::auto_ptr
37
38 #include "gnnode.hxx"
39 #include <Airports/airports_fwd.hxx>
40
41 class FGParking : public FGTaxiNode
42 {
43 private:
44   const double heading;
45   const double radius;
46   const std::string parkingName;
47   const std::string type;
48   const std::string airlineCodes;
49   FGTaxiNodeRef pushBackPoint;
50
51   SG_DISABLE_COPY(FGParking);
52 public:
53   FGParking(int index,
54             const SGGeod& pos,
55             double heading, double radius,
56             const std::string& name, const std::string& type,
57             const std::string& codes);
58   virtual ~FGParking();
59   
60   double getHeading  () const { return heading;     };
61   double getRadius   () const { return radius;      };
62
63   std::string getType     () const { return type;        };
64   std::string getCodes    () const { return airlineCodes;};
65   std::string getName     () const { return parkingName; };
66
67   // TODO do parkings have different name and ident?
68   virtual const std::string& name() const { return parkingName; }
69
70   void setPushBackPoint(const FGTaxiNodeRef& node);
71   FGTaxiNodeRef getPushBackPoint () { return pushBackPoint; };
72
73   bool operator< (const FGParking &other) const {
74     return radius < other.radius; };
75 };
76
77 #endif