]> git.mxchange.org Git - flightgear.git/blob - src/Network/multiplay.hxx
Make several assumptions:
[flightgear.git] / src / Network / multiplay.hxx
1 // multiplay.hxx -- protocol object for multiplay in Flightgear
2 //
3 // Written by Diarmuid Tyson, started February 2003.
4 // diarmuid.tyson@airservicesaustralia.com
5 //
6 // Copyright (C) 2003  Airservices Australia
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 #ifndef _FG_MULTIPLAY_HXX
24 #define _FG_MULTIPLAY_HXX
25
26 #define FG_MULTIPLAY_HID "$Id$"
27
28 #include <simgear/compiler.h>
29
30 #include STL_STRING
31
32 #include <simgear/scene/model/model.hxx>
33
34 #include <Main/globals.hxx>
35 #include <Main/fg_props.hxx>
36 #include <Model/acmodel.hxx>
37 #include <MultiPlayer/multiplaytxmgr.hxx>
38 #include <MultiPlayer/multiplayrxmgr.hxx>
39
40 #include "protocol.hxx"
41
42 SG_USING_STD(string);
43
44
45 /****************************************************************
46 * @version $Id$
47 *
48 * Description: FGMultiplay is an FGProtocol object used as the basic
49 * interface for the multiplayer code into FlightGears generic IO
50 * subsystem.  It only implements the basic FGProtocol methods: open(),
51 * process() and close().  It does not use Sim Gear's IO channels, as
52 * the MultiplayMgrs creates their own sockets through plib.
53 *
54 * It will set up it's direction and rate protocol properties when
55 * created.  Subsequent calls to process will prompt the
56 * MultiplayMgr to either send or receive data over the network.
57 *
58 ******************************************************************/
59
60 class FGMultiplay : public FGProtocol {
61 public:
62
63     /** Constructor */
64     FGMultiplay (const string &dir, const int rate, const string &host, const int port);
65
66     /** Destructor. */
67     ~FGMultiplay ();
68
69     /** Enables the FGMultiplay object
70     */
71     bool open();
72
73     /** Tells the multiplayer_mgr to send/receive data.
74     */
75     bool process();
76
77     /** Closes the multiplayer_mgr.
78     */
79     bool close();
80
81 private:
82
83 };
84
85
86 #endif // _FG_MULTIPLAY_HXX