1 // transmissionlist.hxx -- transmission management class
3 // Written by Alexander Kappes, started March 2002.
4 // Based on navlist.hxx by Curtis Olson, started April 2000.
6 // Copyright (C) 2000 Curtis L. Olson - http://www.flightgear.org/~curt
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef _FG_TRANSMISSIONLIST_HXX
25 #define _FG_TRANSMISSIONLIST_HXX
28 #include <simgear/compiler.h>
29 #include <simgear/misc/sg_path.hxx>
35 #include "transmission.hxx"
40 class FGTransmissionList {
43 typedef vector < FGTransmission > transmission_list_type;
44 typedef transmission_list_type::iterator transmission_list_iterator;
45 typedef transmission_list_type::const_iterator transmission_list_const_iterator;
47 // Map of transmission lists by station type
48 // typedef map < int, transmission_list_type, less<int> > transmission_map_type;
49 typedef map < atc_type, 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;
53 transmission_map_type transmissionlist_station;
58 ~FGTransmissionList();
60 // load the transmission data and build the map
61 bool init( const SGPath& path );
63 // query the database for the specified code,
64 bool query_station( const atc_type &station, FGTransmission *a, int max_trans, int &num_trans );
66 // generate the transmission text given the code of the message
68 // Set ttext = true to generate the spoken transmission text,
69 // or false to generate the abridged menu entry text.
70 string gen_text(const atc_type &station, const TransCode code,
71 const TransPar &tpars, const bool ttext);
76 void mkATCMenuInit (void);
77 void mkATCMenu (void);
79 extern FGTransmissionList *current_transmissionlist;
82 #endif // _FG_TRANSMISSIONLIST_HXX