]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGfdmSocket.h
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGfdmSocket.h
index 52f2ffe426a31aa7cf67dfc23529e3917cc2e9bd..df9c3ec7b6ef9c7dec7e0cea3f83594a42e917f2 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Header:       FGfdmSocket.h
  Author:       Jon S. Berndt
@@ -27,43 +27,49 @@ HISTORY
 --------------------------------------------------------------------------------
 11/08/99   JSB   Created
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 SENTRY
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #ifndef FGfdmSocket_H
 #define FGfdmSocket_H
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 COMMENTS, REFERENCES,  and NOTES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 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
+#  if !defined(SG_HAVE_NATIVE_SGI_COMPILERS)
+     SG_USING_STD(cout);
+     SG_USING_STD(endl);
+#  endif
+#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
-#  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>
@@ -72,28 +78,29 @@ INCLUDES
   #include <errno.h>
 #endif
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 DEFINITIONS
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-using std::cout;
-using std::endl;
+#define ID_FDMSOCKET "$Id$"
 
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 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;
@@ -101,6 +108,8 @@ private:
   struct sockaddr_in scktName;
   struct hostent *host;
   string buffer;
+  bool connected;
+  void Debug(int from);
 };
 
 #endif