]> git.mxchange.org Git - flightgear.git/blob - src/ATC/transmissionlist.hxx
Moved random ground cover object management code (userdata.[ch]xx) over
[flightgear.git] / src / ATC / transmissionlist.hxx
1 // transmissionlist.hxx -- transmission management class
2 //
3 // Written by Alexander Kappes, started March 2002.
4 // Based on navlist.hxx by Curtis Olson, started April 2000.
5 //
6 // Copyright (C) 2000  Curtis L. Olson - curt@flightgear.org
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22
23
24 #ifndef _FG_TRANSMISSIONLIST_HXX
25 #define _FG_TRANSMISSIONLIST_HXX
26
27
28 #include <simgear/compiler.h>
29 #include <simgear/misc/sg_path.hxx>
30
31 #include <map>
32 #include <vector>
33
34 #include <plib/pu.h>
35
36 #include "transmission.hxx"
37
38 SG_USING_STD(map);
39 SG_USING_STD(vector);
40
41 class FGTransmissionList {
42
43   // convenience types
44   typedef vector < FGTransmission > transmission_list_type;
45   typedef transmission_list_type::iterator transmission_list_iterator;
46   typedef transmission_list_type::const_iterator transmission_list_const_iterator;
47   
48   // typedef map < int, transmission_list_type, less<int> > transmission_map_type;
49   typedef map < int, transmission_list_type > transmission_map_type;
50   typedef transmission_map_type::iterator transmission_map_iterator;
51   typedef transmission_map_type::const_iterator transmission_map_const_iterator;
52   
53   transmission_map_type transmissionlist_station;
54   
55 public:
56   
57   FGTransmissionList();
58   ~FGTransmissionList();
59   
60   // load the transmission data and build the map
61   bool init( SGPath path );
62   
63   // query the database for the specified code,
64   bool query_station( const int &station, FGTransmission *a, int max_trans, int &num_trans );
65
66   // generate the transmission text given the code of the message 
67   // and the parameters
68   string gen_text(const int &station, const TransCode code,
69                   const TransPar &tpars, const bool ttext);
70
71 };
72
73
74 void mkATCMenuInit (void);
75 void mkATCMenu (void);
76
77 extern FGTransmissionList *current_transmissionlist;
78
79
80 #endif // _FG_TRANSMISSIONLIST_HXX