1
0
Fork 0

Clean up header file use of iostream and "using" declarations

Replace include <iostream> with istream, ostream and/or iosfwd as
appropriate.

Remove using namespace std and using std::foo from header files.
This commit is contained in:
timoore 2008-06-02 21:09:51 +00:00
parent fe1dd9474e
commit 32e9505eed
48 changed files with 258 additions and 352 deletions

View file

@ -25,10 +25,8 @@
#if defined( SG_HAVE_STD_INCLUDES ) || defined( __BORLANDC__ ) || (__APPLE__) #if defined( SG_HAVE_STD_INCLUDES ) || defined( __BORLANDC__ ) || (__APPLE__)
# include <fstream> # include <fstream>
# include <iostream>
#else #else
# include <fstream.h> # include <fstream.h>
# include <iostream.h>
#endif #endif
#include <map> #include <map>
@ -41,18 +39,13 @@ SG_USING_STD(map);
SG_USING_STD(list); SG_USING_STD(list);
SG_USING_STD(string); SG_USING_STD(string);
SG_USING_STD(cout);
SG_USING_STD(ios);
SG_USING_STD(ofstream);
SG_USING_STD(ifstream);
struct WordData { struct WordData {
unsigned int offset; // Offset of beginning of word sample into raw sound sample unsigned int offset; // Offset of beginning of word sample into raw sound sample
unsigned int length; // Byte length of word sample unsigned int length; // Byte length of word sample
}; };
typedef map < string, WordData > atc_word_map_type; typedef std::map < std::string, WordData > atc_word_map_type;
typedef atc_word_map_type::iterator atc_word_map_iterator; typedef atc_word_map_type::iterator atc_word_map_iterator;
typedef atc_word_map_type::const_iterator atc_word_map_const_iterator; typedef atc_word_map_type::const_iterator atc_word_map_const_iterator;
@ -65,7 +58,7 @@ public:
// Load the two voice files - one containing the raw sound data (.wav) and one containing the word positions (.vce). // Load the two voice files - one containing the raw sound data (.wav) and one containing the word positions (.vce).
// Return true if successful. // Return true if successful.
bool LoadVoice(const string& voice); bool LoadVoice(const std::string& voice);
// Given a desired message, return a pointer to the data buffer and write the buffer length into len. // Given a desired message, return a pointer to the data buffer and write the buffer length into len.
// Sets dataOK = true if the returned buffer is valid. // Sets dataOK = true if the returned buffer is valid.

View file

@ -22,6 +22,8 @@
# include <config.h> # include <config.h>
#endif #endif
#include <iostream>
#include "approach.hxx" #include "approach.hxx"
#include "transmission.hxx" #include "transmission.hxx"
#include "transmissionlist.hxx" #include "transmissionlist.hxx"
@ -38,6 +40,9 @@
#include <GUI/gui.h> #include <GUI/gui.h>
using std::cout;
using std::endl;
//Constructor //Constructor
FGApproach::FGApproach(){ FGApproach::FGApproach(){
comm1_node = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true); comm1_node = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true);

View file

@ -34,23 +34,15 @@
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#ifdef SG_HAVE_STD_INCLUDES #ifdef SG_HAVE_STD_INCLUDES
# include <istream> # include <iosfwd>
#include <iomanip>
#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS ) #elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
# include <iostream.h> # include <iostream.h>
#elif defined( __BORLANDC__ ) #elif defined( __BORLANDC__ )
# include <iostream> # include <iostream>
#else #else
# include <istream.h> # include <istream.h>
#include <iomanip.h>
#endif #endif
#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
SG_USING_STD(istream);
#endif
SG_USING_STD(string);
#include "ATC.hxx" #include "ATC.hxx"
#include "transmission.hxx" #include "transmission.hxx"
@ -67,7 +59,7 @@ const double lfl = 10.0; // length of final leg
struct PlaneApp { struct PlaneApp {
// variables for plane if it's on the radar // variables for plane if it's on the radar
string ident; // indentification of plane std::string ident; // indentification of plane
double lon; // longitude in degrees double lon; // longitude in degrees
double lat; // latitude in degrees double lat; // latitude in degrees
double alt; // Altitute above sea level in feet double alt; // Altitute above sea level in feet
@ -111,7 +103,7 @@ class FGApproach : public FGATC {
int bucket; int bucket;
string active_runway; std::string active_runway;
double active_rw_hdg; double active_rw_hdg;
double active_rw_lon; double active_rw_lon;
double active_rw_lat; double active_rw_lat;
@ -119,7 +111,7 @@ class FGApproach : public FGATC {
int num_planes; // number of planes on the stack int num_planes; // number of planes on the stack
PlaneApp planes[max_planes]; // Array of planes PlaneApp planes[max_planes]; // Array of planes
string transmission; std::string transmission;
bool first; bool first;
SGPropertyNode_ptr comm1_node; SGPropertyNode_ptr comm1_node;
@ -138,7 +130,7 @@ class FGApproach : public FGATC {
SGPropertyNode_ptr atcopt9_node; SGPropertyNode_ptr atcopt9_node;
// for failure modeling // for failure modeling
string trans_ident; // transmitted ident std::string trans_ident; // transmitted ident
bool approach_failed; // approach failed? bool approach_failed; // approach failed?
public: public:
@ -153,14 +145,14 @@ public:
// Add new plane to stack if not already registered // Add new plane to stack if not already registered
// Input: pid - id of plane (name) // Input: pid - id of plane (name)
// Output: "true" if added; "false" if already existend // Output: "true" if added; "false" if already existend
void AddPlane(const string& pid); void AddPlane(const std::string& pid);
// Remove plane from stack if out of range // Remove plane from stack if out of range
int RemovePlane(); int RemovePlane();
inline double get_bucket() const { return bucket; } inline double get_bucket() const { return bucket; }
inline int get_pnum() const { return num_planes; } inline int get_pnum() const { return num_planes; }
inline const string& get_trans_ident() { return trans_ident; } inline const std::string& get_trans_ident() { return trans_ident; }
private: private:
@ -176,7 +168,7 @@ private:
double angle_diff_deg( const double &a1, const double &a2); double angle_diff_deg( const double &a1, const double &a2);
void set_message(const string &s); void set_message(const std::string &s);
// ======================================================================== // ========================================================================
// get point2 given starting point1 and course and distance // get point2 given starting point1 and course and distance
@ -225,7 +217,7 @@ private:
//Update the transmission string //Update the transmission string
void UpdateTransmission(void); void UpdateTransmission(void);
friend istream& operator>> ( istream&, FGApproach& ); friend std::istream& operator>> ( std::istream&, FGApproach& );
}; };
#endif // _FG_APPROACH_HXX #endif // _FG_APPROACH_HXX

View file

@ -33,18 +33,13 @@
#include <simgear/timing/sg_time.hxx> #include <simgear/timing/sg_time.hxx>
#ifdef SG_HAVE_STD_INCLUDES #ifdef SG_HAVE_STD_INCLUDES
# include <istream> # include <iosfwd>
# include <iomanip>
#elif defined( __BORLANDC__ ) || (__APPLE__) #elif defined( __BORLANDC__ ) || (__APPLE__)
# include <iostream> # include <iostream>
#else #else
# include <istream.h> # include <istream.h>
# include <iomanip.h>
#endif #endif
SG_USING_STD(istream);
SG_USING_STD(string);
#include "ATC.hxx" #include "ATC.hxx"
//DCL - a complete guess for now. //DCL - a complete guess for now.
@ -53,12 +48,12 @@ SG_USING_STD(string);
class FGATIS : public FGATC { class FGATIS : public FGATC {
//atc_type type; //atc_type type;
string transmission; // The actual ATIS transmission std::string transmission; // The actual ATIS transmission
// This is not stored in default.atis but is generated // This is not stored in default.atis but is generated
// from the prevailing conditions when required. // from the prevailing conditions when required.
// for failure modeling // for failure modeling
string trans_ident; // transmitted ident std::string trans_ident; // transmitted ident
bool atis_failed; // atis failed? bool atis_failed; // atis failed?
// Aircraft position // Aircraft position
@ -79,17 +74,17 @@ class FGATIS : public FGATC {
void Update(double dt); void Update(double dt);
//inline void set_type(const atc_type tp) {type = tp;} //inline void set_type(const atc_type tp) {type = tp;}
inline const string& get_trans_ident() { return trans_ident; } inline const std::string& get_trans_ident() { return trans_ident; }
inline void set_refname(const string& r) { refname = r; } inline void set_refname(const std::string& r) { refname = r; }
private: private:
string refname; // Holds the refname of a transmission in progress std::string refname; // Holds the refname of a transmission in progress
//Update the transmission string //Update the transmission string
void UpdateTransmission(void); void UpdateTransmission(void);
friend istream& operator>> ( istream&, FGATIS& ); friend std::istream& operator>> ( std::istream&, FGATIS& );
}; };
#endif // _FG_ATIS_HXX #endif // _FG_ATIS_HXX

View file

@ -33,16 +33,8 @@
#include "ATC.hxx" #include "ATC.hxx"
#include "ATCProjection.hxx" #include "ATCProjection.hxx"
#include STL_IOSTREAM
#include STL_STRING #include STL_STRING
SG_USING_STD(string);
SG_USING_STD(ios);
SG_USING_STD(map);
SG_USING_STD(vector);
SG_USING_STD(list);
class FGAIEntity; class FGAIEntity;
class FGATCMgr; class FGATCMgr;
@ -86,7 +78,7 @@ struct ground_network_element {
struct arc : public ground_network_element { struct arc : public ground_network_element {
int distance; int distance;
string name; std::string name;
arc_type type; arc_type type;
bool directed; //false if 2-way, true if 1-way. bool directed; //false if 2-way, true if 1-way.
//This is a can of worms since arcs might be one way in different directions under different circumstances //This is a can of worms since arcs might be one way in different directions under different circumstances
@ -95,7 +87,7 @@ struct arc : public ground_network_element {
// If the arc is directed then flow is normally from n1 to n2. See the above can of worms comment though. // If the arc is directed then flow is normally from n1 to n2. See the above can of worms comment though.
}; };
typedef vector <arc*> arc_array_type; // This was and may become again a list instead of vector typedef std::vector <arc*> arc_array_type; // This was and may become again a list instead of vector
typedef arc_array_type::iterator arc_array_iterator; typedef arc_array_type::iterator arc_array_iterator;
typedef arc_array_type::const_iterator arc_array_const_iterator; typedef arc_array_type::const_iterator arc_array_const_iterator;
@ -106,13 +98,13 @@ struct node : public ground_network_element {
unsigned int nodeID; //each node in an airport needs a unique ID number - this is ZERO-BASED to match array position unsigned int nodeID; //each node in an airport needs a unique ID number - this is ZERO-BASED to match array position
Point3D pos; Point3D pos;
Point3D orthoPos; Point3D orthoPos;
string name; std::string name;
node_type type; node_type type;
arc_array_type arcs; arc_array_type arcs;
double max_turn_radius; double max_turn_radius;
}; };
typedef vector <node*> node_array_type; typedef std::vector <node*> node_array_type;
typedef node_array_type::iterator node_array_iterator; typedef node_array_type::iterator node_array_iterator;
typedef node_array_type::const_iterator node_array_const_iterator; typedef node_array_type::const_iterator node_array_const_iterator;
@ -121,18 +113,18 @@ struct Gate : public node {
int max_weight; //units?? int max_weight; //units??
//airline_code airline; //For the future - we don't have any airline codes ATM //airline_code airline; //For the future - we don't have any airline codes ATM
int id; // The gate number in the logical scheme of things int id; // The gate number in the logical scheme of things
string name; // The real-world gate letter/number std::string name; // The real-world gate letter/number
//node* pNode; //node* pNode;
bool used; bool used;
double heading; // The direction the parked-up plane should point in degrees double heading; // The direction the parked-up plane should point in degrees
}; };
typedef vector < Gate* > gate_vec_type; typedef std::vector < Gate* > gate_vec_type;
typedef gate_vec_type::iterator gate_vec_iterator; typedef gate_vec_type::iterator gate_vec_iterator;
typedef gate_vec_type::const_iterator gate_vec_const_iterator; typedef gate_vec_type::const_iterator gate_vec_const_iterator;
// A map of gate vs. the logical (internal FGFS) gate ID // A map of gate vs. the logical (internal FGFS) gate ID
typedef map < int, Gate* > gate_map_type; typedef std::map < int, Gate* > gate_map_type;
typedef gate_map_type::iterator gate_map_iterator; typedef gate_map_type::iterator gate_map_iterator;
typedef gate_map_type::const_iterator gate_map_const_iterator; typedef gate_map_type::const_iterator gate_map_const_iterator;
@ -146,7 +138,7 @@ struct Rwy {
// This will get us up and running for single runway airports though. // This will get us up and running for single runway airports though.
}; };
typedef vector < Rwy > runway_array_type; typedef std::vector < Rwy > runway_array_type;
typedef runway_array_type::iterator runway_array_iterator; typedef runway_array_type::iterator runway_array_iterator;
typedef runway_array_type::const_iterator runway_array_const_iterator; typedef runway_array_type::const_iterator runway_array_const_iterator;
@ -157,7 +149,7 @@ typedef runway_array_type::const_iterator runway_array_const_iterator;
// Structures to use the network // Structures to use the network
// A path through the network // A path through the network
typedef vector < ground_network_element* > ground_network_path_type; typedef std::vector < ground_network_element* > ground_network_path_type;
typedef ground_network_path_type::iterator ground_network_path_iterator; typedef ground_network_path_type::iterator ground_network_path_iterator;
typedef ground_network_path_type::const_iterator ground_network_path_const_iterator; typedef ground_network_path_type::const_iterator ground_network_path_const_iterator;
@ -174,7 +166,7 @@ struct a_path {
}; };
// Paths mapped by nodeID reached so-far // Paths mapped by nodeID reached so-far
typedef map < unsigned int, a_path* > shortest_path_map_type; typedef std::map < unsigned int, a_path* > shortest_path_map_type;
typedef shortest_path_map_type::iterator shortest_path_map_iterator; typedef shortest_path_map_type::iterator shortest_path_map_iterator;
// Nodes mapped by their ID // Nodes mapped by their ID
@ -201,7 +193,7 @@ struct GroundRec {
// Almost certainly need to add more here // Almost certainly need to add more here
}; };
typedef list < GroundRec* > ground_rec_list; typedef std::list < GroundRec* > ground_rec_list;
typedef ground_rec_list::iterator ground_rec_list_itr; typedef ground_rec_list::iterator ground_rec_list_itr;
typedef ground_rec_list::const_iterator ground_rec_list_const_itr; typedef ground_rec_list::const_iterator ground_rec_list_const_itr;
@ -215,7 +207,7 @@ struct GRunwayDetails {
Point3D end2ortho; // ortho projection end2 (the take off end in the current hardwired scheme) Point3D end2ortho; // ortho projection end2 (the take off end in the current hardwired scheme)
double hdg; // true runway heading double hdg; // true runway heading
double length; // In *METERS* double length; // In *METERS*
string rwyID; std::string rwyID;
}; };
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
@ -227,13 +219,13 @@ class FGGround : public FGATC {
public: public:
FGGround(); FGGround();
FGGround(const string& id); FGGround(const std::string& id);
~FGGround(); ~FGGround();
void Init(); void Init();
void Update(double dt); void Update(double dt);
inline const string& get_trans_ident() { return trans_ident; } inline const std::string& get_trans_ident() { return trans_ident; }
// Contact ground control on arrival, assumed to request any gate // Contact ground control on arrival, assumed to request any gate
//void NewArrival(plane_rec plane); //void NewArrival(plane_rec plane);
@ -258,22 +250,22 @@ public:
Gate* GetGateNode(); Gate* GetGateNode();
// Return a pointer to a hold short node // Return a pointer to a hold short node
node* GetHoldShortNode(const string& rwyID); node* GetHoldShortNode(const std::string& rwyID);
// Runway stuff - this might change in the future. // Runway stuff - this might change in the future.
// Get a list of exits from a given runway // Get a list of exits from a given runway
// It is up to the calling function to check for non-zero size of returned array before use // It is up to the calling function to check for non-zero size of returned array before use
node_array_type GetExits(const string& rwyID); node_array_type GetExits(const std::string& rwyID);
// Get a path from one node to another // Get a path from one node to another
ground_network_path_type GetPath(node* A, node* B); ground_network_path_type GetPath(node* A, node* B);
// Get a path from a node to a runway threshold // Get a path from a node to a runway threshold
ground_network_path_type GetPath(node* A, const string& rwyID); ground_network_path_type GetPath(node* A, const std::string& rwyID);
// Get a path from a node to a runway hold short point // Get a path from a node to a runway hold short point
// Bit of a hack this at the moment! // Bit of a hack this at the moment!
ground_network_path_type GetPathToHoldShort(node* A, const string& rwyID); ground_network_path_type GetPathToHoldShort(node* A, const std::string& rwyID);
private: private:
FGATCMgr* ATCmgr; FGATCMgr* ATCmgr;
@ -314,7 +306,7 @@ private:
SGPropertyNode_ptr wind_speed_knots; //knots SGPropertyNode_ptr wind_speed_knots; //knots
// for failure modeling // for failure modeling
string trans_ident; // transmitted ident std::string trans_ident; // transmitted ident
bool ground_failed; // ground failed? bool ground_failed; // ground failed?
bool networkLoadOK; // Indicates whether LoadNetwork returned true or false at last attempt bool networkLoadOK; // Indicates whether LoadNetwork returned true or false at last attempt
@ -328,7 +320,7 @@ private:
// Physical runway details // Physical runway details
double aptElev; // Airport elevation double aptElev; // Airport elevation
string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation. std::string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation.
RunwayDetails rwy; // Assumed to be the active one for now.// Figure out which runways are active. RunwayDetails rwy; // Assumed to be the active one for now.// Figure out which runways are active.
// For now we'll just be simple and do one active runway - eventually this will get much more complex // For now we'll just be simple and do one active runway - eventually this will get much more complex
@ -353,7 +345,7 @@ private:
// Return a pointer to the node at a runway threshold // Return a pointer to the node at a runway threshold
// Returns NULL if unsuccessful. // Returns NULL if unsuccessful.
node* GetThresholdNode(const string& rwyID); node* GetThresholdNode(const std::string& rwyID);
// A shortest path algorithm from memory (I can't find the bl&*dy book again!) // A shortest path algorithm from memory (I can't find the bl&*dy book again!)
ground_network_path_type GetShortestPath(node* A, node* B); ground_network_path_type GetShortestPath(node* A, node* B);

View file

@ -26,12 +26,9 @@
#include <simgear/misc/sgstream.hxx> #include <simgear/misc/sgstream.hxx>
#include <plib/sg.h> #include <plib/sg.h>
#include STL_IOSTREAM #include <iosfwd>
#include STL_STRING #include STL_STRING
SG_USING_STD(string);
SG_USING_STD(ios);
#include "ATC.hxx" #include "ATC.hxx"
#include "ATCProjection.hxx" #include "ATCProjection.hxx"
#include "AIPlane.hxx" #include "AIPlane.hxx"
@ -117,7 +114,7 @@ public:
}; };
typedef list < TowerPlaneRec* > tower_plane_rec_list_type; typedef std::list < TowerPlaneRec* > tower_plane_rec_list_type;
typedef tower_plane_rec_list_type::iterator tower_plane_rec_list_iterator; typedef tower_plane_rec_list_type::iterator tower_plane_rec_list_iterator;
typedef tower_plane_rec_list_type::const_iterator tower_plane_rec_list_const_iterator; typedef tower_plane_rec_list_type::const_iterator tower_plane_rec_list_const_iterator;
@ -138,21 +135,21 @@ public:
// Contact tower for VFR approach // Contact tower for VFR approach
// eg "Cessna Charlie Foxtrot Golf Foxtrot Sierra eight miles South of the airport for full stop with Bravo" // eg "Cessna Charlie Foxtrot Golf Foxtrot Sierra eight miles South of the airport for full stop with Bravo"
// This function probably only called via user interaction - AI planes will have an overloaded function taking a planerec. // This function probably only called via user interaction - AI planes will have an overloaded function taking a planerec.
void VFRArrivalContact(const string& ID, const LandingType& opt = AIP_LT_UNKNOWN); void VFRArrivalContact(const std::string& ID, const LandingType& opt = AIP_LT_UNKNOWN);
// For the AI planes... // For the AI planes...
void VFRArrivalContact(const PlaneRec& plane, FGAIPlane* requestee, const LandingType& lt = AIP_LT_UNKNOWN); void VFRArrivalContact(const PlaneRec& plane, FGAIPlane* requestee, const LandingType& lt = AIP_LT_UNKNOWN);
void RequestDepartureClearance(const string& ID); void RequestDepartureClearance(const std::string& ID);
void RequestTakeOffClearance(const string& ID); void RequestTakeOffClearance(const std::string& ID);
void ReportFinal(const string& ID); void ReportFinal(const std::string& ID);
void ReportLongFinal(const string& ID); void ReportLongFinal(const std::string& ID);
void ReportOuterMarker(const string& ID); void ReportOuterMarker(const std::string& ID);
void ReportMiddleMarker(const string& ID); void ReportMiddleMarker(const std::string& ID);
void ReportInnerMarker(const string& ID); void ReportInnerMarker(const std::string& ID);
void ReportRunwayVacated(const string& ID); void ReportRunwayVacated(const std::string& ID);
void ReportReadyForDeparture(const string& ID); void ReportReadyForDeparture(const std::string& ID);
void ReportDownwind(const string& ID); void ReportDownwind(const std::string& ID);
void ReportGoingAround(const string& ID); void ReportGoingAround(const std::string& ID);
// Contact tower when at a hold short for departure - for now we'll assume plane - maybe vehicles might want to cross runway eventually? // Contact tower when at a hold short for departure - for now we'll assume plane - maybe vehicles might want to cross runway eventually?
void ContactAtHoldShort(const PlaneRec& plane, FGAIPlane* requestee, tower_traffic_type operation); void ContactAtHoldShort(const PlaneRec& plane, FGAIPlane* requestee, tower_traffic_type operation);
@ -162,16 +159,16 @@ public:
void RegisterAIPlane(const PlaneRec& plane, FGAIPlane* ai, const tower_traffic_type& op, const PatternLeg& lg = LEG_UNKNOWN); void RegisterAIPlane(const PlaneRec& plane, FGAIPlane* ai, const tower_traffic_type& op, const PatternLeg& lg = LEG_UNKNOWN);
// Deregister and remove an AI plane. // Deregister and remove an AI plane.
void DeregisterAIPlane(const string& id); void DeregisterAIPlane(const std::string& id);
// Public interface to the active runway - this will get more complex // Public interface to the active runway - this will get more complex
// in the future and consider multi-runway use, airplane weight etc. // in the future and consider multi-runway use, airplane weight etc.
inline const string& GetActiveRunway() const { return activeRwy; } inline const std::string& GetActiveRunway() const { return activeRwy; }
inline const RunwayDetails& GetActiveRunwayDetails() const { return rwy; } inline const RunwayDetails& GetActiveRunwayDetails() const { return rwy; }
// Get the pattern direction of the active rwy. // Get the pattern direction of the active rwy.
inline int GetPatternDirection() const { return rwy.patternDirection; } inline int GetPatternDirection() const { return rwy.patternDirection; }
inline const string& get_trans_ident() const { return trans_ident; } inline const std::string& get_trans_ident() const { return trans_ident; }
inline FGGround* const GetGroundPtr() const { return ground; } inline FGGround* const GetGroundPtr() const { return ground; }
@ -181,9 +178,9 @@ public:
bool GetDownwindConstraint(double& dpos); bool GetDownwindConstraint(double& dpos);
bool GetBaseConstraint(double& bpos); bool GetBaseConstraint(double& bpos);
string GenText(const string& m, int c); std::string GenText(const std::string& m, int c);
string GetWeather(); std::string GetWeather();
string GetATISID(); std::string GetATISID();
private: private:
FGATCMgr* ATCmgr; FGATCMgr* ATCmgr;
@ -210,10 +207,10 @@ private:
void ClearHoldingPlane(TowerPlaneRec* t); void ClearHoldingPlane(TowerPlaneRec* t);
// Find a pointer to plane of callsign ID within the internal data structures // Find a pointer to plane of callsign ID within the internal data structures
TowerPlaneRec* FindPlane(const string& ID); TowerPlaneRec* FindPlane(const std::string& ID);
// Remove and delete all instances of a plane with a given ID // Remove and delete all instances of a plane with a given ID
void RemovePlane(const string& ID); void RemovePlane(const std::string& ID);
// Figure out if a given position lies on the active runway // Figure out if a given position lies on the active runway
// Might have to change when we consider more than one active rwy. // Might have to change when we consider more than one active rwy.
@ -227,10 +224,10 @@ private:
// For air traffic this is the middle approximation. // For air traffic this is the middle approximation.
void CalcETA(TowerPlaneRec* tpr, bool printout = false); void CalcETA(TowerPlaneRec* tpr, bool printout = false);
// Iterate through all the lists and call CalcETA for all the planes. // Iterate through all the std::lists and call CalcETA for all the planes.
void doThresholdETACalc(); void doThresholdETACalc();
// Order the list of traffic as per expected threshold use and flag any conflicts // Order the std::list of traffic as per expected threshold use and flag any conflicts
bool doThresholdUseOrder(); bool doThresholdUseOrder();
// Calculate the crow-flys distance of a plane to the threshold in meters // Calculate the crow-flys distance of a plane to the threshold in meters
@ -258,7 +255,7 @@ private:
SGPropertyNode_ptr wind_speed_knots; //knots SGPropertyNode_ptr wind_speed_knots; //knots
double aptElev; // Airport elevation double aptElev; // Airport elevation
string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation. std::string activeRwy; // Active runway number - For now we'll disregard multiple / alternate runway operation.
RunwayDetails rwy; // Assumed to be the active one for now. RunwayDetails rwy; // Assumed to be the active one for now.
bool rwyOccupied; // Active runway occupied flag. For now we'll disregard land-and-hold-short operations. bool rwyOccupied; // Active runway occupied flag. For now we'll disregard land-and-hold-short operations.
FGATCAlignedProjection ortho; // Orthogonal mapping of the local area with the active runway threshold at the origin FGATCAlignedProjection ortho; // Orthogonal mapping of the local area with the active runway threshold at the origin
@ -311,9 +308,9 @@ private:
tower_plane_rec_list_iterator vacatedListItr; tower_plane_rec_list_iterator vacatedListItr;
// Returns true if successful // Returns true if successful
bool RemoveFromTrafficList(const string& id); bool RemoveFromTrafficList(const std::string& id);
bool RemoveFromAppList(const string& id); bool RemoveFromAppList(const std::string& id);
bool RemoveFromRwyList(const string& id); bool RemoveFromRwyList(const std::string& id);
// Return the ETA of plane no. list_pos (1-based) in the traffic list. // Return the ETA of plane no. list_pos (1-based) in the traffic list.
// i.e. list_pos = 1 implies next to use runway. // i.e. list_pos = 1 implies next to use runway.
@ -340,7 +337,7 @@ private:
//FGDeparture* _departure; // The relevant departure control (once we've actually written it!) //FGDeparture* _departure; // The relevant departure control (once we've actually written it!)
// for failure modeling // for failure modeling
string trans_ident; // transmitted ident std::string trans_ident; // transmitted ident
bool tower_failed; // tower failed? bool tower_failed; // tower failed?
// Pointers to current users position and orientation // Pointers to current users position and orientation
@ -359,7 +356,7 @@ private:
double nominal_downwind_leg_pos; double nominal_downwind_leg_pos;
double nominal_base_leg_pos; double nominal_base_leg_pos;
friend istream& operator>> ( istream&, FGTower& ); friend std::istream& operator>> ( std::istream&, FGTower& );
}; };
#endif //_FG_TOWER_HXX #endif //_FG_TOWER_HXX

View file

@ -25,6 +25,7 @@
#include "transmission.hxx" #include "transmission.hxx"
#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
@ -60,7 +61,7 @@ TransPar FGTransmission::Parse() {
if ( tkn <= 20 ) { if ( tkn <= 20 ) {
tkn += 1; tkn += 1;
} else { } else {
cout << "Too many tokens" << endl; SG_LOG(SG_ATC, SG_WARN,"Too many tokens");
} }
} }
} }

View file

@ -48,12 +48,6 @@
#include "ATC.hxx" #include "ATC.hxx"
#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
SG_USING_STD(istream);
#endif
SG_USING_STD(string);
struct TransCode { struct TransCode {
int c1; int c1;
int c2; int c2;
@ -62,18 +56,18 @@ struct TransCode {
// TransPar - a representation of the logic of a parsed speech transmission // TransPar - a representation of the logic of a parsed speech transmission
struct TransPar { struct TransPar {
string station; std::string station;
string callsign; std::string callsign;
string airport; std::string airport;
string intention; // landing, crossing std::string intention; // landing, crossing
string intid; // (airport) ID for intention std::string intid; // (airport) ID for intention
bool request; // is the transmission a request or an answer? bool request; // is the transmission a request or an answer?
int tdir; // turning direction: 1=left, 2=right int tdir; // turning direction: 1=left, 2=right
double heading; double heading;
int VDir; // vertical direction: 1=descent, 2=maintain, 3=climb int VDir; // vertical direction: 1=descent, 2=maintain, 3=climb
double alt; double alt;
double miles; double miles;
string runway; std::string runway;
double freq; double freq;
double time; double time;
}; };
@ -84,8 +78,8 @@ class FGTransmission {
//int StationType; // Type of ATC station: 1 Approach //int StationType; // Type of ATC station: 1 Approach
atc_type StationType; atc_type StationType;
TransCode Code; // DCL - no idea what this is. TransCode Code; // DCL - no idea what this is.
string TransText; // The text of the spoken transmission std::string TransText; // The text of the spoken transmission
string MenuText; // An abbreviated version of the text for the menu entry std::string MenuText; // An abbreviated version of the text for the menu entry
public: public:
@ -96,21 +90,21 @@ public:
inline atc_type get_station() const { return StationType; } inline atc_type get_station() const { return StationType; }
inline const TransCode& get_code() { return Code; } inline const TransCode& get_code() { return Code; }
inline const string& get_transtext() { return TransText; } inline const std::string& get_transtext() { return TransText; }
inline const string& get_menutext() { return MenuText; } inline const std::string& get_menutext() { return MenuText; }
// Return the parsed logic of the transmission // Return the parsed logic of the transmission
TransPar Parse(); TransPar Parse();
private: private:
friend istream& operator>> ( istream&, FGTransmission& ); friend std::istream& operator>> ( std::istream&, FGTransmission& );
}; };
inline istream& inline std::istream&
operator >> ( istream& in, FGTransmission& a ) { operator >> ( std::istream& in, FGTransmission& a ) {
char ch; char ch;
int tmp; int tmp;

View file

@ -130,13 +130,13 @@ bool FGTransmissionList::query_station( const atc_type &station, FGTransmission
num_trans += 1; num_trans += 1;
} }
else { else {
cout << "Transmissionlist error: Too many transmissions" << endl; SG_LOG(SG_GENERAL, SG_WARN, "Transmissionlist error: Too many transmissions");
} }
} }
if ( num_trans != 0 ) return true; if ( num_trans != 0 ) return true;
else { else {
cout << "No transmission with station " << station << "found." << endl; SG_LOG(SG_GENERAL, SG_WARN, "No transmission with station " << station << "found.");
string empty; string empty;
return false; return false;
} }
@ -240,7 +240,7 @@ string FGTransmissionList::gen_text(const atc_type &station, const TransCode cod
else if ( strcmp ( tag, "@RW" ) == 0 ) else if ( strcmp ( tag, "@RW" ) == 0 )
strcat( &dum[0], tpars.runway.c_str() ); strcat( &dum[0], tpars.runway.c_str() );
else { else {
cout << "Tag " << tag << " not found" << endl; SG_LOG(SG_GENERAL, SG_WARN, "Tag " << tag << " not found");
break; break;
} }
strcat( &dum[0], &mes[len+3] ); strcat( &dum[0], &mes[len+3] );
@ -248,7 +248,7 @@ string FGTransmissionList::gen_text(const atc_type &station, const TransCode cod
++check; ++check;
if(check > 10) { if(check > 10) {
SG_LOG(SG_ATC, SG_WARN, "WARNING: Possibly endless loop terminated in FGTransmissionlist::gen_text(...)"); SG_LOG(SG_GENERAL, SG_WARN, "WARNING: Possibly endless loop terminated in FGTransmissionlist::gen_text(...)");
break; break;
} }
} }

View file

@ -34,7 +34,7 @@
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
#include <simgear/props/props.hxx> #include <simgear/props/props.hxx>
#include STL_IOSTREAM #include <istream>
#include STL_FSTREAM #include STL_FSTREAM
#include STL_STRING #include STL_STRING

View file

@ -31,15 +31,12 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include STL_IOSTREAM #include <iosfwd>
#include STL_STRING #include STL_STRING
SG_USING_STD(istream);
SG_USING_STD(string);
class FGPanel; class FGPanel;
extern FGPanel * fgReadPanel (istream &input); extern FGPanel * fgReadPanel (std::istream &input);
extern FGPanel * fgReadPanel (const string &relative_path); extern FGPanel * fgReadPanel (const std::string &relative_path);
#endif // __PANEL_IO_HXX #endif // __PANEL_IO_HXX

View file

@ -53,6 +53,8 @@ INCLUDES
#include <stdlib.h> #include <stdlib.h>
#include <math.h> #include <math.h>
#include <iostream>
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@ -62,6 +64,10 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_XMLELEMENT; static const char *IdHdr = ID_XMLELEMENT;
using std::cerr;
using std::cout;
using std::endl;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

View file

@ -39,30 +39,17 @@ INCLUDES
# ifdef SG_HAVE_STD_INCLUDES # ifdef SG_HAVE_STD_INCLUDES
# include <string> # include <string>
# include <vector> # include <vector>
# include <iostream>
# include <map> # include <map>
# else # else
# include <vector.h> # include <vector.h>
# include <string> # include <string>
# include <iostream.h>
# include <map.h> # include <map.h>
# endif # endif
#else #else
# include <string> # include <string>
# include <map> # include <map>
# include <iostream>
# include <vector> # include <vector>
using std::string;
using std::map;
using std::vector;
using std::cout;
using std::endl;
#endif #endif
using std::string;
using std::map;
using std::vector;
using std::cout;
using std::endl;
#include <math/FGColumnVector3.h> #include <math/FGColumnVector3.h>
@ -159,7 +146,7 @@ public:
/** Constructor /** Constructor
@param nm the name of this element (if given) @param nm the name of this element (if given)
*/ */
Element(string nm); Element(std::string nm);
/// Destructor /// Destructor
~Element(void); ~Element(void);
@ -167,23 +154,23 @@ public:
@param key specifies the attribute key to retrieve the value of. @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 @return the key value (as a string), or the empty string if no such
attribute exists. */ attribute exists. */
string GetAttributeValue(string key); std::string GetAttributeValue(std::string key);
/** Retrieves an attribute value as a double precision real number. /** Retrieves an attribute value as a double precision real number.
@param key specifies the attribute key to retrieve the value of. @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 @return the key value (as a number), or the HUGE_VAL if no such
attribute exists. */ attribute exists. */
double GetAttributeValueAsNumber(string key); double GetAttributeValueAsNumber(std::string key);
/** Retrieves the element name. /** Retrieves the element name.
@return the element name, or the empty string if no name has been set.*/ @return the element name, or the empty string if no name has been set.*/
string GetName(void) {return name;} std::string GetName(void) {return name;}
/** Gets a line of data belonging to an element. /** Gets a line of data belonging to an element.
@param i the index of the data line to return (0 by default). @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 @return a string representing the data line requested, or the empty string
if none exists.*/ if none exists.*/
string GetDataLine(unsigned int i=0); std::string GetDataLine(unsigned int i=0);
/// Returns the number of lines of data stored /// Returns the number of lines of data stored
unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();} unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();}
@ -192,7 +179,7 @@ public:
unsigned int GetNumElements(void) {return (unsigned int)children.size();} unsigned int GetNumElements(void) {return (unsigned int)children.size();}
/// Returns the number of named child elements for this element. /// Returns the number of named child elements for this element.
unsigned int GetNumElements(string); unsigned int GetNumElements(std::string);
/** Converts the element data to a number. /** Converts the element data to a number.
This function attempts to convert the first (and presumably only) line of This function attempts to convert the first (and presumably only) line of
@ -225,12 +212,12 @@ public:
Element* GetParent(void) {return parent;} Element* GetParent(void) {return parent;}
/** Searches for a specified element. /** Searches for a specified element.
Finds the first element that matches the supplied string, or simply the first Finds the first element that matches the supplied std::string, or simply the first
element if no search string is supplied. This function call resets the internal element if no search std::string is supplied. This function call resets the internal
element counter to the first element. element counter to the first element.
@param el the search string (empty string by default). @param el the search std::string (empty std::string by default).
@return a pointer to the first element that matches the supplied search string. */ @return a pointer to the first element that matches the supplied search std::string. */
Element* FindElement(string el=""); Element* FindElement(std::string el="");
/** Searches for the next element as specified. /** Searches for the next element as specified.
This function would be called after FindElement() is first called (in order to This function would be called after FindElement() is first called (in order to
@ -241,7 +228,7 @@ public:
@param el the name of the next element to find. @param el the name of the next element to find.
@return the pointer to the found element, or 0 if no appropriate element us @return the pointer to the found element, or 0 if no appropriate element us
found.*/ found.*/
Element* FindNextElement(string el=""); Element* FindNextElement(std::string el="");
/** Searches for the named element and returns the string data belonging to it. /** 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 This function allows the data belonging to a named element to be returned
@ -251,7 +238,7 @@ public:
default) default)
@return the data value for the named element as a string, or the empty @return the data value for the named element as a string, or the empty
string if the element cannot be found. */ string if the element cannot be found. */
string FindElementValue(string el=""); std::string FindElementValue(std::string el="");
/** Searches for the named element and returns the data belonging to it as a number. /** 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 This function allows the data belonging to a named element to be returned
@ -261,7 +248,7 @@ public:
default) default)
@return the data value for the named element as a double, or HUGE_VAL if the @return the data value for the named element as a double, or HUGE_VAL if the
data is missing. */ data is missing. */
double FindElementValueAsNumber(string el=""); double FindElementValueAsNumber(std::string el="");
/** Searches for the named element and converts and returns the data belonging to it. /** 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 This function allows the data belonging to a named element to be returned
@ -278,7 +265,7 @@ public:
to which the value returned will be converted. to which the value returned will be converted.
@return the unit-converted data value for the named element as a double, @return the unit-converted data value for the named element as a double,
or HUGE_VAL if the data is missing. */ or HUGE_VAL if the data is missing. */
double FindElementValueAsNumberConvertTo(string el, string target_units); double FindElementValueAsNumberConvertTo(std::string el, std::string target_units);
/** Searches for the named element and converts and returns the data belonging to it. /** 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 This function allows the data belonging to a named element to be returned
@ -297,9 +284,9 @@ public:
to which the value returned will be converted. to which the value returned will be converted.
@return the unit-converted data value for the named element as a double, @return the unit-converted data value for the named element as a double,
or HUGE_VAL if the data is missing. */ or HUGE_VAL if the data is missing. */
double FindElementValueAsNumberConvertFromTo( string el, double FindElementValueAsNumberConvertFromTo( std::string el,
string supplied_units, std::string supplied_units,
string target_units); std::string target_units);
/** Composes a 3-element column vector for the supplied location or orientation. /** Composes a 3-element column vector for the supplied location or orientation.
This function processes a LOCATION or ORIENTATION construct, returning a This function processes a LOCATION or ORIENTATION construct, returning a
@ -310,7 +297,7 @@ public:
@param target_units the string representing the native units used by JSBSim @param target_units the string representing the native units used by JSBSim
to which the value returned will be converted. to which the value returned will be converted.
@return a column vector object built from the LOCATION or ORIENT components. */ @return a column vector object built from the LOCATION or ORIENT components. */
FGColumnVector3 FindElementTripletConvertTo( string target_units); FGColumnVector3 FindElementTripletConvertTo( std::string target_units);
/** This function sets the value of the parent class attribute to the supplied /** This function sets the value of the parent class attribute to the supplied
Element pointer. Element pointer.
@ -324,11 +311,11 @@ public:
/** Stores an attribute belonging to this element. /** Stores an attribute belonging to this element.
* @param name The string name of the attribute. * @param name The string name of the attribute.
* @param value The string value of the attribute. */ * @param value The string value of the attribute. */
void AddAttribute(string name, string value); void AddAttribute(std::string name, std::string value);
/** Stores data belonging to this element. /** Stores data belonging to this element.
* @param d the data to store. */ * @param d the data to store. */
void AddData(string d); void AddData(std::string d);
/** Prints the element. /** Prints the element.
* Prints this element and calls the Print routine for child elements. * Prints this element and calls the Print routine for child elements.
@ -336,14 +323,14 @@ public:
void Print(unsigned int level=0); void Print(unsigned int level=0);
private: private:
string name; std::string name;
map <string, string> attributes; std::map <std::string, std::string> attributes;
vector <string> data_lines; std::vector <std::string> data_lines;
vector <Element*> children; std::vector <Element*> children;
vector <string> attribute_key; std::vector <std::string> attribute_key;
Element *parent; Element *parent;
unsigned int element_index; unsigned int element_index;
typedef map <string, map <string, double> > tMapConvert; typedef std::map <std::string, std::map <std::string, double> > tMapConvert;
tMapConvert convert; tMapConvert convert;
}; };

View file

@ -35,6 +35,7 @@ SENTRY
INCLUDES INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <fstream>
#include <input_output/FGXMLParse.h> #include <input_output/FGXMLParse.h>
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -58,7 +59,7 @@ protected:
Element* document; Element* document;
Element* LoadXMLDocument(string XML_filename) Element* LoadXMLDocument(string XML_filename)
{ {
ifstream infile; std::ifstream infile;
if ( !XML_filename.empty() ) { if ( !XML_filename.empty() ) {
if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml"; if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";

View file

@ -38,6 +38,7 @@ INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <cstring> #include <cstring>
#include <iostream>
#include "FGfdmSocket.h" #include "FGfdmSocket.h"
@ -46,6 +47,10 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_FDMSOCKET; static const char *IdHdr = ID_FDMSOCKET;
using std::cerr;
using std::cout;
using std::endl;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

View file

@ -43,21 +43,8 @@ INCLUDES
#ifdef FGFS #ifdef FGFS
# include <simgear/compiler.h> # include <simgear/compiler.h>
# include STL_STRING # include STL_STRING
# include STL_IOSTREAM
# include STL_FSTREAM
SG_USING_STD(cout);
SG_USING_STD(endl);
#else #else
# include <string> # 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 #endif
#include <sys/types.h> #include <sys/types.h>

View file

@ -39,12 +39,18 @@ INCLUDES
#include "FGColumnVector3.h" #include "FGColumnVector3.h"
#include <stdio.h> #include <stdio.h>
#include <iostream>
namespace JSBSim { namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_COLUMNVECTOR3; static const char *IdHdr = ID_COLUMNVECTOR3;
using std::ostream;
using std::cerr;
using std::cout;
using std::endl;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

View file

@ -44,14 +44,8 @@ INCLUDES
# include <math.h> # include <math.h>
# include <simgear/compiler.h> # include <simgear/compiler.h>
# include STL_STRING # include STL_STRING
# include <iosfwd>
# include STL_FSTREAM # 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 #else
# include <string> # include <string>
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
@ -66,16 +60,10 @@ INCLUDES
# else # else
# include <cmath> # include <cmath>
# endif # endif
using std::ostream;
using std::istream;
using std::cerr;
using std::cout;
using std::endl;
# if !(defined(_MSC_VER) && _MSC_VER <= 1200) # if !(defined(_MSC_VER) && _MSC_VER <= 1200)
using std::sqrt; using std::sqrt;
# endif # endif
# endif # endif
using std::string;
#endif #endif
#include "FGJSBBase.h" #include "FGJSBBase.h"
@ -174,7 +162,7 @@ public:
/** Prints the contents of the vector /** Prints the contents of the vector
@param delimeter the item separator (tab or comma) @param delimeter the item separator (tab or comma)
@return a string with the delimeter-separated contents of the vector */ @return a string with the delimeter-separated contents of the vector */
string Dump(string delimeter) const; std::string Dump(std::string delimeter) const;
/** Assignment operator. /** Assignment operator.
@param b source vector. @param b source vector.
@ -316,7 +304,7 @@ inline FGColumnVector3 operator*(double scalar, const FGColumnVector3& A) {
@param os Stream to write to. @param os Stream to write to.
@param M Matrix to write. @param M Matrix to write.
Write the matrix to a stream.*/ Write the matrix to a stream.*/
ostream& operator<<(ostream& os, const FGColumnVector3& col); std::ostream& operator<<(std::ostream& os, const FGColumnVector3& col);
} // namespace JSBSim } // namespace JSBSim

View file

@ -34,6 +34,8 @@ COMMENTS, REFERENCES, and NOTES
INCLUDES INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <iostream>
#include "FGCondition.h" #include "FGCondition.h"
namespace JSBSim { namespace JSBSim {
@ -41,6 +43,11 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_CONDITION; static const char *IdHdr = ID_CONDITION;
using std::cerr;
using std::cout;
using std::endl;
using std::vector;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

View file

@ -38,6 +38,8 @@ INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <map> #include <map>
#include <string>
#include <FGJSBBase.h> #include <FGJSBBase.h>
#include <input_output/FGXMLElement.h> #include <input_output/FGXMLElement.h>
#include <input_output/FGPropertyManager.h> #include <input_output/FGPropertyManager.h>
@ -69,7 +71,7 @@ class FGCondition : public FGJSBBase
{ {
public: public:
FGCondition(Element* element, FGPropertyManager* PropertyManager); FGCondition(Element* element, FGPropertyManager* PropertyManager);
FGCondition(string test, FGPropertyManager* PropertyManager); FGCondition(std::string test, FGPropertyManager* PropertyManager);
~FGCondition(void); ~FGCondition(void);
bool Evaluate(void); bool Evaluate(void);
@ -78,18 +80,18 @@ public:
private: private:
enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE}; enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
enum eLogic {elUndef=0, eAND, eOR}; enum eLogic {elUndef=0, eAND, eOR};
map <string, eComparison> mComparison; std::map <std::string, eComparison> mComparison;
eLogic Logic; eLogic Logic;
FGPropertyManager *TestParam1, *TestParam2, *PropertyManager; FGPropertyManager *TestParam1, *TestParam2, *PropertyManager;
double TestValue; double TestValue;
eComparison Comparison; eComparison Comparison;
bool isGroup; bool isGroup;
string conditional; std::string conditional;
static string indent; static std::string indent;
vector <FGCondition> conditions; std::vector <FGCondition> conditions;
void InitializeConditionals(void); void InitializeConditionals(void);
void Debug(int from); void Debug(int from);

View file

@ -29,6 +29,7 @@ INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <stdio.h> #include <stdio.h>
#include <iostream>
#include "FGFunction.h" #include "FGFunction.h"
#include "FGTable.h" #include "FGTable.h"
@ -40,6 +41,9 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_FUNCTION; static const char *IdHdr = ID_FUNCTION;
using std::cerr;
using std::cout;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

View file

@ -180,7 +180,7 @@ public:
void cacheValue(bool shouldCache); void cacheValue(bool shouldCache);
private: private:
vector <FGParameter*> Parameters; std::vector <FGParameter*> Parameters;
FGPropertyManager* const PropertyManager; FGPropertyManager* const PropertyManager;
bool cached; bool cached;
string Prefix; string Prefix;

View file

@ -45,6 +45,9 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_MATRIX33; static const char *IdHdr = ID_MATRIX33;
using std::cout;
using std::endl;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@ -61,7 +64,7 @@ FGMatrix33::FGMatrix33(void)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ostream& operator<<(ostream& os, const FGMatrix33& M) std::ostream& operator<<(std::ostream& os, const FGMatrix33& M)
{ {
for (unsigned int i=1; i<=M.Rows(); i++) { for (unsigned int i=1; i<=M.Rows(); i++) {
for (unsigned int j=1; j<=M.Cols(); j++) { for (unsigned int j=1; j<=M.Cols(); j++) {
@ -76,7 +79,7 @@ ostream& operator<<(ostream& os, const FGMatrix33& M)
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
istream& operator>>(istream& is, FGMatrix33& M) std::istream& operator>>(std::istream& is, FGMatrix33& M)
{ {
for (unsigned int i=1; i<=M.Rows(); i++) { for (unsigned int i=1; i<=M.Rows(); i++) {
for (unsigned int j=1; j<=M.Cols(); j++) { for (unsigned int j=1; j<=M.Cols(); j++) {

View file

@ -45,14 +45,7 @@ INCLUDES
# include <math.h> # include <math.h>
# include <simgear/compiler.h> # include <simgear/compiler.h>
# include STL_STRING # include STL_STRING
# include STL_FSTREAM # include <iosfwd>
# 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 #else
# include <string> # include <string>
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
@ -61,19 +54,13 @@ INCLUDES
# include <math.h> # include <math.h>
# else # else
# include <fstream> # include <fstream>
# include <iostream> # include <iosfwd>
# if defined(sgi) && !defined(__GNUC__) # if defined(sgi) && !defined(__GNUC__)
# include <math.h> # include <math.h>
# else # else
# include <cmath> # include <cmath>
# endif # endif
using std::ostream;
using std::istream;
using std::cerr;
using std::cout;
using std::endl;
# endif # endif
using std::string;
#endif #endif
#include "FGColumnVector3.h" #include "FGColumnVector3.h"
@ -107,7 +94,7 @@ DECLARATION: MatrixException
class MatrixException : public FGJSBBase class MatrixException : public FGJSBBase
{ {
public: public:
string Message; std::string Message;
}; };
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -473,7 +460,7 @@ inline FGMatrix33 operator*(double scalar, const FGMatrix33& A) {
Write the matrix to a stream. Write the matrix to a stream.
*/ */
ostream& operator<<(ostream& os, const FGMatrix33& M); std::ostream& operator<<(std::ostream& os, const FGMatrix33& M);
/** Read matrix from a stream. /** Read matrix from a stream.
@ -482,7 +469,7 @@ ostream& operator<<(ostream& os, const FGMatrix33& M);
Read matrix from a stream. Read matrix from a stream.
*/ */
istream& operator>>(istream& is, FGMatrix33& M); std::istream& operator>>(std::istream& is, FGMatrix33& M);
} // namespace JSBSim } // namespace JSBSim

View file

@ -165,20 +165,20 @@ public:
/** Gets the strings for the current set of coefficients. /** Gets the strings for the current set of coefficients.
@param delimeter either a tab or comma string depending on output type @param delimeter either a tab or comma string depending on output type
@return a string containing the descriptive names for all coefficients */ @return a string containing the descriptive names for all coefficients */
string GetCoefficientStrings(string delimeter); std::string GetCoefficientStrings(std::string delimeter);
/** Gets the coefficient values. /** Gets the coefficient values.
@param delimeter either a tab or comma string depending on output type @param delimeter either a tab or comma string depending on output type
@return a string containing the numeric values for the current set of @return a string containing the numeric values for the current set of
coefficients */ coefficients */
string GetCoefficientValues(string delimeter); std::string GetCoefficientValues(std::string delimeter);
private: private:
typedef map<string,int> AxisIndex; typedef std::map<std::string,int> AxisIndex;
AxisIndex AxisIdx; AxisIndex AxisIdx;
FGFunction* AeroRPShift; FGFunction* AeroRPShift;
vector <FGFunction*> variables; std::vector <FGFunction*> variables;
typedef vector <FGFunction*> CoeffArray; typedef std::vector <FGFunction*> CoeffArray;
CoeffArray* Coeff; CoeffArray* Coeff;
FGColumnVector3 vFs; FGColumnVector3 vFs;
FGColumnVector3 vForces; FGColumnVector3 vForces;

View file

@ -46,6 +46,9 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_GROUNDREACTIONS; static const char *IdHdr = ID_GROUNDREACTIONS;
using std::ostringstream;
using std::setprecision;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@ -139,7 +142,7 @@ bool FGGroundReactions::Load(Element* el)
string FGGroundReactions::GetGroundReactionStrings(string delimeter) string FGGroundReactions::GetGroundReactionStrings(string delimeter)
{ {
std::ostringstream buf; ostringstream buf;
for (unsigned int i=0;i<lGear.size();i++) { for (unsigned int i=0;i<lGear.size();i++) {
if (lGear[i].IsBogey()) { if (lGear[i].IsBogey()) {

View file

@ -42,16 +42,6 @@ INCLUDES
#ifdef FGFS #ifdef FGFS
# include <simgear/compiler.h> # 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 #endif
#include <input_output/FGfdmSocket.h> #include <input_output/FGfdmSocket.h>

View file

@ -38,6 +38,8 @@ HISTORY
INCLUDES INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <algorithm>
#include "FGLGear.h" #include "FGLGear.h"
namespace JSBSim { namespace JSBSim {
@ -650,11 +652,11 @@ void FGLGear::ComputeVerticalStrutForce(void)
} else { } else {
dampForce = -compressSpeed * bDampRebound; dampForce = -compressSpeed * bDampRebound;
} }
vLocalForce(eZ) = min(springForce + dampForce, (double)0.0); vLocalForce(eZ) = std::min(springForce + dampForce, (double)0.0);
// Remember these values for reporting // Remember these values for reporting
MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ))); MaximumStrutForce = std::max(MaximumStrutForce, fabs(vLocalForce(eZ)));
MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength)); MaximumStrutTravel = std::max(MaximumStrutTravel, fabs(compressLength));
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

View file

@ -154,7 +154,7 @@ private:
double Weight; double Weight;
}; };
vector <struct PointMass> PointMasses; std::vector <struct PointMass> PointMasses;
void Debug(int from); void Debug(int from);
}; };

View file

@ -44,17 +44,6 @@ INCLUDES
#ifdef FGFS #ifdef FGFS
# include <simgear/compiler.h> # 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 #endif
#include <string> #include <string>
@ -65,8 +54,6 @@ DEFINITIONS
#define ID_MODEL "$Id$" #define ID_MODEL "$Id$"
using namespace std;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@ -113,7 +100,7 @@ public:
virtual bool Load(Element* el) {return true;} virtual bool Load(Element* el) {return true;}
FGModel* NextModel; FGModel* NextModel;
string Name; std::string Name;
/** Runs the model; called by the Executive /** Runs the model; called by the Executive
@see JSBSim.cpp documentation @see JSBSim.cpp documentation

View file

@ -59,6 +59,8 @@ namespace JSBSim {
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_OUTPUT; static const char *IdHdr = ID_OUTPUT;
using std::setprecision;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/

View file

@ -42,18 +42,18 @@ INCLUDES
#ifdef FGFS #ifdef FGFS
# include <simgear/compiler.h> # include <simgear/compiler.h>
# include STL_IOSTREAM
# include STL_FSTREAM # include STL_FSTREAM
#else #else
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740) # if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
# include <iostream.h>
# include <fstream.h> # include <fstream.h>
# else # else
# include <iostream>
# include <fstream> # include <fstream>
# endif # endif
#endif #endif
#include <string>
#include <vector>
#include <input_output/FGfdmSocket.h> #include <input_output/FGfdmSocket.h>
#include <input_output/FGXMLFileRead.h> #include <input_output/FGXMLFileRead.h>
@ -165,10 +165,10 @@ private:
enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type; enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
bool sFirstPass, dFirstPass, enabled; bool sFirstPass, dFirstPass, enabled;
int SubSystems; int SubSystems;
string output_file_name, delimeter, Filename, DirectivesFile; std::string output_file_name, delimeter, Filename, DirectivesFile;
ofstream datafile; std::ofstream datafile;
FGfdmSocket* socket; FGfdmSocket* socket;
vector <FGPropertyManager*> OutputProperties; std::vector <FGPropertyManager*> OutputProperties;
void Debug(int from); void Debug(int from);
}; };

View file

@ -62,6 +62,7 @@ static const char *IdHdr = ID_PROPULSION;
extern short debug_lvl; extern short debug_lvl;
using std::ifstream;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION CLASS IMPLEMENTATION

View file

@ -153,8 +153,8 @@ public:
be done before calling this (i.e. magnetos, starter engage, etc.) */ be done before calling this (i.e. magnetos, starter engage, etc.) */
bool ICEngineStart(void); bool ICEngineStart(void);
string GetPropulsionStrings(string delimeter); std::string GetPropulsionStrings(std::string delimeter);
string GetPropulsionValues(string delimeter); std::string GetPropulsionValues(std::string delimeter);
inline FGColumnVector3& GetForces(void) {return vForces; } inline FGColumnVector3& GetForces(void) {return vForces; }
inline double GetForces(int n) const { return vForces(n);} inline double GetForces(int n) const { return vForces(n);}
@ -169,8 +169,8 @@ public:
FGColumnVector3& GetTanksMoment(void); FGColumnVector3& GetTanksMoment(void);
double GetTanksWeight(void); double GetTanksWeight(void);
ifstream* FindEngineFile(string filename); std::ifstream* FindEngineFile(std::string filename);
string FindEngineFullPathname(string engine_filename); std::string FindEngineFullPathname(std::string engine_filename);
inline int GetActiveEngine(void) const {return ActiveEngine;} inline int GetActiveEngine(void) const {return ActiveEngine;}
inline bool GetFuelFreeze(void) {return fuel_freeze;} inline bool GetFuelFreeze(void) {return fuel_freeze;}
double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;} double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;}
@ -186,9 +186,9 @@ public:
void unbind(); void unbind();
private: private:
vector <FGEngine*> Engines; std::vector <FGEngine*> Engines;
vector <FGTank*> Tanks; std::vector <FGTank*> Tanks;
vector <FGTank*>::iterator iTank; std::vector <FGTank*>::iterator iTank;
unsigned int numSelectedFuelTanks; unsigned int numSelectedFuelTanks;
unsigned int numSelectedOxiTanks; unsigned int numSelectedOxiTanks;
unsigned int numFuelTanks; unsigned int numFuelTanks;

View file

@ -37,6 +37,8 @@ COMMENTS, REFERENCES, and NOTES
INCLUDES INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <algorithm>
#include "FGActuator.h" #include "FGActuator.h"
namespace JSBSim { namespace JSBSim {
@ -153,9 +155,9 @@ void FGActuator::Hysteresis(void)
double input = Output; double input = Output;
if (input > PreviousHystOutput) { if (input > PreviousHystOutput) {
Output = max(PreviousHystOutput, input-0.5*hysteresis_width); Output = std::max(PreviousHystOutput, input-0.5*hysteresis_width);
} else if (input < PreviousHystOutput) { } else if (input < PreviousHystOutput) {
Output = min(PreviousHystOutput, input+0.5*hysteresis_width); Output = std::min(PreviousHystOutput, input+0.5*hysteresis_width);
} }
PreviousHystOutput = Output; PreviousHystOutput = Output;

View file

@ -53,8 +53,6 @@ DEFINITIONS
#define ID_FCSCOMPONENT "$Id$" #define ID_FCSCOMPONENT "$Id$"
using std::string;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@ -103,8 +101,8 @@ public:
virtual void SetOutput(void); virtual void SetOutput(void);
inline double GetOutput (void) const {return Output;} inline double GetOutput (void) const {return Output;}
inline FGPropertyManager* GetOutputNode(void) { return OutputNode; } inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
inline string GetName(void) const {return Name;} inline std::string GetName(void) const {return Name;}
inline string GetType(void) const { return Type; } inline std::string GetType(void) const { return Type; }
virtual double GetOutputPct(void) const { return 0; } virtual double GetOutputPct(void) const { return 0; }
protected: protected:
@ -114,10 +112,10 @@ protected:
FGPropertyManager* OutputNode; FGPropertyManager* OutputNode;
FGPropertyManager* ClipMinPropertyNode; FGPropertyManager* ClipMinPropertyNode;
FGPropertyManager* ClipMaxPropertyNode; FGPropertyManager* ClipMaxPropertyNode;
vector <FGPropertyManager*> InputNodes; std::vector <FGPropertyManager*> InputNodes;
vector <float> InputSigns; std::vector <float> InputSigns;
string Type; std::string Type;
string Name; std::string Name;
double Input; double Input;
double Output; double Output;
double clipmax, clipmin; double clipmax, clipmin;

View file

@ -250,7 +250,7 @@ bool FGEngine::LoadThruster(Element *thruster_element)
double P_Factor = 0, Sense = 0.0; double P_Factor = 0, Sense = 0.0;
string enginePath = FDMExec->GetEnginePath(); string enginePath = FDMExec->GetEnginePath();
string aircraftPath = FDMExec->GetFullAircraftPath(); string aircraftPath = FDMExec->GetFullAircraftPath();
ifstream thruster_file; std::ifstream thruster_file;
FGColumnVector3 location, orientation; FGColumnVector3 location, orientation;
string separator = "/"; string separator = "/";

View file

@ -27,11 +27,6 @@
#include <math.h> #include <math.h>
#include STL_IOSTREAM
#include STL_FSTREAM
SG_USING_STD(ofstream);
class FGNewEngine { class FGNewEngine {
private: private:

View file

@ -144,17 +144,12 @@
#include <FDM/LaRCsim/ls_types.h> #include <FDM/LaRCsim/ls_types.h>
#include <map> #include <map>
#include STL_IOSTREAM #include <fstream>
#include <cmath> #include <cmath>
#include "uiuc_parsefile.h" #include "uiuc_parsefile.h"
#include "uiuc_flapdata.h" #include "uiuc_flapdata.h"
SG_USING_STD(map);
SG_USING_STD(iostream);
SG_USING_STD(ofstream);
typedef stack :: iterator LIST; typedef stack :: iterator LIST;
/* Add more keywords here if required*/ /* Add more keywords here if required*/
@ -635,7 +630,7 @@ struct AIRCRAFT
#define recordParts aircraft_->recordParts #define recordParts aircraft_->recordParts
/*= Keywords (token1) ===========================================*/ /*= Keywords (token1) ===========================================*/
map <string,int> Keyword_map; std::map <string,int> Keyword_map;
#define Keyword_map aircraft_->Keyword_map #define Keyword_map aircraft_->Keyword_map
double CD, CX, CL, CZ, Cm, CY, Cl, Cn; double CD, CX, CL, CZ, Cm, CY, Cl, Cn;
@ -670,7 +665,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* init ========== Initial values for equations of motion =======*/ /* init ========== Initial values for equations of motion =======*/
map <string,int> init_map; std::map <string,int> init_map;
#define init_map aircraft_->init_map #define init_map aircraft_->init_map
int recordRate; int recordRate;
@ -777,7 +772,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* geometry ====== Aircraft-specific geometric quantities =======*/ /* geometry ====== Aircraft-specific geometric quantities =======*/
map <string,int> geometry_map; std::map <string,int> geometry_map;
#define geometry_map aircraft_->geometry_map #define geometry_map aircraft_->geometry_map
double bw, cbar, Sw, ih, bh, chord_h, Sh; double bw, cbar, Sw, ih, bh, chord_h, Sh;
@ -793,7 +788,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* controlSurface Control surface deflections and properties ===*/ /* controlSurface Control surface deflections and properties ===*/
map <string,int> controlSurface_map; std::map <string,int> controlSurface_map;
#define controlSurface_map aircraft_->controlSurface_map #define controlSurface_map aircraft_->controlSurface_map
double demax, demin; double demax, demin;
@ -980,7 +975,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* controlsMixer = Control mixer ================================*/ /* controlsMixer = Control mixer ================================*/
map <string,int> controlsMixer_map; std::map <string,int> controlsMixer_map;
#define controlsMixer_map aircraft_->controlsMixer_map #define controlsMixer_map aircraft_->controlsMixer_map
double nomix; double nomix;
@ -990,7 +985,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* mass =========== Aircraft-specific mass properties ===========*/ /* mass =========== Aircraft-specific mass properties ===========*/
map <string,int> mass_map; std::map <string,int> mass_map;
#define mass_map aircraft_->mass_map #define mass_map aircraft_->mass_map
double Weight; double Weight;
@ -1016,7 +1011,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* engine ======== Propulsion data ==============================*/ /* engine ======== Propulsion data ==============================*/
map <string,int> engine_map; std::map <string,int> engine_map;
#define engine_map aircraft_->engine_map #define engine_map aircraft_->engine_map
double simpleSingleMaxThrust; double simpleSingleMaxThrust;
@ -1158,7 +1153,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* CD ============ Aerodynamic x-force quantities (longitudinal) */ /* CD ============ Aerodynamic x-force quantities (longitudinal) */
map <string,int> CD_map; std::map <string,int> CD_map;
#define CD_map aircraft_->CD_map #define CD_map aircraft_->CD_map
double CDo, CDK, CLK, CD_a, CD_adot, CD_q, CD_ih, CD_de, CD_dr, CD_da, CD_beta; double CDo, CDK, CLK, CD_a, CD_adot, CD_q, CD_ih, CD_de, CD_dr, CD_da, CD_beta;
@ -1358,7 +1353,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* CL ============ Aerodynamic z-force quantities (longitudinal) */ /* CL ============ Aerodynamic z-force quantities (longitudinal) */
map <string,int> CL_map; std::map <string,int> CL_map;
#define CL_map aircraft_->CL_map #define CL_map aircraft_->CL_map
double CLo, CL_a, CL_adot, CL_q, CL_ih, CL_de; double CLo, CL_a, CL_adot, CL_q, CL_ih, CL_de;
@ -1545,7 +1540,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* Cm ============ Aerodynamic m-moment quantities (longitudinal) */ /* Cm ============ Aerodynamic m-moment quantities (longitudinal) */
map <string,int> Cm_map; std::map <string,int> Cm_map;
#define Cm_map aircraft_->Cm_map #define Cm_map aircraft_->Cm_map
double Cmo, Cm_a, Cm_a2, Cm_adot, Cm_q; double Cmo, Cm_a, Cm_a2, Cm_adot, Cm_q;
@ -1709,7 +1704,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* CY ============ Aerodynamic y-force quantities (lateral) =====*/ /* CY ============ Aerodynamic y-force quantities (lateral) =====*/
map <string,int> CY_map; std::map <string,int> CY_map;
#define CY_map aircraft_->CY_map #define CY_map aircraft_->CY_map
double CYo, CY_beta, CY_p, CY_r, CY_da, CY_dr, CY_dra, CY_bdot; double CYo, CY_beta, CY_p, CY_r, CY_da, CY_dr, CY_dra, CY_bdot;
@ -1884,7 +1879,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* Cl ============ Aerodynamic l-moment quantities (lateral) ====*/ /* Cl ============ Aerodynamic l-moment quantities (lateral) ====*/
map <string,int> Cl_map; std::map <string,int> Cl_map;
#define Cl_map aircraft_->Cl_map #define Cl_map aircraft_->Cl_map
double Clo, Cl_beta, Cl_p, Cl_r, Cl_da, Cl_dr, Cl_daa; double Clo, Cl_beta, Cl_p, Cl_r, Cl_da, Cl_dr, Cl_daa;
@ -2057,7 +2052,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* Cn ============ Aerodynamic n-moment quantities (lateral) ====*/ /* Cn ============ Aerodynamic n-moment quantities (lateral) ====*/
map <string,int> Cn_map; std::map <string,int> Cn_map;
#define Cn_map aircraft_->Cn_map #define Cn_map aircraft_->Cn_map
double Cno, Cn_beta, Cn_p, Cn_r, Cn_da, Cn_dr, Cn_q, Cn_b3; double Cno, Cn_beta, Cn_p, Cn_r, Cn_da, Cn_dr, Cn_q, Cn_b3;
@ -2232,7 +2227,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* gear ========== Landing gear model quantities ================*/ /* gear ========== Landing gear model quantities ================*/
map <string,int> gear_map; std::map <string,int> gear_map;
#define gear_map aircraft_->gear_map #define gear_map aircraft_->gear_map
#define MAX_GEAR 16 #define MAX_GEAR 16
@ -2258,7 +2253,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* ice =========== Ice model quantities ======================== */ /* ice =========== Ice model quantities ======================== */
map <string,int> ice_map; std::map <string,int> ice_map;
#define ice_map aircraft_->ice_map #define ice_map aircraft_->ice_map
bool ice_model, ice_on, beta_model; bool ice_model, ice_on, beta_model;
@ -2793,7 +2788,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* fog =========== Fog field quantities ======================== */ /* fog =========== Fog field quantities ======================== */
map <string,int> fog_map; std::map <string,int> fog_map;
#define fog_map aircraft_->fog_map #define fog_map aircraft_->fog_map
bool fog_field; bool fog_field;
@ -2821,7 +2816,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* record ======== Record desired quantites to file =============*/ /* record ======== Record desired quantites to file =============*/
map <string,int> record_map; std::map <string,int> record_map;
#define record_map aircraft_->record_map #define record_map aircraft_->record_map
/***** Angles ******/ /***** Angles ******/
@ -2899,7 +2894,7 @@ struct AIRCRAFT
/* Variables (token2) ===========================================*/ /* Variables (token2) ===========================================*/
/* misc ========== Miscellaneous input commands =================*/ /* misc ========== Miscellaneous input commands =================*/
map <string,int> misc_map; std::map <string,int> misc_map;
#define misc_map aircraft_->misc_map #define misc_map aircraft_->misc_map
double simpleHingeMomentCoef; double simpleHingeMomentCoef;
@ -3036,7 +3031,7 @@ struct AIRCRAFT
#define Cn_iced aircraft_->Cn_iced #define Cn_iced aircraft_->Cn_iced
#define Ch_iced aircraft_->Ch_iced #define Ch_iced aircraft_->Ch_iced
ofstream fout; std::ofstream fout;
#define fout aircraft_->fout #define fout aircraft_->fout

View file

@ -72,8 +72,6 @@
#include "uiuc_engine.h" #include "uiuc_engine.h"
SG_USING_STD(cerr);
void uiuc_engine() void uiuc_engine()
{ {
stack command_list; stack command_list;

View file

@ -6,17 +6,12 @@
#include <simgear/compiler.h> #include <simgear/compiler.h>
#include <string> #include <string>
#include STL_IOSTREAM
//#include STL_STRSTREAM
#include <sstream>
//SG_USING_STD(istrstream);
void d_2_to_3( double array2D[100][100], double array3D[][100][100], int index3D); void d_2_to_3( double array2D[100][100], double array3D[][100][100], int index3D);
void d_1_to_2( double array1D[100], double array2D[][100], int index2D); void d_1_to_2( double array1D[100], double array2D[][100], int index2D);
void d_1_to_1( double array1[100], double array2[100] ); void d_1_to_1( double array1[100], double array2[100] );
void i_1_to_2( int array1D[100], int array2D[][100], int index2D); void i_1_to_2( int array1D[100], int array2D[][100], int index2D);
bool check_float( const string &token); bool check_float( const std::string &token);
//bool check_float( const string &token); //bool check_float( const string &token);
#endif //_MENU_FUNCTIONS_H_ #endif //_MENU_FUNCTIONS_H_

View file

@ -74,6 +74,8 @@ Prints to screen the follow:
**********************************************************************/ **********************************************************************/
#include <iostream>
#include "uiuc_warnings_errors.h" #include "uiuc_warnings_errors.h"
SG_USING_STD (cerr); SG_USING_STD (cerr);
@ -83,7 +85,7 @@ SG_USING_STD (endl);
SG_USING_STD (exit); SG_USING_STD (exit);
#endif #endif
void uiuc_warnings_errors(int errorCode, string line) void uiuc_warnings_errors(int errorCode, std::string line)
{ {
switch (errorCode) switch (errorCode)
{ {

View file

@ -5,10 +5,7 @@
#include <string> #include <string>
#include <cstdlib> #include <cstdlib>
#include STL_IOSTREAM
SG_USING_STD(string); void uiuc_warnings_errors(int errorCode, std::string line);
void uiuc_warnings_errors(int errorCode, string line);
#endif //_WARNINGS_ERRORS_H_ #endif //_WARNINGS_ERRORS_H_

View file

@ -1,7 +1,7 @@
#ifndef _ROTORPART_HPP #ifndef _ROTORPART_HPP
#define _ROTORPART_HPP #define _ROTORPART_HPP
#include <sstream> #include <iosfwd>
#include <iostream>
namespace yasim { namespace yasim {
class Rotor; class Rotor;
class Rotorpart class Rotorpart

View file

@ -462,7 +462,7 @@ SGPropertyNode *fgInitLocale(const char *language) {
// Initialize the localization routines // Initialize the localization routines
bool fgDetectLanguage() { bool fgDetectLanguage() {
char *language = ::getenv("LANG"); const char *language = ::getenv("LANG");
if (language == NULL) { if (language == NULL) {
SG_LOG(SG_GENERAL, SG_INFO, "Unable to detect the language" ); SG_LOG(SG_GENERAL, SG_INFO, "Unable to detect the language" );

View file

@ -14,7 +14,7 @@
# include <config.h> # include <config.h>
#endif #endif
#include <ostream> #include <iosfwd>
#include <vector> #include <vector>
#include <simgear/compiler.h> #include <simgear/compiler.h>
@ -23,10 +23,6 @@
#include <simgear/structure/subsystem_mgr.hxx> #include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/props/props.hxx> #include <simgear/props/props.hxx>
SG_USING_STD(ostream);
SG_USING_STD(vector);
/** /**
* Log any property values to any number of CSV files. * Log any property values to any number of CSV files.
*/ */

View file

@ -40,10 +40,7 @@
# include <istream.h> # include <istream.h>
#endif #endif
SG_USING_STD(istream);
#include STL_STRING #include STL_STRING
SG_USING_STD(string);
// SG_USING_STD(cout); // SG_USING_STD(cout);
// SG_USING_STD(endl); // SG_USING_STD(endl);
@ -51,7 +48,7 @@ SG_USING_STD(string);
class FGFix { class FGFix {
string ident; std::string ident;
double lon, lat; double lon, lat;
public: public:
@ -59,11 +56,11 @@ public:
inline FGFix(void); inline FGFix(void);
inline ~FGFix(void) {} inline ~FGFix(void) {}
inline const string& get_ident() const { return ident; } inline const std::string& get_ident() const { return ident; }
inline double get_lon() const { return lon; } inline double get_lon() const { return lon; }
inline double get_lat() const { return lat; } inline double get_lat() const { return lat; }
friend istream& operator>> ( istream&, FGFix& ); friend std::istream& operator>> ( std::istream&, FGFix& );
}; };
@ -76,8 +73,8 @@ FGFix::FGFix()
} }
inline istream& inline std::istream&
operator >> ( istream& in, FGFix& f ) operator >> ( std::istream& in, FGFix& f )
{ {
in >> f.lat; in >> f.lat;

View file

@ -43,9 +43,6 @@
# include <istream.h> # include <istream.h>
#endif #endif
SG_USING_STD(istream);
#define FG_NAV_DEFAULT_RANGE 50 // nm #define FG_NAV_DEFAULT_RANGE 50 // nm
#define FG_LOC_DEFAULT_RANGE 18 // nm #define FG_LOC_DEFAULT_RANGE 18 // nm
#define FG_DME_DEFAULT_RANGE 50 // nm #define FG_DME_DEFAULT_RANGE 50 // nm
@ -105,7 +102,7 @@ public:
inline bool get_serviceable() const { return serviceable; } inline bool get_serviceable() const { return serviceable; }
inline const char *get_trans_ident() const { return trans_ident.c_str(); } inline const char *get_trans_ident() const { return trans_ident.c_str(); }
friend istream& operator>> ( istream&, FGNavRecord& ); friend std::istream& operator>> ( std::istream&, FGNavRecord& );
}; };
@ -136,8 +133,8 @@ inline fg_nav_types FGNavRecord::get_fg_type() const {
} }
inline istream& inline std::istream&
operator >> ( istream& in, FGNavRecord& n ) operator >> ( std::istream& in, FGNavRecord& n )
{ {
in >> n.type; in >> n.type;
@ -209,7 +206,7 @@ public:
inline const string& get_channel() const { return channel; } inline const string& get_channel() const { return channel; }
inline int get_freq() const { return freq; } inline int get_freq() const { return freq; }
friend istream& operator>> ( istream&, FGTACANRecord& ); friend std::istream& operator>> ( std::istream&, FGTACANRecord& );
}; };
@ -221,8 +218,8 @@ FGTACANRecord::FGTACANRecord(void) :
{ {
} }
inline istream& inline std::istream&
operator >> ( istream& in, FGTACANRecord& n ) operator >> ( std::istream& in, FGTACANRecord& n )
{ {
in >> n.channel >> n.freq ; in >> n.channel >> n.freq ;
//getline( in, n.name ); //getline( in, n.name );