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