]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGfdmSocket.h
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / JSBSim / FGfdmSocket.h
index 0875c43554f0795575cec5961fd5f573ecdb9c73..0c64541b2251df820236181abfc785b23af01edd 100644 (file)
@@ -34,10 +34,6 @@ SENTRY
 #ifndef FGfdmSocket_H
 #define FGfdmSocket_H
 
-/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-COMMENTS, REFERENCES,  and NOTES
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -45,25 +41,29 @@ INCLUDES
 #include <stdio.h>
 
 #ifdef FGFS
-#  pragma message("FGFS defined")
 #  include <simgear/compiler.h>
-#  ifdef FG_HAVE_STD_INCLUDES
-#    include <iostream>
-#    include <fstream>
-#  else
+#  include STL_STRING
+#  include STL_IOSTREAM
+#  include STL_FSTREAM
+   SG_USING_STD(cout);
+   SG_USING_STD(endl);
+#else
+#  include <string>
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
 #    include <iostream.h>
 #    include <fstream.h>
+#  else
+#    include <iostream>
+#    include <fstream>
+     using std::cout;
+     using std::endl;
 #  endif
-#else
-#  pragma message("FGFS not defined")
-#  include <iostream>
-#  include <fstream>
 #endif
 
-#include <string>
 #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>
@@ -76,10 +76,20 @@ INCLUDES
 DEFINITIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#define ID_FDMSOCKET "$Header"
+#define ID_FDMSOCKET "$Id$"
 
-using std::cout;
-using std::endl;
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+FORWARD DECLARATIONS
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+namespace JSBSim {
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS DOCUMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+/** Encapsulates a socket object.
+  */
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS DECLARATION
@@ -87,15 +97,17 @@ CLASS DECLARATION
 
 using std::string;
 
-class FGfdmSocket {
+class FGfdmSocket : public FGJSBBase
+{
 public:
   FGfdmSocket(string, int);
-  ~FGfdmSocket(void);
+  ~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 +115,8 @@ private:
   struct sockaddr_in scktName;
   struct hostent *host;
   string buffer;
+  bool connected;
+  void Debug(int from);
 };
-
+}
 #endif