]> git.mxchange.org Git - flightgear.git/commitdiff
Revert most iostream-related changes to JSBSim
authortimoore <timoore>
Fri, 6 Jun 2008 21:21:57 +0000 (21:21 +0000)
committertimoore <timoore>
Fri, 6 Jun 2008 21:21:57 +0000 (21:21 +0000)
So many files in JSBSim use cout that it is not productive to remove
iostream from header files.

27 files changed:
src/FDM/JSBSim/input_output/FGPropertyManager.h
src/FDM/JSBSim/input_output/FGXMLElement.cpp
src/FDM/JSBSim/input_output/FGXMLElement.h
src/FDM/JSBSim/input_output/FGXMLFileRead.h
src/FDM/JSBSim/input_output/FGfdmSocket.cpp
src/FDM/JSBSim/input_output/FGfdmSocket.h
src/FDM/JSBSim/math/FGColumnVector3.cpp
src/FDM/JSBSim/math/FGColumnVector3.h
src/FDM/JSBSim/math/FGCondition.cpp
src/FDM/JSBSim/math/FGCondition.h
src/FDM/JSBSim/math/FGFunction.cpp
src/FDM/JSBSim/math/FGFunction.h
src/FDM/JSBSim/math/FGMatrix33.cpp
src/FDM/JSBSim/math/FGMatrix33.h
src/FDM/JSBSim/models/FGAerodynamics.h
src/FDM/JSBSim/models/FGGroundReactions.cpp
src/FDM/JSBSim/models/FGInput.h
src/FDM/JSBSim/models/FGLGear.cpp
src/FDM/JSBSim/models/FGMassBalance.h
src/FDM/JSBSim/models/FGModel.h
src/FDM/JSBSim/models/FGOutput.cpp
src/FDM/JSBSim/models/FGOutput.h
src/FDM/JSBSim/models/FGPropulsion.cpp
src/FDM/JSBSim/models/FGPropulsion.h
src/FDM/JSBSim/models/flight_control/FGActuator.cpp
src/FDM/JSBSim/models/flight_control/FGFCSComponent.h
src/FDM/JSBSim/models/propulsion/FGEngine.cpp

index a14501d6e28644a690b5352ddaa4f4bde4f57ea3..40754780ecffa2f81f035e796221f9b5d7d178fa 100644 (file)
@@ -36,15 +36,8 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <string>
-#ifdef FGFS
-#  include <simgear/props/props.hxx>
-#  include <simgear/debug/logstream.hxx>
-#  define JSBDEBUG sglog() << loglevel(SG_FLIGHT, SG_ALERT)
-#else
-#  include <iostream>
-#  include "simgear/props/props.hxx"
-#  define JSBDEBUG std::cout
-#endif
+#include <iostream>
+#include "simgear/props/props.hxx"
 
 #include "FGJSBBase.h"
 
@@ -59,7 +52,7 @@ FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 namespace JSBSim {
-  // Yuck - shouldn't be using in header files
+  using std::cout;
   using std::string;
   using std::endl;
 
@@ -518,9 +511,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
     Tie (const string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault))
-        JSBDEBUG << "Failed to tie property " << name << " to functions" << endl;
+        cout << "Failed to tie property " << name << " to functions" << endl;
       else if (debug_lvl & 0x20)
-        JSBDEBUG << name << endl;
+        cout << name << endl;
     }
 
 
@@ -546,9 +539,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
                                 void (*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
-        JSBDEBUG << "Failed to tie property " << name << " to indexed functions" << endl;
+        cout << "Failed to tie property " << name << " to indexed functions" << endl;
       else if (debug_lvl & 0x20)
-        JSBDEBUG << name << endl;
+        cout << name << endl;
     }
 
 
@@ -576,9 +569,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
            void (T::*setter)(V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
-        JSBDEBUG << "Failed to tie property " << name << " to object methods" << endl;
+        cout << "Failed to tie property " << name << " to object methods" << endl;
       else if (debug_lvl & 0x20)
-        JSBDEBUG << name << endl;
+        cout << name << endl;
     }
 
     /**
@@ -605,9 +598,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
                          void (T::*setter)(int, V) = 0, bool useDefault = true)
     {
       if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
-        JSBDEBUG << "Failed to tie property " << name << " to indexed object methods" << endl;
+        cout << "Failed to tie property " << name << " to indexed object methods" << endl;
       else if (debug_lvl & 0x20)
-        JSBDEBUG << name << endl;
+        cout << name << endl;
    }
 };
 }
index 831256fe104eb1f06ae9196565683eea87a8afe8..741a806095ac292e16d1a59b25ebc55ab65e480c 100755 (executable)
@@ -53,8 +53,6 @@ INCLUDES
 #include <stdlib.h>
 #include <math.h>
 
-#include <iostream>
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -64,10 +62,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_XMLELEMENT;
 
-using std::cerr;
-using std::cout;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 55aa6b1f72a3549c6c7ecfc6d37ef2e82cb48375..ce3711aed1e1a42e442bbb7d3bfc9f2484d6c80b 100755 (executable)
@@ -39,17 +39,30 @@ INCLUDES
 #  ifdef SG_HAVE_STD_INCLUDES
 #    include <string>
 #    include <vector>
+#    include <iostream>
 #    include <map>
 #  else
 #    include <vector.h>
 #    include <string>
+#    include <iostream.h>
 #    include <map.h>
 #  endif
 #else
 #  include <string>
 #  include <map>
+#  include <iostream>
 #  include <vector>
+   using std::string;
+   using std::map;
+   using std::vector;
+   using std::cout;
+   using std::endl;
 #endif
+   using std::string;
+   using std::map;
+   using std::vector;
+   using std::cout;
+   using std::endl;
 
 #include <math/FGColumnVector3.h>
 
@@ -146,7 +159,7 @@ public:
   /** Constructor
       @param nm the name of this element (if given)
       */
-  Element(std::string nm);
+  Element(string nm);
   /// Destructor
   ~Element(void);
 
@@ -154,23 +167,23 @@ public:
       @param key specifies the attribute key to retrieve the value of.
       @return the key value (as a string), or the empty string if no such
               attribute exists. */
-  std::string GetAttributeValue(std::string key);
+  string GetAttributeValue(string key);
 
   /** Retrieves an attribute value as a double precision real number.
       @param key specifies the attribute key to retrieve the value of.
       @return the key value (as a number), or the HUGE_VAL if no such
               attribute exists. */
-  double GetAttributeValueAsNumber(std::string key);
+  double GetAttributeValueAsNumber(string key);
 
   /** Retrieves the element name.
       @return the element name, or the empty string if no name has been set.*/
-  std::string GetName(void) {return name;}
+  string GetName(void) {return name;}
 
   /** Gets a line of data belonging to an element.
       @param i the index of the data line to return (0 by default).
       @return a string representing the data line requested, or the empty string
               if none exists.*/
-  std::string GetDataLine(unsigned int i=0);
+  string GetDataLine(unsigned int i=0);
 
   /// Returns the number of lines of data stored
   unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();}
@@ -179,7 +192,7 @@ public:
   unsigned int GetNumElements(void) {return (unsigned int)children.size();}
 
   /// Returns the number of named child elements for this element.
-  unsigned int GetNumElements(std::string);
+  unsigned int GetNumElements(string);
 
   /** Converts the element data to a number.
       This function attempts to convert the first (and presumably only) line of
@@ -212,12 +225,12 @@ public:
   Element* GetParent(void) {return parent;}
 
   /** Searches for a specified element.
-      Finds the first element that matches the supplied std::string, or simply the first
-      element if no search std::string is supplied. This function call resets the internal
+      Finds the first element that matches the supplied string, or simply the first
+      element if no search string is supplied. This function call resets the internal
       element counter to the first element.
-      @param el the search std::string (empty std::string by default).
-      @return a pointer to the first element that matches the supplied search std::string. */
-  Element* FindElement(std::string el="");
+      @param el the search string (empty string by default).
+      @return a pointer to the first element that matches the supplied search string. */
+  Element* FindElement(string el="");
 
   /** Searches for the next element as specified.
       This function would be called after FindElement() is first called (in order to
@@ -228,7 +241,7 @@ public:
       @param el the name of the next element to find.
       @return the pointer to the found element, or 0 if no appropriate element us
               found.*/
-  Element* FindNextElement(std::string el="");
+  Element* FindNextElement(string el="");
 
   /** Searches for the named element and returns the string data belonging to it.
       This function allows the data belonging to a named element to be returned
@@ -238,7 +251,7 @@ public:
       default)
       @return the data value for the named element as a string, or the empty
               string if the element cannot be found. */
-  std::string FindElementValue(std::string el="");
+  string FindElementValue(string el="");
 
   /** Searches for the named element and returns the data belonging to it as a number.
       This function allows the data belonging to a named element to be returned
@@ -248,7 +261,7 @@ public:
       default)
       @return the data value for the named element as a double, or HUGE_VAL if the
               data is missing. */
-  double FindElementValueAsNumber(std::string el="");
+  double FindElementValueAsNumber(string el="");
 
   /** Searches for the named element and converts and returns the data belonging to it.
       This function allows the data belonging to a named element to be returned
@@ -265,7 +278,7 @@ public:
              to which the value returned will be converted.
       @return the unit-converted data value for the named element as a double,
               or HUGE_VAL if the data is missing. */
-  double FindElementValueAsNumberConvertTo(std::string el, std::string target_units);
+  double FindElementValueAsNumberConvertTo(string el, string target_units);
 
   /** Searches for the named element and converts and returns the data belonging to it.
       This function allows the data belonging to a named element to be returned
@@ -284,9 +297,9 @@ public:
              to which the value returned will be converted.
       @return the unit-converted data value for the named element as a double,
               or HUGE_VAL if the data is missing. */
-  double FindElementValueAsNumberConvertFromTo( std::string el,
-                                                std::string supplied_units,
-                                                std::string target_units);
+  double FindElementValueAsNumberConvertFromTo( string el,
+                                                string supplied_units,
+                                                string target_units);
 
   /** Composes a 3-element column vector for the supplied location or orientation.
       This function processes a LOCATION or ORIENTATION construct, returning a
@@ -297,7 +310,7 @@ public:
       @param target_units the string representing the native units used by JSBSim
              to which the value returned will be converted.
       @return a column vector object built from the LOCATION or ORIENT components. */
-  FGColumnVector3 FindElementTripletConvertTo( std::string target_units);
+  FGColumnVector3 FindElementTripletConvertTo( string target_units);
 
   /** This function sets the value of the parent class attribute to the supplied
       Element pointer.
@@ -311,11 +324,11 @@ public:
   /** Stores an attribute belonging to this element.
   *   @param name The string name of the attribute.
   *   @param value The string value of the attribute. */
-  void AddAttribute(std::string name, std::string value);
+  void AddAttribute(string name, string value);
 
   /** Stores data belonging to this element.
   *   @param d the data to store. */
-  void AddData(std::string d);
+  void AddData(string d);
 
   /** Prints the element.
   *   Prints this element and calls the Print routine for child elements.
@@ -323,14 +336,14 @@ public:
   void Print(unsigned int level=0);
 
 private:
-  std::string name;
-  std::map <std::string, std::string> attributes;
-  std::vector <std::string> data_lines;
-  std::vector <Element*> children;
-  std::vector <std::string> attribute_key;
+  string name;
+  map <string, string> attributes;
+  vector <string> data_lines;
+  vector <Element*> children;
+  vector <string> attribute_key;
   Element *parent;
   unsigned int element_index;
-  typedef std::map <std::string, std::map <std::string, double> > tMapConvert;
+  typedef map <string, map <string, double> > tMapConvert;
   tMapConvert convert;
 };
 
index 15493c674931535676d200401d812d3330608eeb..b9e250600918594dd232a61694f4836bc8004be2 100755 (executable)
@@ -35,7 +35,6 @@ SENTRY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <fstream>
 #include <input_output/FGXMLParse.h>
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -59,7 +58,7 @@ protected:
   Element* document;
   Element* LoadXMLDocument(string XML_filename)
   {
-    std::ifstream infile;
+    ifstream infile;
 
     if ( !XML_filename.empty() ) {
       if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";
index 2376f2b806f28c3c8d28962e1ab373c20bdd40b5..c1a582699ae7ae09ccd09e1813957385916a19c2 100644 (file)
@@ -38,7 +38,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <cstring>
-#include <iostream>
 
 #include "FGfdmSocket.h"
 
@@ -47,10 +46,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FDMSOCKET;
 
-using std::cerr;
-using std::cout;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index cd88fddbd6da698293ed05665e4b3eecb744f4bc..f1d41ef1bb8a4d6d38d4d1c2e8132c04d7134823 100644 (file)
@@ -43,8 +43,21 @@ INCLUDES
 #ifdef FGFS
 #  include <simgear/compiler.h>
 #  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
 #endif
 
 #include <sys/types.h>
index fc66c27e73908b29348e6de94e3f9811784b7ac1..f34afe5923420592ecadda642b44f2bbca6df0a2 100644 (file)
@@ -39,18 +39,12 @@ INCLUDES
 
 #include "FGColumnVector3.h"
 #include <stdio.h>
-#include <iostream>
 
 namespace JSBSim {
 
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_COLUMNVECTOR3;
 
-using std::ostream;
-using std::cerr;
-using std::cout;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 1045436cbd27976ca927a55a0b474fa529a9cba9..85e6bab227304a11ce6dec3df00ede9b7cca63f1 100644 (file)
@@ -44,8 +44,14 @@ INCLUDES
 #  include <math.h>
 #  include <simgear/compiler.h>
 #  include STL_STRING
-#  include <iosfwd>
 #  include STL_FSTREAM
+#  include STL_IOSTREAM
+   SG_USING_STD(string);
+   SG_USING_STD(ostream);
+   SG_USING_STD(istream);
+   SG_USING_STD(cerr);
+   SG_USING_STD(cout);
+   SG_USING_STD(endl);
 #else
 #  include <string>
 #  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
@@ -60,10 +66,16 @@ INCLUDES
 #    else
 #      include <cmath>
 #    endif
+     using std::ostream;
+     using std::istream;
+     using std::cerr;
+     using std::cout;
+     using std::endl;
 #    if !(defined(_MSC_VER) && _MSC_VER <= 1200)
        using std::sqrt;
 #    endif
 #  endif
+   using std::string;
 #endif
 
 #include "FGJSBBase.h"
@@ -162,7 +174,7 @@ public:
   /** Prints the contents of the vector
       @param delimeter the item separator (tab or comma)
       @return a string with the delimeter-separated contents of the vector  */
-  std::string Dump(std::string delimeter) const;
+  string Dump(string delimeter) const;
 
   /** Assignment operator.
       @param b source vector.
@@ -304,7 +316,7 @@ inline FGColumnVector3 operator*(double scalar, const FGColumnVector3& A) {
     @param os Stream to write to.
     @param M Matrix to write.
     Write the matrix to a stream.*/
-std::ostream& operator<<(std::ostream& os, const FGColumnVector3& col);
+ostream& operator<<(ostream& os, const FGColumnVector3& col);
 
 } // namespace JSBSim
 
index 9177f4f02dd3082448db2d716fa2174429385500..e5cebbcb043397ff35bbad776023640fa2d3dae4 100644 (file)
@@ -34,8 +34,6 @@ COMMENTS, REFERENCES,  and NOTES
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <iostream>
-
 #include "FGCondition.h"
 
 namespace JSBSim {
@@ -43,11 +41,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_CONDITION;
 
-using std::cerr;
-using std::cout;
-using std::endl;
-using std::vector;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index aaee6aacd7c08a306a9c49944a82888529795f04..c778e0f79ae5bf71e0fbec0799d3fefcbf36ffe9 100644 (file)
@@ -38,8 +38,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <map>
-#include <string>
-
 #include <FGJSBBase.h>
 #include <input_output/FGXMLElement.h>
 #include <input_output/FGPropertyManager.h>
@@ -71,7 +69,7 @@ class FGCondition : public FGJSBBase
 {
 public:
   FGCondition(Element* element, FGPropertyManager* PropertyManager);
-  FGCondition(std::string test, FGPropertyManager* PropertyManager);
+  FGCondition(string test, FGPropertyManager* PropertyManager);
   ~FGCondition(void);
 
   bool Evaluate(void);
@@ -80,18 +78,18 @@ public:
 private:
   enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
   enum eLogic {elUndef=0, eAND, eOR};
-  std::map <std::string, eComparison> mComparison;
+  map <string, eComparison> mComparison;
   eLogic Logic;
 
   FGPropertyManager *TestParam1, *TestParam2, *PropertyManager;
   double TestValue;
   eComparison Comparison;
   bool isGroup;
-  std::string conditional;
+  string conditional;
 
-  static std::string indent;
+  static string indent;
 
-  std::vector <FGCondition> conditions;
+  vector <FGCondition> conditions;
   void InitializeConditionals(void);
 
   void Debug(int from);
index 304575a62bdb505ca0f31c41ca7b2d477bad4cd5..f040e2a65f59711a4daa52bb205b51f5b2fb7c2e 100755 (executable)
@@ -29,7 +29,6 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include <stdio.h>
-#include <iostream>
 
 #include "FGFunction.h"
 #include "FGTable.h"
@@ -41,9 +40,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_FUNCTION;
 
-using std::cerr;
-using std::cout;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index bad10f5f156b46788b8220563be670572c26e891..47bc1ccc38f4d236e780785eb490567e5da9113b 100755 (executable)
@@ -180,7 +180,7 @@ public:
   void cacheValue(bool shouldCache);
 
 private:
-  std::vector <FGParameter*> Parameters;
+  vector <FGParameter*> Parameters;
   FGPropertyManager* const PropertyManager;
   bool cached;
   string Prefix;
index 5b66bc8e144fe64b74821c978979c65380de8e42..9b4ce123103196d3f730bec674d97394b768b924 100644 (file)
@@ -45,9 +45,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_MATRIX33;
 
-using std::cout;
-using std::endl;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -64,7 +61,7 @@ FGMatrix33::FGMatrix33(void)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
+ostream& operator<<(ostream& os, const FGMatrix33& M)
 {
   for (unsigned int i=1; i<=M.Rows(); i++) {
     for (unsigned int j=1; j<=M.Cols(); j++) {
@@ -79,7 +76,7 @@ std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-std::istream& operator>>(std::istream& is, FGMatrix33& M)
+istream& operator>>(istream& is, FGMatrix33& M)
 {
   for (unsigned int i=1; i<=M.Rows(); i++) {
     for (unsigned int j=1; j<=M.Cols(); j++) {
index b540389eac60c91e9c812bf0e2de676a7d9a3003..60b1ff885dd5702abcc5bc09ed9445874181b98a 100644 (file)
@@ -45,7 +45,14 @@ INCLUDES
 #  include <math.h>
 #  include <simgear/compiler.h>
 #  include STL_STRING
-#  include <iosfwd>
+#  include STL_FSTREAM
+#  include STL_IOSTREAM
+   SG_USING_STD(string);
+   SG_USING_STD(ostream);
+   SG_USING_STD(istream);
+   SG_USING_STD(cerr);
+   SG_USING_STD(cout);
+   SG_USING_STD(endl);
 #else
 #  include <string>
 #  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
@@ -54,13 +61,19 @@ INCLUDES
 #    include <math.h>
 #  else
 #    include <fstream>
-#    include <iosfwd>
+#    include <iostream>
 #    if defined(sgi) && !defined(__GNUC__)
 #      include <math.h>
 #    else
 #      include <cmath>
 #    endif
+     using std::ostream;
+     using std::istream;
+     using std::cerr;
+     using std::cout;
+     using std::endl;
 #  endif
+   using std::string;
 #endif
 
 #include "FGColumnVector3.h"
@@ -94,7 +107,7 @@ DECLARATION: MatrixException
 class MatrixException : public FGJSBBase
 {
 public:
-  std::string Message;
+  string Message;
 };
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -460,7 +473,7 @@ inline FGMatrix33 operator*(double scalar, const FGMatrix33& A) {
 
     Write the matrix to a stream.
 */
-std::ostream& operator<<(std::ostream& os, const FGMatrix33& M);
+ostream& operator<<(ostream& os, const FGMatrix33& M);
 
 /** Read matrix from a stream.
 
@@ -469,7 +482,7 @@ std::ostream& operator<<(std::ostream& os, const FGMatrix33& M);
 
     Read matrix from a stream.
 */
-std::istream& operator>>(std::istream& is, FGMatrix33& M);
+istream& operator>>(istream& is, FGMatrix33& M);
 
 } // namespace JSBSim
 
index e25faa761ebdcf472f9e621e21704c8c70f1dfb0..91c19d122f5debc9a9ba1a1be9759743c0de0594 100644 (file)
@@ -165,20 +165,20 @@ public:
   /** Gets the strings for the current set of coefficients.
       @param delimeter either a tab or comma string depending on output type
       @return a string containing the descriptive names for all coefficients */
-  std::string GetCoefficientStrings(std::string delimeter);
+  string GetCoefficientStrings(string delimeter);
 
   /** Gets the coefficient values.
       @param delimeter either a tab or comma string depending on output type
       @return a string containing the numeric values for the current set of
       coefficients */
-  std::string GetCoefficientValues(std::string delimeter);
+  string GetCoefficientValues(string delimeter);
 
 private:
-  typedef std::map<std::string,int> AxisIndex;
+  typedef map<string,int> AxisIndex;
   AxisIndex AxisIdx;
   FGFunction* AeroRPShift;
-  std::vector <FGFunction*> variables;
-  typedef std::vector <FGFunction*> CoeffArray;
+  vector <FGFunction*> variables;
+  typedef vector <FGFunction*> CoeffArray;
   CoeffArray* Coeff;
   FGColumnVector3 vFs;
   FGColumnVector3 vForces;
index 8ba03ddf4d16587e7d14759f0d1febc75afc26b1..c8bf6ab9e589ab85d0b19411692eda4ba0cf595b 100644 (file)
@@ -46,9 +46,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_GROUNDREACTIONS;
 
-using std::ostringstream;
-using std::setprecision;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -142,7 +139,7 @@ bool FGGroundReactions::Load(Element* el)
 
 string FGGroundReactions::GetGroundReactionStrings(string delimeter)
 {
-  ostringstream buf;
+  std::ostringstream buf;
 
   for (unsigned int i=0;i<lGear.size();i++) {
     if (lGear[i].IsBogey()) {
index fff348f61424d1098ca54dd213ddc0e8e680859c..4ef5dad11f27de57251e9fc53828b8262696ce88 100755 (executable)
@@ -42,6 +42,16 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
+#  include STL_IOSTREAM
+#  include STL_FSTREAM
+#else
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
+#    include <iostream.h>
+#    include <fstream.h>
+#  else
+#    include <iostream>
+#    include <fstream>
+#  endif
 #endif
 
 #include <input_output/FGfdmSocket.h>
index bfbe8a7c08416a34213bfec292040c46aa131b32..b25b95a89aae7ff4e6fcc7692c43a3a6afcb5edd 100644 (file)
@@ -38,8 +38,6 @@ HISTORY
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <algorithm>
-
 #include "FGLGear.h"
 
 namespace JSBSim {
@@ -652,11 +650,11 @@ void FGLGear::ComputeVerticalStrutForce(void)
   } else {
     dampForce   = -compressSpeed * bDampRebound;
   }
-  vLocalForce(eZ) =  std::min(springForce + dampForce, (double)0.0);
+  vLocalForce(eZ) =  min(springForce + dampForce, (double)0.0);
 
   // Remember these values for reporting
-  MaximumStrutForce = std::max(MaximumStrutForce, fabs(vLocalForce(eZ)));
-  MaximumStrutTravel = std::max(MaximumStrutTravel, fabs(compressLength));
+  MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ)));
+  MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength));
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 10817e9ceb230917e5fb88adee85e32670cffe3b..13f1aa9b370a003854e5efb120a29475c88e3010 100644 (file)
@@ -154,7 +154,7 @@ private:
     double Weight;
   };
 
-  std::vector <struct PointMass> PointMasses;
+  vector <struct PointMass> PointMasses;
 
   void Debug(int from);
 };
index 8ef7e27742f12f7b037b4e324b7c7ccb1140dfd1..4d0f8b7f261f78515df373b1194dfce390abb55c 100644 (file)
@@ -44,6 +44,17 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
+#  ifdef SG_HAVE_STD_INCLUDES
+#    include <iostream>
+#  else
+#    include <iostream.h>
+#  endif
+#else
+#  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
+#    include <iostream.h>
+#  else
+#    include <iostream>
+#  endif
 #endif
 
 #include <string>
@@ -54,6 +65,8 @@ DEFINITIONS
 
 #define ID_MODEL "$Id$"
 
+using namespace std;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -100,7 +113,7 @@ public:
   virtual bool Load(Element* el) {return true;}
 
   FGModel* NextModel;
-  std::string Name;
+  string Name;
 
   /** Runs the model; called by the Executive
       @see JSBSim.cpp documentation
index bc5de4f6b22f8787bf8fb89ea9990d635dcce822..64aaf018f0195d888615fb1d8142933049594317 100644 (file)
@@ -59,8 +59,6 @@ namespace JSBSim {
 static const char *IdSrc = "$Id$";
 static const char *IdHdr = ID_OUTPUT;
 
-using std::setprecision;
-
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
index 73bfda49180acf2965f8f64ee7828317f95df152..8d3f00b9ed44aec2ac682c547840aa095cd7b60e 100644 (file)
@@ -42,18 +42,18 @@ INCLUDES
 
 #ifdef FGFS
 #  include <simgear/compiler.h>
+#  include STL_IOSTREAM
 #  include STL_FSTREAM
 #else
 #  if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
+#    include <iostream.h>
 #    include <fstream.h>
 #  else
+#    include <iostream>
 #    include <fstream>
 #  endif
 #endif
 
-#include <string>
-#include <vector>
-
 #include <input_output/FGfdmSocket.h>
 #include <input_output/FGXMLFileRead.h>
 
@@ -165,10 +165,10 @@ private:
   enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
   bool sFirstPass, dFirstPass, enabled;
   int SubSystems;
-  std::string output_file_name, delimeter, Filename, DirectivesFile;
-  std::ofstream datafile;
+  string output_file_name, delimeter, Filename, DirectivesFile;
+  ofstream datafile;
   FGfdmSocket* socket;
-  std::vector <FGPropertyManager*> OutputProperties;
+  vector <FGPropertyManager*> OutputProperties;
 
   void Debug(int from);
 };
index ba486d1398054cd57099c124dfa85c83d70820ed..a6f45021fb8a3d2972cc66a5ee9ef389dff78fa4 100644 (file)
@@ -62,7 +62,6 @@ static const char *IdHdr = ID_PROPULSION;
 
 extern short debug_lvl;
 
-using std::ifstream;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 CLASS IMPLEMENTATION
index 19329865a4917abcb87e3d7d2a05e9285e7a0aa9..9884f61c34ead2be26452f3f89e05cd500248d25 100644 (file)
@@ -153,8 +153,8 @@ public:
       be done before calling this (i.e. magnetos, starter engage, etc.) */
   bool ICEngineStart(void);
 
-  std::string GetPropulsionStrings(std::string delimeter);
-  std::string GetPropulsionValues(std::string delimeter);
+  string GetPropulsionStrings(string delimeter);
+  string GetPropulsionValues(string delimeter);
 
   inline FGColumnVector3& GetForces(void)  {return vForces; }
   inline double GetForces(int n) const { return vForces(n);}
@@ -169,8 +169,8 @@ public:
   FGColumnVector3& GetTanksMoment(void);
   double GetTanksWeight(void);
 
-  std::ifstream* FindEngineFile(std::string filename);
-  std::string FindEngineFullPathname(std::string engine_filename);
+  ifstream* FindEngineFile(string filename);
+  string FindEngineFullPathname(string engine_filename);
   inline int GetActiveEngine(void) const {return ActiveEngine;}
   inline bool GetFuelFreeze(void) {return fuel_freeze;}
   double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;}
@@ -186,9 +186,9 @@ public:
   void unbind();
 
 private:
-  std::vector <FGEngine*>   Engines;
-  std::vector <FGTank*>     Tanks;
-  std::vector <FGTank*>::iterator iTank;
+  vector <FGEngine*>   Engines;
+  vector <FGTank*>     Tanks;
+  vector <FGTank*>::iterator iTank;
   unsigned int numSelectedFuelTanks;
   unsigned int numSelectedOxiTanks;
   unsigned int numFuelTanks;
index 6db41de90ad19456be3585f55c0da25d02ca0723..3a06e89b33656d0dad7ee1ef46b2058d8d947813 100755 (executable)
@@ -37,8 +37,6 @@ COMMENTS, REFERENCES,  and NOTES
 INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-#include <algorithm>
-
 #include "FGActuator.h"
 
 namespace JSBSim {
@@ -155,9 +153,9 @@ void FGActuator::Hysteresis(void)
   double input = Output;
   
   if (input > PreviousHystOutput) {
-    Output = std::max(PreviousHystOutput, input-0.5*hysteresis_width);
+    Output = max(PreviousHystOutput, input-0.5*hysteresis_width);
   } else if (input < PreviousHystOutput) {
-    Output = std::min(PreviousHystOutput, input+0.5*hysteresis_width);
+    Output = min(PreviousHystOutput, input+0.5*hysteresis_width);
   }
 
   PreviousHystOutput = Output;
index 935cb7596d5dc8bc32e8bb3ef62991d4771472a5..8e0fa14f4b73e66177d42e94354f56e311b568b0 100644 (file)
@@ -53,6 +53,8 @@ DEFINITIONS
 
 #define ID_FCSCOMPONENT "$Id$"
 
+using std::string;
+
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 FORWARD DECLARATIONS
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -101,8 +103,8 @@ public:
   virtual void SetOutput(void);
   inline double GetOutput (void) const {return Output;}
   inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
-  inline std::string GetName(void) const {return Name;}
-  inline std::string GetType(void) const { return Type; }
+  inline string GetName(void) const {return Name;}
+  inline string GetType(void) const { return Type; }
   virtual double GetOutputPct(void) const { return 0; }
 
 protected:
@@ -112,10 +114,10 @@ protected:
   FGPropertyManager* OutputNode;
   FGPropertyManager* ClipMinPropertyNode;
   FGPropertyManager* ClipMaxPropertyNode;
-  std::vector <FGPropertyManager*> InputNodes;
-  std::vector <float> InputSigns;
-  std::string Type;
-  std::string Name;
+  vector <FGPropertyManager*> InputNodes;
+  vector <float> InputSigns;
+  string Type;
+  string Name;
   double Input;
   double Output;
   double clipmax, clipmin;
index 436526f702199c00a58ca43177e34214804d294f..b40cdb3490a0d36e8cfe6e9980c6fe387dd6d713 100644 (file)
@@ -250,7 +250,7 @@ bool FGEngine::LoadThruster(Element *thruster_element)
   double P_Factor = 0, Sense = 0.0;
   string enginePath = FDMExec->GetEnginePath();
   string aircraftPath = FDMExec->GetFullAircraftPath();
-  std::ifstream thruster_file;
+  ifstream thruster_file;
   FGColumnVector3 location, orientation;
   string separator = "/";