From: timoore Date: Fri, 6 Jun 2008 21:21:57 +0000 (+0000) Subject: Revert most iostream-related changes to JSBSim X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bfc19675291404ddda86c9b2a12c8f9dab1bc478;p=flightgear.git Revert most iostream-related changes to JSBSim So many files in JSBSim use cout that it is not productive to remove iostream from header files. --- diff --git a/src/FDM/JSBSim/input_output/FGPropertyManager.h b/src/FDM/JSBSim/input_output/FGPropertyManager.h index a14501d6e..40754780e 100644 --- a/src/FDM/JSBSim/input_output/FGPropertyManager.h +++ b/src/FDM/JSBSim/input_output/FGPropertyManager.h @@ -36,15 +36,8 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include -#ifdef FGFS -# include -# include -# define JSBDEBUG sglog() << loglevel(SG_FLIGHT, SG_ALERT) -#else -# include -# include "simgear/props/props.hxx" -# define JSBDEBUG std::cout -#endif +#include +#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(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(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(*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(*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; } }; } diff --git a/src/FDM/JSBSim/input_output/FGXMLElement.cpp b/src/FDM/JSBSim/input_output/FGXMLElement.cpp index 831256fe1..741a80609 100755 --- a/src/FDM/JSBSim/input_output/FGXMLElement.cpp +++ b/src/FDM/JSBSim/input_output/FGXMLElement.cpp @@ -53,8 +53,6 @@ INCLUDES #include #include -#include - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/input_output/FGXMLElement.h b/src/FDM/JSBSim/input_output/FGXMLElement.h index 55aa6b1f7..ce3711aed 100755 --- a/src/FDM/JSBSim/input_output/FGXMLElement.h +++ b/src/FDM/JSBSim/input_output/FGXMLElement.h @@ -39,17 +39,30 @@ INCLUDES # ifdef SG_HAVE_STD_INCLUDES # include # include +# include # include # else # include # include +# include # include # endif #else # include # include +# include # include + 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 @@ -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 attributes; - std::vector data_lines; - std::vector children; - std::vector attribute_key; + string name; + map attributes; + vector data_lines; + vector children; + vector attribute_key; Element *parent; unsigned int element_index; - typedef std::map > tMapConvert; + typedef map > tMapConvert; tMapConvert convert; }; diff --git a/src/FDM/JSBSim/input_output/FGXMLFileRead.h b/src/FDM/JSBSim/input_output/FGXMLFileRead.h index 15493c674..b9e250600 100755 --- a/src/FDM/JSBSim/input_output/FGXMLFileRead.h +++ b/src/FDM/JSBSim/input_output/FGXMLFileRead.h @@ -35,7 +35,6 @@ SENTRY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#include #include /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -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"; diff --git a/src/FDM/JSBSim/input_output/FGfdmSocket.cpp b/src/FDM/JSBSim/input_output/FGfdmSocket.cpp index 2376f2b80..c1a582699 100644 --- a/src/FDM/JSBSim/input_output/FGfdmSocket.cpp +++ b/src/FDM/JSBSim/input_output/FGfdmSocket.cpp @@ -38,7 +38,6 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include -#include #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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/input_output/FGfdmSocket.h b/src/FDM/JSBSim/input_output/FGfdmSocket.h index cd88fddbd..f1d41ef1b 100644 --- a/src/FDM/JSBSim/input_output/FGfdmSocket.h +++ b/src/FDM/JSBSim/input_output/FGfdmSocket.h @@ -43,8 +43,21 @@ INCLUDES #ifdef FGFS # include # include STL_STRING +# include STL_IOSTREAM +# include STL_FSTREAM + SG_USING_STD(cout); + SG_USING_STD(endl); #else # include +# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) +# include +# include +# else +# include +# include + using std::cout; + using std::endl; +# endif #endif #include diff --git a/src/FDM/JSBSim/math/FGColumnVector3.cpp b/src/FDM/JSBSim/math/FGColumnVector3.cpp index fc66c27e7..f34afe592 100644 --- a/src/FDM/JSBSim/math/FGColumnVector3.cpp +++ b/src/FDM/JSBSim/math/FGColumnVector3.cpp @@ -39,18 +39,12 @@ INCLUDES #include "FGColumnVector3.h" #include -#include 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/math/FGColumnVector3.h b/src/FDM/JSBSim/math/FGColumnVector3.h index 1045436cb..85e6bab22 100644 --- a/src/FDM/JSBSim/math/FGColumnVector3.h +++ b/src/FDM/JSBSim/math/FGColumnVector3.h @@ -44,8 +44,14 @@ INCLUDES # include # include # include STL_STRING -# include # 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 # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) @@ -60,10 +66,16 @@ INCLUDES # else # include # 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 diff --git a/src/FDM/JSBSim/math/FGCondition.cpp b/src/FDM/JSBSim/math/FGCondition.cpp index 9177f4f02..e5cebbcb0 100644 --- a/src/FDM/JSBSim/math/FGCondition.cpp +++ b/src/FDM/JSBSim/math/FGCondition.cpp @@ -34,8 +34,6 @@ COMMENTS, REFERENCES, and NOTES INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#include - #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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/math/FGCondition.h b/src/FDM/JSBSim/math/FGCondition.h index aaee6aacd..c778e0f79 100644 --- a/src/FDM/JSBSim/math/FGCondition.h +++ b/src/FDM/JSBSim/math/FGCondition.h @@ -38,8 +38,6 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include -#include - #include #include #include @@ -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 mComparison; + map 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 conditions; + vector conditions; void InitializeConditionals(void); void Debug(int from); diff --git a/src/FDM/JSBSim/math/FGFunction.cpp b/src/FDM/JSBSim/math/FGFunction.cpp index 304575a62..f040e2a65 100755 --- a/src/FDM/JSBSim/math/FGFunction.cpp +++ b/src/FDM/JSBSim/math/FGFunction.cpp @@ -29,7 +29,6 @@ INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ #include -#include #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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/math/FGFunction.h b/src/FDM/JSBSim/math/FGFunction.h index bad10f5f1..47bc1ccc3 100755 --- a/src/FDM/JSBSim/math/FGFunction.h +++ b/src/FDM/JSBSim/math/FGFunction.h @@ -180,7 +180,7 @@ public: void cacheValue(bool shouldCache); private: - std::vector Parameters; + vector Parameters; FGPropertyManager* const PropertyManager; bool cached; string Prefix; diff --git a/src/FDM/JSBSim/math/FGMatrix33.cpp b/src/FDM/JSBSim/math/FGMatrix33.cpp index 5b66bc8e1..9b4ce1231 100644 --- a/src/FDM/JSBSim/math/FGMatrix33.cpp +++ b/src/FDM/JSBSim/math/FGMatrix33.cpp @@ -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++) { diff --git a/src/FDM/JSBSim/math/FGMatrix33.h b/src/FDM/JSBSim/math/FGMatrix33.h index b540389ea..60b1ff885 100644 --- a/src/FDM/JSBSim/math/FGMatrix33.h +++ b/src/FDM/JSBSim/math/FGMatrix33.h @@ -45,7 +45,14 @@ INCLUDES # include # include # include STL_STRING -# include +# 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 # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) @@ -54,13 +61,19 @@ INCLUDES # include # else # include -# include +# include # if defined(sgi) && !defined(__GNUC__) # include # else # include # 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 diff --git a/src/FDM/JSBSim/models/FGAerodynamics.h b/src/FDM/JSBSim/models/FGAerodynamics.h index e25faa761..91c19d122 100644 --- a/src/FDM/JSBSim/models/FGAerodynamics.h +++ b/src/FDM/JSBSim/models/FGAerodynamics.h @@ -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 AxisIndex; + typedef map AxisIndex; AxisIndex AxisIdx; FGFunction* AeroRPShift; - std::vector variables; - typedef std::vector CoeffArray; + vector variables; + typedef vector CoeffArray; CoeffArray* Coeff; FGColumnVector3 vFs; FGColumnVector3 vForces; diff --git a/src/FDM/JSBSim/models/FGGroundReactions.cpp b/src/FDM/JSBSim/models/FGGroundReactions.cpp index 8ba03ddf4..c8bf6ab9e 100644 --- a/src/FDM/JSBSim/models/FGGroundReactions.cpp +++ b/src/FDM/JSBSim/models/FGGroundReactions.cpp @@ -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 +# include STL_IOSTREAM +# include STL_FSTREAM +#else +# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) +# include +# include +# else +# include +# include +# endif #endif #include diff --git a/src/FDM/JSBSim/models/FGLGear.cpp b/src/FDM/JSBSim/models/FGLGear.cpp index bfbe8a7c0..b25b95a89 100644 --- a/src/FDM/JSBSim/models/FGLGear.cpp +++ b/src/FDM/JSBSim/models/FGLGear.cpp @@ -38,8 +38,6 @@ HISTORY INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#include - #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)); } //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/src/FDM/JSBSim/models/FGMassBalance.h b/src/FDM/JSBSim/models/FGMassBalance.h index 10817e9ce..13f1aa9b3 100644 --- a/src/FDM/JSBSim/models/FGMassBalance.h +++ b/src/FDM/JSBSim/models/FGMassBalance.h @@ -154,7 +154,7 @@ private: double Weight; }; - std::vector PointMasses; + vector PointMasses; void Debug(int from); }; diff --git a/src/FDM/JSBSim/models/FGModel.h b/src/FDM/JSBSim/models/FGModel.h index 8ef7e2774..4d0f8b7f2 100644 --- a/src/FDM/JSBSim/models/FGModel.h +++ b/src/FDM/JSBSim/models/FGModel.h @@ -44,6 +44,17 @@ INCLUDES #ifdef FGFS # include +# ifdef SG_HAVE_STD_INCLUDES +# include +# else +# include +# endif +#else +# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) +# include +# else +# include +# endif #endif #include @@ -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 diff --git a/src/FDM/JSBSim/models/FGOutput.cpp b/src/FDM/JSBSim/models/FGOutput.cpp index bc5de4f6b..64aaf018f 100644 --- a/src/FDM/JSBSim/models/FGOutput.cpp +++ b/src/FDM/JSBSim/models/FGOutput.cpp @@ -59,8 +59,6 @@ namespace JSBSim { static const char *IdSrc = "$Id$"; static const char *IdHdr = ID_OUTPUT; -using std::setprecision; - /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ diff --git a/src/FDM/JSBSim/models/FGOutput.h b/src/FDM/JSBSim/models/FGOutput.h index 73bfda491..8d3f00b9e 100644 --- a/src/FDM/JSBSim/models/FGOutput.h +++ b/src/FDM/JSBSim/models/FGOutput.h @@ -42,18 +42,18 @@ INCLUDES #ifdef FGFS # include +# include STL_IOSTREAM # include STL_FSTREAM #else # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) +# include # include # else +# include # include # endif #endif -#include -#include - #include #include @@ -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 OutputProperties; + vector OutputProperties; void Debug(int from); }; diff --git a/src/FDM/JSBSim/models/FGPropulsion.cpp b/src/FDM/JSBSim/models/FGPropulsion.cpp index ba486d139..a6f45021f 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.cpp +++ b/src/FDM/JSBSim/models/FGPropulsion.cpp @@ -62,7 +62,6 @@ static const char *IdHdr = ID_PROPULSION; extern short debug_lvl; -using std::ifstream; /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% CLASS IMPLEMENTATION diff --git a/src/FDM/JSBSim/models/FGPropulsion.h b/src/FDM/JSBSim/models/FGPropulsion.h index 19329865a..9884f61c3 100644 --- a/src/FDM/JSBSim/models/FGPropulsion.h +++ b/src/FDM/JSBSim/models/FGPropulsion.h @@ -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 Engines; - std::vector Tanks; - std::vector ::iterator iTank; + vector Engines; + vector Tanks; + vector ::iterator iTank; unsigned int numSelectedFuelTanks; unsigned int numSelectedOxiTanks; unsigned int numFuelTanks; diff --git a/src/FDM/JSBSim/models/flight_control/FGActuator.cpp b/src/FDM/JSBSim/models/flight_control/FGActuator.cpp index 6db41de90..3a06e89b3 100755 --- a/src/FDM/JSBSim/models/flight_control/FGActuator.cpp +++ b/src/FDM/JSBSim/models/flight_control/FGActuator.cpp @@ -37,8 +37,6 @@ COMMENTS, REFERENCES, and NOTES INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ -#include - #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; diff --git a/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h b/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h index 935cb7596..8e0fa14f4 100644 --- a/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h +++ b/src/FDM/JSBSim/models/flight_control/FGFCSComponent.h @@ -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 InputNodes; - std::vector InputSigns; - std::string Type; - std::string Name; + vector InputNodes; + vector InputSigns; + string Type; + string Name; double Input; double Output; double clipmax, clipmin; diff --git a/src/FDM/JSBSim/models/propulsion/FGEngine.cpp b/src/FDM/JSBSim/models/propulsion/FGEngine.cpp index 436526f70..b40cdb349 100644 --- a/src/FDM/JSBSim/models/propulsion/FGEngine.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGEngine.cpp @@ -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 = "/";