#if defined( SG_HAVE_STD_INCLUDES ) || defined( __BORLANDC__ ) || (__APPLE__)
# include <fstream>
-# include <iostream>
#else
# include <fstream.h>
-# include <iostream.h>
#endif
#include <map>
SG_USING_STD(list);
SG_USING_STD(string);
-SG_USING_STD(cout);
-SG_USING_STD(ios);
-SG_USING_STD(ofstream);
-SG_USING_STD(ifstream);
-
struct WordData {
unsigned int offset; // Offset of beginning of word sample into raw sound 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::const_iterator atc_word_map_const_iterator;
// Load the two voice files - one containing the raw sound data (.wav) and one containing the word positions (.vce).
// 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.
// Sets dataOK = true if the returned buffer is valid.
# include <config.h>
#endif
+#include <iostream>
+
#include "approach.hxx"
#include "transmission.hxx"
#include "transmissionlist.hxx"
#include <GUI/gui.h>
+using std::cout;
+using std::endl;
+
//Constructor
FGApproach::FGApproach(){
comm1_node = fgGetNode("/instrumentation/comm[0]/frequencies/selected-mhz", true);
#include <Main/fg_props.hxx>
#ifdef SG_HAVE_STD_INCLUDES
-# include <istream>
-#include <iomanip>
+# include <iosfwd>
#elif defined( SG_HAVE_NATIVE_SGI_COMPILERS )
# include <iostream.h>
#elif defined( __BORLANDC__ )
# include <iostream>
#else
# include <istream.h>
-#include <iomanip.h>
#endif
-#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
-SG_USING_STD(istream);
-#endif
-
-SG_USING_STD(string);
-
#include "ATC.hxx"
#include "transmission.hxx"
struct PlaneApp {
// 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 lat; // latitude in degrees
double alt; // Altitute above sea level in feet
int bucket;
- string active_runway;
+ std::string active_runway;
double active_rw_hdg;
double active_rw_lon;
double active_rw_lat;
int num_planes; // number of planes on the stack
PlaneApp planes[max_planes]; // Array of planes
- string transmission;
+ std::string transmission;
bool first;
SGPropertyNode_ptr comm1_node;
SGPropertyNode_ptr atcopt9_node;
// for failure modeling
- string trans_ident; // transmitted ident
+ std::string trans_ident; // transmitted ident
bool approach_failed; // approach failed?
public:
// Add new plane to stack if not already registered
// Input: pid - id of plane (name)
// 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
int RemovePlane();
inline double get_bucket() const { return bucket; }
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:
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
//Update the transmission string
void UpdateTransmission(void);
- friend istream& operator>> ( istream&, FGApproach& );
+ friend std::istream& operator>> ( std::istream&, FGApproach& );
};
#endif // _FG_APPROACH_HXX
#include <simgear/timing/sg_time.hxx>
#ifdef SG_HAVE_STD_INCLUDES
-# include <istream>
-# include <iomanip>
+# include <iosfwd>
#elif defined( __BORLANDC__ ) || (__APPLE__)
# include <iostream>
#else
# include <istream.h>
-# include <iomanip.h>
#endif
-SG_USING_STD(istream);
-SG_USING_STD(string);
-
#include "ATC.hxx"
//DCL - a complete guess for now.
class FGATIS : public FGATC {
//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
// from the prevailing conditions when required.
// for failure modeling
- string trans_ident; // transmitted ident
+ std::string trans_ident; // transmitted ident
bool atis_failed; // atis failed?
// Aircraft position
void Update(double dt);
//inline void set_type(const atc_type tp) {type = tp;}
- inline const string& get_trans_ident() { return trans_ident; }
- inline void set_refname(const string& r) { refname = r; }
+ inline const std::string& get_trans_ident() { return trans_ident; }
+ inline void set_refname(const std::string& r) { refname = r; }
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
void UpdateTransmission(void);
- friend istream& operator>> ( istream&, FGATIS& );
+ friend std::istream& operator>> ( std::istream&, FGATIS& );
};
#endif // _FG_ATIS_HXX
#include "ATC.hxx"
#include "ATCProjection.hxx"
-#include STL_IOSTREAM
#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 FGATCMgr;
struct arc : public ground_network_element {
int distance;
- string name;
+ std::string name;
arc_type type;
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
// 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::const_iterator arc_array_const_iterator;
unsigned int nodeID; //each node in an airport needs a unique ID number - this is ZERO-BASED to match array position
Point3D pos;
Point3D orthoPos;
- string name;
+ std::string name;
node_type type;
arc_array_type arcs;
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::const_iterator node_array_const_iterator;
int max_weight; //units??
//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
- string name; // The real-world gate letter/number
+ std::string name; // The real-world gate letter/number
//node* pNode;
bool used;
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::const_iterator gate_vec_const_iterator;
// 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::const_iterator gate_map_const_iterator;
// 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::const_iterator runway_array_const_iterator;
// Structures to use 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::const_iterator ground_network_path_const_iterator;
};
// 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;
// Nodes mapped by their ID
// 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::const_iterator ground_rec_list_const_itr;
Point3D end2ortho; // ortho projection end2 (the take off end in the current hardwired scheme)
double hdg; // true runway heading
double length; // In *METERS*
- string rwyID;
+ std::string rwyID;
};
///////////////////////////////////////////////////////////////////////////////
public:
FGGround();
- FGGround(const string& id);
+ FGGround(const std::string& id);
~FGGround();
void Init();
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
//void NewArrival(plane_rec plane);
Gate* GetGateNode();
// 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.
// 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
- node_array_type GetExits(const string& rwyID);
+ node_array_type GetExits(const std::string& rwyID);
// Get a path from one node to another
ground_network_path_type GetPath(node* A, node* B);
// 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
// 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:
FGATCMgr* ATCmgr;
SGPropertyNode_ptr wind_speed_knots; //knots
// for failure modeling
- string trans_ident; // transmitted ident
+ std::string trans_ident; // transmitted ident
bool ground_failed; // ground failed?
bool networkLoadOK; // Indicates whether LoadNetwork returned true or false at last attempt
// Physical runway details
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.
// For now we'll just be simple and do one active runway - eventually this will get much more complex
// Return a pointer to the node at a runway threshold
// 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!)
ground_network_path_type GetShortestPath(node* A, node* B);
#include <simgear/misc/sgstream.hxx>
#include <plib/sg.h>
-#include STL_IOSTREAM
+#include <iosfwd>
#include STL_STRING
-SG_USING_STD(string);
-SG_USING_STD(ios);
-
#include "ATC.hxx"
#include "ATCProjection.hxx"
#include "AIPlane.hxx"
};
-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::const_iterator tower_plane_rec_list_const_iterator;
// Contact tower for VFR approach
// 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.
- 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...
void VFRArrivalContact(const PlaneRec& plane, FGAIPlane* requestee, const LandingType& lt = AIP_LT_UNKNOWN);
- void RequestDepartureClearance(const string& ID);
- void RequestTakeOffClearance(const string& ID);
- void ReportFinal(const string& ID);
- void ReportLongFinal(const string& ID);
- void ReportOuterMarker(const string& ID);
- void ReportMiddleMarker(const string& ID);
- void ReportInnerMarker(const string& ID);
- void ReportRunwayVacated(const string& ID);
- void ReportReadyForDeparture(const string& ID);
- void ReportDownwind(const string& ID);
- void ReportGoingAround(const string& ID);
+ void RequestDepartureClearance(const std::string& ID);
+ void RequestTakeOffClearance(const std::string& ID);
+ void ReportFinal(const std::string& ID);
+ void ReportLongFinal(const std::string& ID);
+ void ReportOuterMarker(const std::string& ID);
+ void ReportMiddleMarker(const std::string& ID);
+ void ReportInnerMarker(const std::string& ID);
+ void ReportRunwayVacated(const std::string& ID);
+ void ReportReadyForDeparture(const std::string& ID);
+ void ReportDownwind(const std::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?
void ContactAtHoldShort(const PlaneRec& plane, FGAIPlane* requestee, tower_traffic_type operation);
void RegisterAIPlane(const PlaneRec& plane, FGAIPlane* ai, const tower_traffic_type& op, const PatternLeg& lg = LEG_UNKNOWN);
// 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
// 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; }
// Get the pattern direction of the active rwy.
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; }
bool GetDownwindConstraint(double& dpos);
bool GetBaseConstraint(double& bpos);
- string GenText(const string& m, int c);
- string GetWeather();
- string GetATISID();
+ std::string GenText(const std::string& m, int c);
+ std::string GetWeather();
+ std::string GetATISID();
private:
FGATCMgr* ATCmgr;
void ClearHoldingPlane(TowerPlaneRec* t);
// 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
- void RemovePlane(const string& ID);
+ void RemovePlane(const std::string& ID);
// Figure out if a given position lies on the active runway
// Might have to change when we consider more than one active rwy.
// For air traffic this is the middle approximation.
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();
- // 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();
// Calculate the crow-flys distance of a plane to the threshold in meters
SGPropertyNode_ptr wind_speed_knots; //knots
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.
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
tower_plane_rec_list_iterator vacatedListItr;
// Returns true if successful
- bool RemoveFromTrafficList(const string& id);
- bool RemoveFromAppList(const string& id);
- bool RemoveFromRwyList(const string& id);
+ bool RemoveFromTrafficList(const std::string& id);
+ bool RemoveFromAppList(const std::string& id);
+ bool RemoveFromRwyList(const std::string& id);
// Return the ETA of plane no. list_pos (1-based) in the traffic list.
// i.e. list_pos = 1 implies next to use runway.
//FGDeparture* _departure; // The relevant departure control (once we've actually written it!)
// for failure modeling
- string trans_ident; // transmitted ident
+ std::string trans_ident; // transmitted ident
bool tower_failed; // tower failed?
// Pointers to current users position and orientation
double nominal_downwind_leg_pos;
double nominal_base_leg_pos;
- friend istream& operator>> ( istream&, FGTower& );
+ friend std::istream& operator>> ( std::istream&, FGTower& );
};
#endif //_FG_TOWER_HXX
#include "transmission.hxx"
+#include <simgear/debug/logstream.hxx>
#include <simgear/misc/sg_path.hxx>
if ( tkn <= 20 ) {
tkn += 1;
} else {
- cout << "Too many tokens" << endl;
+ SG_LOG(SG_ATC, SG_WARN,"Too many tokens");
}
}
}
#include "ATC.hxx"
-#if ! defined( SG_HAVE_NATIVE_SGI_COMPILERS )
-SG_USING_STD(istream);
-#endif
-
-SG_USING_STD(string);
-
struct TransCode {
int c1;
int c2;
// TransPar - a representation of the logic of a parsed speech transmission
struct TransPar {
- string station;
- string callsign;
- string airport;
- string intention; // landing, crossing
- string intid; // (airport) ID for intention
+ std::string station;
+ std::string callsign;
+ std::string airport;
+ std::string intention; // landing, crossing
+ std::string intid; // (airport) ID for intention
bool request; // is the transmission a request or an answer?
int tdir; // turning direction: 1=left, 2=right
double heading;
int VDir; // vertical direction: 1=descent, 2=maintain, 3=climb
double alt;
double miles;
- string runway;
+ std::string runway;
double freq;
double time;
};
//int StationType; // Type of ATC station: 1 Approach
atc_type StationType;
TransCode Code; // DCL - no idea what this is.
- string TransText; // The text of the spoken transmission
- string MenuText; // An abbreviated version of the text for the menu entry
+ std::string TransText; // The text of the spoken transmission
+ std::string MenuText; // An abbreviated version of the text for the menu entry
public:
inline atc_type get_station() const { return StationType; }
inline const TransCode& get_code() { return Code; }
- inline const string& get_transtext() { return TransText; }
- inline const string& get_menutext() { return MenuText; }
+ inline const std::string& get_transtext() { return TransText; }
+ inline const std::string& get_menutext() { return MenuText; }
// Return the parsed logic of the transmission
TransPar Parse();
private:
- friend istream& operator>> ( istream&, FGTransmission& );
+ friend std::istream& operator>> ( std::istream&, FGTransmission& );
};
-inline istream&
-operator >> ( istream& in, FGTransmission& a ) {
+inline std::istream&
+operator >> ( std::istream& in, FGTransmission& a ) {
char ch;
int tmp;
num_trans += 1;
}
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;
else {
- cout << "No transmission with station " << station << "found." << endl;
+ SG_LOG(SG_GENERAL, SG_WARN, "No transmission with station " << station << "found.");
string empty;
return false;
}
else if ( strcmp ( tag, "@RW" ) == 0 )
strcat( &dum[0], tpars.runway.c_str() );
else {
- cout << "Tag " << tag << " not found" << endl;
+ SG_LOG(SG_GENERAL, SG_WARN, "Tag " << tag << " not found");
break;
}
strcat( &dum[0], &mes[len+3] );
++check;
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;
}
}
#include <simgear/misc/sg_path.hxx>
#include <simgear/props/props.hxx>
-#include STL_IOSTREAM
+#include <istream>
#include STL_FSTREAM
#include STL_STRING
#include <simgear/compiler.h>
-#include STL_IOSTREAM
+#include <iosfwd>
#include STL_STRING
-SG_USING_STD(istream);
-SG_USING_STD(string);
-
class FGPanel;
-extern FGPanel * fgReadPanel (istream &input);
-extern FGPanel * fgReadPanel (const string &relative_path);
+extern FGPanel * fgReadPanel (std::istream &input);
+extern FGPanel * fgReadPanel (const std::string &relative_path);
#endif // __PANEL_IO_HXX
#include <stdlib.h>
#include <math.h>
+#include <iostream>
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_XMLELEMENT;
+using std::cerr;
+using std::cout;
+using std::endl;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
# ifdef SG_HAVE_STD_INCLUDES
# include <string>
# include <vector>
-# include <iostream>
# include <map>
# else
# include <vector.h>
# include <string>
-# include <iostream.h>
# include <map.h>
# endif
#else
# include <string>
# include <map>
-# include <iostream>
# include <vector>
- using std::string;
- using std::map;
- using std::vector;
- using std::cout;
- using std::endl;
#endif
- using std::string;
- using std::map;
- using std::vector;
- using std::cout;
- using std::endl;
#include <math/FGColumnVector3.h>
/** Constructor
@param nm the name of this element (if given)
*/
- Element(string nm);
+ Element(std::string nm);
/// Destructor
~Element(void);
@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. */
- string GetAttributeValue(string key);
+ std::string GetAttributeValue(std::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(string key);
+ double GetAttributeValueAsNumber(std::string key);
/** Retrieves the element name.
@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.
@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.*/
- string GetDataLine(unsigned int i=0);
+ std::string GetDataLine(unsigned int i=0);
/// Returns the number of lines of data stored
unsigned int GetNumDataLines(void) {return (unsigned int)data_lines.size();}
unsigned int GetNumElements(void) {return (unsigned int)children.size();}
/// 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.
This function attempts to convert the first (and presumably only) line of
Element* GetParent(void) {return parent;}
/** Searches for a specified element.
- 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
+ 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
element counter to the first element.
- @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="");
+ @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="");
/** Searches for the next element as specified.
This function would be called after FindElement() is first called (in order to
@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(string el="");
+ Element* FindNextElement(std::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
default)
@return the data value for the named element as a string, or the empty
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.
This function allows the data belonging to a named element to be returned
default)
@return the data value for the named element as a double, or HUGE_VAL if the
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.
This function allows the data belonging to a named element to be returned
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(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.
This function allows the data belonging to a named element to be returned
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( string el,
- string supplied_units,
- string target_units);
+ double FindElementValueAsNumberConvertFromTo( std::string el,
+ std::string supplied_units,
+ std::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
@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( string target_units);
+ FGColumnVector3 FindElementTripletConvertTo( std::string target_units);
/** This function sets the value of the parent class attribute to the supplied
Element pointer.
/** 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(string name, string value);
+ void AddAttribute(std::string name, std::string value);
/** Stores data belonging to this element.
* @param d the data to store. */
- void AddData(string d);
+ void AddData(std::string d);
/** Prints the element.
* Prints this element and calls the Print routine for child elements.
void Print(unsigned int level=0);
private:
- string name;
- map <string, string> attributes;
- vector <string> data_lines;
- vector <Element*> children;
- vector <string> attribute_key;
+ std::string name;
+ std::map <std::string, std::string> attributes;
+ std::vector <std::string> data_lines;
+ std::vector <Element*> children;
+ std::vector <std::string> attribute_key;
Element *parent;
unsigned int element_index;
- typedef map <string, map <string, double> > tMapConvert;
+ typedef std::map <std::string, std::map <std::string, double> > tMapConvert;
tMapConvert convert;
};
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include <fstream>
#include <input_output/FGXMLParse.h>
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Element* document;
Element* LoadXMLDocument(string XML_filename)
{
- ifstream infile;
+ std::ifstream infile;
if ( !XML_filename.empty() ) {
if (XML_filename.find(".xml") == string::npos) XML_filename += ".xml";
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <cstring>
+#include <iostream>
#include "FGfdmSocket.h"
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_FDMSOCKET;
+using std::cerr;
+using std::cout;
+using std::endl;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifdef FGFS
# include <simgear/compiler.h>
# include STL_STRING
-# include STL_IOSTREAM
-# include STL_FSTREAM
- SG_USING_STD(cout);
- SG_USING_STD(endl);
#else
# include <string>
-# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
-# include <iostream.h>
-# include <fstream.h>
-# else
-# include <iostream>
-# include <fstream>
- using std::cout;
- using std::endl;
-# endif
#endif
#include <sys/types.h>
#include "FGColumnVector3.h"
#include <stdio.h>
+#include <iostream>
namespace JSBSim {
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_COLUMNVECTOR3;
+using std::ostream;
+using std::cerr;
+using std::cout;
+using std::endl;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
# include <math.h>
# include <simgear/compiler.h>
# include STL_STRING
+# include <iosfwd>
# include STL_FSTREAM
-# include STL_IOSTREAM
- SG_USING_STD(string);
- SG_USING_STD(ostream);
- SG_USING_STD(istream);
- SG_USING_STD(cerr);
- SG_USING_STD(cout);
- SG_USING_STD(endl);
#else
# include <string>
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
# else
# include <cmath>
# endif
- using std::ostream;
- using std::istream;
- using std::cerr;
- using std::cout;
- using std::endl;
# if !(defined(_MSC_VER) && _MSC_VER <= 1200)
using std::sqrt;
# endif
# endif
- using std::string;
#endif
#include "FGJSBBase.h"
/** 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 */
- string Dump(string delimeter) const;
+ std::string Dump(std::string delimeter) const;
/** Assignment operator.
@param b source vector.
@param os Stream to write to.
@param M Matrix to write.
Write the matrix to a stream.*/
-ostream& operator<<(ostream& os, const FGColumnVector3& col);
+std::ostream& operator<<(std::ostream& os, const FGColumnVector3& col);
} // namespace JSBSim
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include <iostream>
+
#include "FGCondition.h"
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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <map>
+#include <string>
+
#include <FGJSBBase.h>
#include <input_output/FGXMLElement.h>
#include <input_output/FGPropertyManager.h>
{
public:
FGCondition(Element* element, FGPropertyManager* PropertyManager);
- FGCondition(string test, FGPropertyManager* PropertyManager);
+ FGCondition(std::string test, FGPropertyManager* PropertyManager);
~FGCondition(void);
bool Evaluate(void);
private:
enum eComparison {ecUndef=0, eEQ, eNE, eGT, eGE, eLT, eLE};
enum eLogic {elUndef=0, eAND, eOR};
- map <string, eComparison> mComparison;
+ std::map <std::string, eComparison> mComparison;
eLogic Logic;
FGPropertyManager *TestParam1, *TestParam2, *PropertyManager;
double TestValue;
eComparison Comparison;
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 Debug(int from);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include <stdio.h>
+#include <iostream>
#include "FGFunction.h"
#include "FGTable.h"
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_FUNCTION;
+using std::cerr;
+using std::cout;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
void cacheValue(bool shouldCache);
private:
- vector <FGParameter*> Parameters;
+ std::vector <FGParameter*> Parameters;
FGPropertyManager* const PropertyManager;
bool cached;
string Prefix;
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_MATRIX33;
+using std::cout;
+using std::endl;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-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 j=1; j<=M.Cols(); j++) {
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-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 j=1; j<=M.Cols(); j++) {
# include <math.h>
# include <simgear/compiler.h>
# include STL_STRING
-# 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);
+# include <iosfwd>
#else
# include <string>
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
# include <math.h>
# else
# include <fstream>
-# include <iostream>
+# include <iosfwd>
# if defined(sgi) && !defined(__GNUC__)
# include <math.h>
# else
# include <cmath>
# endif
- using std::ostream;
- using std::istream;
- using std::cerr;
- using std::cout;
- using std::endl;
# endif
- using std::string;
#endif
#include "FGColumnVector3.h"
class MatrixException : public FGJSBBase
{
public:
- string Message;
+ std::string Message;
};
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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.
*/
-istream& operator>>(istream& is, FGMatrix33& M);
+std::istream& operator>>(std::istream& is, FGMatrix33& M);
} // namespace JSBSim
/** 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 */
- string GetCoefficientStrings(string delimeter);
+ std::string GetCoefficientStrings(std::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 */
- string GetCoefficientValues(string delimeter);
+ std::string GetCoefficientValues(std::string delimeter);
private:
- typedef map<string,int> AxisIndex;
+ typedef std::map<std::string,int> AxisIndex;
AxisIndex AxisIdx;
FGFunction* AeroRPShift;
- vector <FGFunction*> variables;
- typedef vector <FGFunction*> CoeffArray;
+ std::vector <FGFunction*> variables;
+ typedef std::vector <FGFunction*> CoeffArray;
CoeffArray* Coeff;
FGColumnVector3 vFs;
FGColumnVector3 vForces;
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_GROUNDREACTIONS;
+using std::ostringstream;
+using std::setprecision;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
string FGGroundReactions::GetGroundReactionStrings(string delimeter)
{
- std::ostringstream buf;
+ ostringstream buf;
for (unsigned int i=0;i<lGear.size();i++) {
if (lGear[i].IsBogey()) {
#ifdef FGFS
# include <simgear/compiler.h>
-# include STL_IOSTREAM
-# include STL_FSTREAM
-#else
-# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
-# include <iostream.h>
-# include <fstream.h>
-# else
-# include <iostream>
-# include <fstream>
-# endif
#endif
#include <input_output/FGfdmSocket.h>
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include <algorithm>
+
#include "FGLGear.h"
namespace JSBSim {
} else {
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
- MaximumStrutForce = max(MaximumStrutForce, fabs(vLocalForce(eZ)));
- MaximumStrutTravel = max(MaximumStrutTravel, fabs(compressLength));
+ MaximumStrutForce = std::max(MaximumStrutForce, fabs(vLocalForce(eZ)));
+ MaximumStrutTravel = std::max(MaximumStrutTravel, fabs(compressLength));
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
double Weight;
};
- vector <struct PointMass> PointMasses;
+ std::vector <struct PointMass> PointMasses;
void Debug(int from);
};
#ifdef FGFS
# include <simgear/compiler.h>
-# ifdef SG_HAVE_STD_INCLUDES
-# include <iostream>
-# else
-# include <iostream.h>
-# endif
-#else
-# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
-# include <iostream.h>
-# else
-# include <iostream>
-# endif
#endif
#include <string>
#define ID_MODEL "$Id$"
-using namespace std;
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
virtual bool Load(Element* el) {return true;}
FGModel* NextModel;
- string Name;
+ std::string Name;
/** Runs the model; called by the Executive
@see JSBSim.cpp documentation
static const char *IdSrc = "$Id$";
static const char *IdHdr = ID_OUTPUT;
+using std::setprecision;
+
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifdef FGFS
# include <simgear/compiler.h>
-# include STL_IOSTREAM
# include STL_FSTREAM
#else
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
-# include <iostream.h>
# include <fstream.h>
# else
-# include <iostream>
# include <fstream>
# endif
#endif
+#include <string>
+#include <vector>
+
#include <input_output/FGfdmSocket.h>
#include <input_output/FGXMLFileRead.h>
enum {otNone, otCSV, otTab, otSocket, otTerminal, otUnknown} Type;
bool sFirstPass, dFirstPass, enabled;
int SubSystems;
- string output_file_name, delimeter, Filename, DirectivesFile;
- ofstream datafile;
+ std::string output_file_name, delimeter, Filename, DirectivesFile;
+ std::ofstream datafile;
FGfdmSocket* socket;
- vector <FGPropertyManager*> OutputProperties;
+ std::vector <FGPropertyManager*> OutputProperties;
void Debug(int from);
};
extern short debug_lvl;
+using std::ifstream;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS IMPLEMENTATION
be done before calling this (i.e. magnetos, starter engage, etc.) */
bool ICEngineStart(void);
- string GetPropulsionStrings(string delimeter);
- string GetPropulsionValues(string delimeter);
+ std::string GetPropulsionStrings(std::string delimeter);
+ std::string GetPropulsionValues(std::string delimeter);
inline FGColumnVector3& GetForces(void) {return vForces; }
inline double GetForces(int n) const { return vForces(n);}
FGColumnVector3& GetTanksMoment(void);
double GetTanksWeight(void);
- ifstream* FindEngineFile(string filename);
- string FindEngineFullPathname(string engine_filename);
+ std::ifstream* FindEngineFile(std::string filename);
+ std::string FindEngineFullPathname(std::string engine_filename);
inline int GetActiveEngine(void) const {return ActiveEngine;}
inline bool GetFuelFreeze(void) {return fuel_freeze;}
double GetTotalFuelQuantity(void) const {return TotalFuelQuantity;}
void unbind();
private:
- vector <FGEngine*> Engines;
- vector <FGTank*> Tanks;
- vector <FGTank*>::iterator iTank;
+ std::vector <FGEngine*> Engines;
+ std::vector <FGTank*> Tanks;
+ std::vector <FGTank*>::iterator iTank;
unsigned int numSelectedFuelTanks;
unsigned int numSelectedOxiTanks;
unsigned int numFuelTanks;
INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+#include <algorithm>
+
#include "FGActuator.h"
namespace JSBSim {
double input = Output;
if (input > PreviousHystOutput) {
- Output = max(PreviousHystOutput, input-0.5*hysteresis_width);
+ Output = std::max(PreviousHystOutput, input-0.5*hysteresis_width);
} else if (input < PreviousHystOutput) {
- Output = min(PreviousHystOutput, input+0.5*hysteresis_width);
+ Output = std::min(PreviousHystOutput, input+0.5*hysteresis_width);
}
PreviousHystOutput = Output;
#define ID_FCSCOMPONENT "$Id$"
-using std::string;
-
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
virtual void SetOutput(void);
inline double GetOutput (void) const {return Output;}
inline FGPropertyManager* GetOutputNode(void) { return OutputNode; }
- inline string GetName(void) const {return Name;}
- inline string GetType(void) const { return Type; }
+ inline std::string GetName(void) const {return Name;}
+ inline std::string GetType(void) const { return Type; }
virtual double GetOutputPct(void) const { return 0; }
protected:
FGPropertyManager* OutputNode;
FGPropertyManager* ClipMinPropertyNode;
FGPropertyManager* ClipMaxPropertyNode;
- vector <FGPropertyManager*> InputNodes;
- vector <float> InputSigns;
- string Type;
- string Name;
+ std::vector <FGPropertyManager*> InputNodes;
+ std::vector <float> InputSigns;
+ std::string Type;
+ std::string Name;
double Input;
double Output;
double clipmax, clipmin;
double P_Factor = 0, Sense = 0.0;
string enginePath = FDMExec->GetEnginePath();
string aircraftPath = FDMExec->GetFullAircraftPath();
- ifstream thruster_file;
+ std::ifstream thruster_file;
FGColumnVector3 location, orientation;
string separator = "/";
#include <math.h>
-#include STL_IOSTREAM
-#include STL_FSTREAM
-
-SG_USING_STD(ofstream);
-
class FGNewEngine {
private:
#include <FDM/LaRCsim/ls_types.h>
#include <map>
-#include STL_IOSTREAM
+#include <fstream>
#include <cmath>
#include "uiuc_parsefile.h"
#include "uiuc_flapdata.h"
-SG_USING_STD(map);
-SG_USING_STD(iostream);
-SG_USING_STD(ofstream);
-
-
typedef stack :: iterator LIST;
/* Add more keywords here if required*/
#define recordParts aircraft_->recordParts
/*= Keywords (token1) ===========================================*/
- map <string,int> Keyword_map;
+ std::map <string,int> Keyword_map;
#define Keyword_map aircraft_->Keyword_map
double CD, CX, CL, CZ, Cm, CY, Cl, Cn;
/* Variables (token2) ===========================================*/
/* init ========== Initial values for equations of motion =======*/
- map <string,int> init_map;
+ std::map <string,int> init_map;
#define init_map aircraft_->init_map
int recordRate;
/* Variables (token2) ===========================================*/
/* geometry ====== Aircraft-specific geometric quantities =======*/
- map <string,int> geometry_map;
+ std::map <string,int> geometry_map;
#define geometry_map aircraft_->geometry_map
double bw, cbar, Sw, ih, bh, chord_h, Sh;
/* Variables (token2) ===========================================*/
/* controlSurface Control surface deflections and properties ===*/
- map <string,int> controlSurface_map;
+ std::map <string,int> controlSurface_map;
#define controlSurface_map aircraft_->controlSurface_map
double demax, demin;
/* Variables (token2) ===========================================*/
/* controlsMixer = Control mixer ================================*/
- map <string,int> controlsMixer_map;
+ std::map <string,int> controlsMixer_map;
#define controlsMixer_map aircraft_->controlsMixer_map
double nomix;
/* Variables (token2) ===========================================*/
/* mass =========== Aircraft-specific mass properties ===========*/
- map <string,int> mass_map;
+ std::map <string,int> mass_map;
#define mass_map aircraft_->mass_map
double Weight;
/* Variables (token2) ===========================================*/
/* engine ======== Propulsion data ==============================*/
- map <string,int> engine_map;
+ std::map <string,int> engine_map;
#define engine_map aircraft_->engine_map
double simpleSingleMaxThrust;
/* Variables (token2) ===========================================*/
/* CD ============ Aerodynamic x-force quantities (longitudinal) */
- map <string,int> CD_map;
+ std::map <string,int> 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;
/* Variables (token2) ===========================================*/
/* CL ============ Aerodynamic z-force quantities (longitudinal) */
- map <string,int> CL_map;
+ std::map <string,int> CL_map;
#define CL_map aircraft_->CL_map
double CLo, CL_a, CL_adot, CL_q, CL_ih, CL_de;
/* Variables (token2) ===========================================*/
/* Cm ============ Aerodynamic m-moment quantities (longitudinal) */
- map <string,int> Cm_map;
+ std::map <string,int> Cm_map;
#define Cm_map aircraft_->Cm_map
double Cmo, Cm_a, Cm_a2, Cm_adot, Cm_q;
/* Variables (token2) ===========================================*/
/* CY ============ Aerodynamic y-force quantities (lateral) =====*/
- map <string,int> CY_map;
+ std::map <string,int> CY_map;
#define CY_map aircraft_->CY_map
double CYo, CY_beta, CY_p, CY_r, CY_da, CY_dr, CY_dra, CY_bdot;
/* Variables (token2) ===========================================*/
/* Cl ============ Aerodynamic l-moment quantities (lateral) ====*/
- map <string,int> Cl_map;
+ std::map <string,int> Cl_map;
#define Cl_map aircraft_->Cl_map
double Clo, Cl_beta, Cl_p, Cl_r, Cl_da, Cl_dr, Cl_daa;
/* Variables (token2) ===========================================*/
/* Cn ============ Aerodynamic n-moment quantities (lateral) ====*/
- map <string,int> Cn_map;
+ std::map <string,int> Cn_map;
#define Cn_map aircraft_->Cn_map
double Cno, Cn_beta, Cn_p, Cn_r, Cn_da, Cn_dr, Cn_q, Cn_b3;
/* Variables (token2) ===========================================*/
/* gear ========== Landing gear model quantities ================*/
- map <string,int> gear_map;
+ std::map <string,int> gear_map;
#define gear_map aircraft_->gear_map
#define MAX_GEAR 16
/* Variables (token2) ===========================================*/
/* ice =========== Ice model quantities ======================== */
- map <string,int> ice_map;
+ std::map <string,int> ice_map;
#define ice_map aircraft_->ice_map
bool ice_model, ice_on, beta_model;
/* Variables (token2) ===========================================*/
/* fog =========== Fog field quantities ======================== */
- map <string,int> fog_map;
+ std::map <string,int> fog_map;
#define fog_map aircraft_->fog_map
bool fog_field;
/* Variables (token2) ===========================================*/
/* record ======== Record desired quantites to file =============*/
- map <string,int> record_map;
+ std::map <string,int> record_map;
#define record_map aircraft_->record_map
/***** Angles ******/
/* Variables (token2) ===========================================*/
/* misc ========== Miscellaneous input commands =================*/
- map <string,int> misc_map;
+ std::map <string,int> misc_map;
#define misc_map aircraft_->misc_map
double simpleHingeMomentCoef;
#define Cn_iced aircraft_->Cn_iced
#define Ch_iced aircraft_->Ch_iced
- ofstream fout;
+ std::ofstream fout;
#define fout aircraft_->fout
#include "uiuc_engine.h"
-SG_USING_STD(cerr);
-
void uiuc_engine()
{
stack command_list;
#include <simgear/compiler.h>
#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_1_to_2( double array1D[100], double array2D[][100], int index2D);
void d_1_to_1( double array1[100], double array2[100] );
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);
#endif //_MENU_FUNCTIONS_H_
**********************************************************************/
+#include <iostream>
+
#include "uiuc_warnings_errors.h"
SG_USING_STD (cerr);
SG_USING_STD (exit);
#endif
-void uiuc_warnings_errors(int errorCode, string line)
+void uiuc_warnings_errors(int errorCode, std::string line)
{
switch (errorCode)
{
#include <string>
#include <cstdlib>
-#include STL_IOSTREAM
-SG_USING_STD(string);
-
-void uiuc_warnings_errors(int errorCode, string line);
+void uiuc_warnings_errors(int errorCode, std::string line);
#endif //_WARNINGS_ERRORS_H_
#ifndef _ROTORPART_HPP
#define _ROTORPART_HPP
-#include <sstream>
-#include <iostream>
+#include <iosfwd>
+
namespace yasim {
class Rotor;
class Rotorpart
// Initialize the localization routines
bool fgDetectLanguage() {
- char *language = ::getenv("LANG");
+ const char *language = ::getenv("LANG");
if (language == NULL) {
SG_LOG(SG_GENERAL, SG_INFO, "Unable to detect the language" );
# include <config.h>
#endif
-#include <ostream>
+#include <iosfwd>
#include <vector>
#include <simgear/compiler.h>
#include <simgear/structure/subsystem_mgr.hxx>
#include <simgear/props/props.hxx>
-SG_USING_STD(ostream);
-SG_USING_STD(vector);
-
-
/**
* Log any property values to any number of CSV files.
*/
# include <istream.h>
#endif
-SG_USING_STD(istream);
-
#include STL_STRING
-SG_USING_STD(string);
// SG_USING_STD(cout);
// SG_USING_STD(endl);
class FGFix {
- string ident;
+ std::string ident;
double lon, lat;
public:
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_lat() const { return lat; }
- friend istream& operator>> ( istream&, FGFix& );
+ friend std::istream& operator>> ( std::istream&, FGFix& );
};
}
-inline istream&
-operator >> ( istream& in, FGFix& f )
+inline std::istream&
+operator >> ( std::istream& in, FGFix& f )
{
in >> f.lat;
# include <istream.h>
#endif
-SG_USING_STD(istream);
-
-
#define FG_NAV_DEFAULT_RANGE 50 // nm
#define FG_LOC_DEFAULT_RANGE 18 // nm
#define FG_DME_DEFAULT_RANGE 50 // nm
inline bool get_serviceable() const { return serviceable; }
inline const char *get_trans_ident() const { return trans_ident.c_str(); }
- friend istream& operator>> ( istream&, FGNavRecord& );
+ friend std::istream& operator>> ( std::istream&, FGNavRecord& );
};
}
-inline istream&
-operator >> ( istream& in, FGNavRecord& n )
+inline std::istream&
+operator >> ( std::istream& in, FGNavRecord& n )
{
in >> n.type;
inline const string& get_channel() const { return channel; }
inline int get_freq() const { return freq; }
- friend istream& operator>> ( istream&, FGTACANRecord& );
+ friend std::istream& operator>> ( std::istream&, FGTACANRecord& );
};
{
}
-inline istream&
-operator >> ( istream& in, FGTACANRecord& n )
+inline std::istream&
+operator >> ( std::istream& in, FGTACANRecord& n )
{
in >> n.channel >> n.freq ;
//getline( in, n.name );