]> git.mxchange.org Git - flightgear.git/blob - src/Network/HLA/hla.hxx
hla: Avoid using deprecated readObjectModelTemplate.
[flightgear.git] / src / Network / HLA / hla.hxx
1 //
2 // Copyright (C) 2009 - 2010  Mathias Fröhlich <Mathias.Froehlich@web.de>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License as
6 // published by the Free Software Foundation; either version 2 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but
10 // WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 // General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 //
18
19 #ifndef _FG_HLA_HXX
20 #define _FG_HLA_HXX
21
22 #include <simgear/compiler.h>
23 #include <simgear/structure/SGSharedPtr.hxx>
24 #include <simgear/props/props.hxx>
25
26 #include <string>
27 #include <vector>
28 #include <Network/protocol.hxx>
29
30 namespace simgear {
31 class HLAFederate;
32 class HLAObjectClass;
33 class HLAObjectInstance;
34 }
35
36 class FGHLA : public FGProtocol {
37 public:
38     FGHLA(const std::vector<std::string>& tokens);
39     virtual ~FGHLA();
40
41     virtual bool open();
42     virtual bool process();
43     virtual bool close();
44
45 private:
46     /// All the utility classes we need currently
47     class XMLConfigReader;
48     class Federate;
49
50     /// The configuration parameters extracted from the tokens in the constructor
51     std::string _objectModelConfig;
52     std::string _federation;
53     std::string _federate;
54
55     /// The toplevel rti class
56     SGSharedPtr<Federate> _hlaFederate;
57     /// This class that is used to send register the local instance
58     SGSharedPtr<simgear::HLAObjectClass> _localAircraftClass;
59     /// The local aircraft instance
60     SGSharedPtr<simgear::HLAObjectInstance> _localAircraftInstance;
61 };
62
63 #endif // _FG_HLA_HXX