]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/protocol.hxx
Fix crash on exit when FGCom is not being used.
[flightgear.git] / src / Network / protocol.hxx
index 4b73d18935a2be1de74c35fec3f20dac75ca4196..74948163e4fec1aab2b549083d186f5077b6d9b9 100644 (file)
@@ -1,8 +1,8 @@
-// protocol.hxx -- High level protocal class
+// protocol.hxx -- High level protocol class
 //
 // Written by Curtis Olson, started November 1999.
 //
-// Copyright (C) 1999  Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 1999  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 +16,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$
 
 #include <simgear/compiler.h>
 #include <simgear/io/iochannel.hxx>
 
-#include STL_STRING
+#include <string>
 #include <vector>
 
-SG_USING_STD(string);
-SG_USING_STD(vector);
+using std::string;
+using std::vector;
 
 
 #define FG_MAX_MSG_SIZE 16384
@@ -42,7 +42,8 @@ class FGProtocol {
 private:
 
     double hz;
-    int count_down;
+    double count_down;
+    long count;
 
     SGProtocolDir dir;
 
@@ -69,9 +70,12 @@ public:
 
     inline double get_hz() const { return hz; }
     inline void set_hz( double t ) { hz = t; }
-    inline int get_count_down() const { return count_down; }
-    inline void set_count_down( int c ) { count_down = c; }
-    inline void dec_count_down( int c ) { count_down -= c; }
+    inline double get_count_down() const { return count_down; }
+    inline void set_count_down( double c ) { count_down = c; }
+    inline void inc_count_down( double amt ) { count_down += amt; }
+    inline void dec_count_down( double amt ) { count_down -= amt; }
+    inline void inc_count() { count++; }
+    inline long get_count() { return count; }
 
     virtual bool gen_message();
     virtual bool parse_message();
@@ -96,7 +100,7 @@ typedef io_container::iterator io_iterator;
 typedef io_container::const_iterator const_io_iterator;
 
 #include <stdexcept>
-SG_USING_STD(invalid_argument);
+using std::invalid_argument;
 
 //namespace flightgear { namespace network {
 class FGProtocolConfigError : public invalid_argument