]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGfdmSocket.h
Updates from JSBSim, including new turbine engine model from David Culp
[flightgear.git] / src / FDM / JSBSim / FGfdmSocket.h
index 0507a69f18c798fbc61b40e894a685a0922bfd0f..ff6ef5562684cdd260a9701ffeac93b73ef73a0e 100644 (file)
@@ -47,26 +47,27 @@ INCLUDES
 #ifdef FGFS
 #  include <simgear/compiler.h>
 #  include STL_STRING
+#  include STL_IOSTREAM
+#  include STL_FSTREAM
    SG_USING_STD(cout);
    SG_USING_STD(endl);
-#  ifdef FG_HAVE_STD_INCLUDES
-#    include <iostream>
-#    include <fstream>
-#  else
+#else
+#  include <string>
+#  if defined(sgi) && !defined(__GNUC__)
 #    include <iostream.h>
 #    include <fstream.h>
+#  else
+#    include <iostream>
+#    include <fstream>
+     using std::cout;
+     using std::endl;
 #  endif
-#else
-#  include <iostream>
-#  include <fstream>
-#  include <string>
-   using std::cout;
-   using std::endl;
 #endif
 
 #include <sys/types.h>
+#include "FGJSBBase.h"
 
-#if defined(__BORLANDC__) || defined(_MSC_VER)
+#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
   #include <winsock.h>
 #else
   #include <sys/socket.h>
@@ -87,15 +88,19 @@ CLASS DECLARATION
 
 using std::string;
 
-class FGfdmSocket {
+namespace JSBSim {
+
+class FGfdmSocket : public FGJSBBase
+{
 public:
   FGfdmSocket(string, int);
   ~FGfdmSocket();
   void Send(void);
   void Append(const char*);
-  void Append(float);
+  void Append(double);
   void Append(long);
   void Clear(void);
+  bool GetConnectStatus(void) {return connected;}
 
 private:
   int sckt;
@@ -103,6 +108,8 @@ private:
   struct sockaddr_in scktName;
   struct hostent *host;
   string buffer;
+  bool connected;
+  void Debug(int from);
 };
-
+}
 #endif