]> git.mxchange.org Git - flightgear.git/blob - src/Network/props.hxx
Merge branch 'work4' into next
[flightgear.git] / src / Network / props.hxx
1 // \file props.hxx
2 // Property server class.
3 //
4 // Written by Curtis Olson, started September 2000.
5 // Modified by Bernie Bright, May 2002.
6 //
7 // Copyright (C) 2000  Curtis L. Olson - http://www.flightgear.org/~curt
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 //
23 // $Id$
24
25
26 #ifndef _FG_PROPS_HXX
27 #define _FG_PROPS_HXX
28
29 #include <simgear/compiler.h>
30 #include <string>
31 #include <vector>
32
33 using std::string;
34 using std::vector;
35
36 #include <plib/netChannel.h>
37
38 #include "protocol.hxx"
39
40 /**
41  * Property server class.
42  * This class provides a telnet-like server for remote access to
43  * FlightGear properties.
44  */
45 class FGProps : public FGProtocol,
46                 public netChannel
47 {
48 private:
49
50     /**
51      * Server port to listen on.
52      */
53     int port;
54
55 public:
56     /**
57      * Create a new TCP server.
58      * 
59      * @param tokens Tokenized configuration parameters
60      */
61     FGProps( const vector<string>& tokens );
62
63     /**
64      * Destructor.
65      */
66     ~FGProps();
67
68     /**
69      * Start the telnet server.
70      */
71     bool open();
72
73     /**
74      * Process network activity.
75      */
76     bool process();
77
78     /**
79      * 
80      */
81     bool close();
82
83     /**
84      * Accept a new client connection.
85      */
86     void handleAccept();
87
88 };
89
90 #endif // _FG_PROPS_HXX
91