]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/props.hxx
Merge branch 'jmt/track-bug' into next
[flightgear.git] / src / Network / props.hxx
index bd173bf0500d0bd051c802716ad00e0ac6a88b66..bb661aed1e35676717f34efff8c1d83c99e2e26d 100644 (file)
@@ -1,8 +1,10 @@
-// props.hxx -- FGFS property manager interaction class
+// \file props.hxx
+// Property server class.
 //
 // Written by Curtis Olson, started September 2000.
+// Modified by Bernie Bright, May 2002.
 //
-// Copyright (C) 2000  Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2000  Curtis L. Olson - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
@@ -16,7 +18,7 @@
 //
 // You should have received a copy of the GNU General Public License
 // along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 //
 // $Id$
 
 #ifndef _FG_PROPS_HXX
 #define _FG_PROPS_HXX
 
-
 #include <simgear/compiler.h>
-#include <simgear/misc/props.hxx>
-
-#include STL_STRING
-
-#include "protocol.hxx"
-
-FG_USING_STD(string);
-
+#include <string>
+#include <vector>
 
-const static int max_cmd_len = 256;
+using std::string;
+using std::vector;
 
-class FGProps : public FGProtocol {
+#include <plib/netChannel.h>
 
-    char buf[max_cmd_len];
-    int length;
+#include "protocol.hxx"
 
-    // tree view of property list
-    string path;
+/**
+ * Property server class.
+ * This class provides a telnet-like server for remote access to
+ * FlightGear properties.
+ */
+class FGProps : public FGProtocol,
+               public netChannel
+{
+private:
+
+    /**
+     * Server port to listen on.
+     */
+    int port;
 
 public:
-
-    FGProps();
+    /**
+     * Create a new TCP server.
+     * 
+     * @param tokens Tokenized configuration parameters
+     */
+    FGProps( const vector<string>& tokens );
+
+    /**
+     * Destructor.
+     */
     ~FGProps();
 
-    // open hailing frequencies
+    /**
+     * Start the telnet server.
+     */
     bool open();
 
-    // process work for this port
+    /**
+     * Process network activity.
+     */
     bool process();
-    bool process_command( const char *cmd );
 
-    // close the channel
+    /**
+     * 
+     */
     bool close();
-};
 
+    /**
+     * Accept a new client connection.
+     */
+    void handleAccept();
+
+};
 
 #endif // _FG_PROPS_HXX
+