1
0
Fork 0

Include <iostream> and using declarations as needed.

SimGear no longer includes iostream and avoids using declarations in
header files, so various fixups are needed.
This commit is contained in:
timoore 2008-06-02 21:07:35 +00:00
parent eb2a167331
commit a251fd35cb
17 changed files with 111 additions and 80 deletions

View file

@ -28,7 +28,9 @@
#include <simgear/math/sg_geodesy.hxx> #include <simgear/math/sg_geodesy.hxx>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include STL_IOSTREAM #include <istream>
#include <ostream>
#include STL_STRING #include STL_STRING
#include "ATCVoice.hxx" #include "ATCVoice.hxx"
@ -52,7 +54,7 @@ enum plane_type {
// This might move or change eventually // This might move or change eventually
struct PlaneRec { struct PlaneRec {
plane_type type; plane_type type;
string callsign; std::string callsign;
int squawkcode; int squawkcode;
}; };
@ -82,8 +84,8 @@ struct ATCData {
unsigned short int freq; unsigned short int freq;
//int range; //int range;
unsigned short int range; unsigned short int range;
string ident; std::string ident;
string name; std::string name;
}; };
// perhaps we could use an FGRunway instead of this. // perhaps we could use an FGRunway instead of this.
@ -95,11 +97,11 @@ struct RunwayDetails {
double hdg; // true runway heading double hdg; // true runway heading
double length; // In *METERS* double length; // In *METERS*
double width; // ditto double width; // ditto
string rwyID; std::string rwyID;
int patternDirection; // -1 for left, 1 for right int patternDirection; // -1 for left, 1 for right
}; };
ostream& operator << (ostream& os, atc_type atc); std::ostream& operator << (std::ostream& os, atc_type atc);
class FGATC { class FGATC {
@ -117,7 +119,7 @@ public:
virtual void ReceiveUserCallback(int code); virtual void ReceiveUserCallback(int code);
// Add plane to a stack // Add plane to a stack
virtual void AddPlane(const string& pid); virtual void AddPlane(const std::string& pid);
// Remove plane from stack // Remove plane from stack
virtual int RemovePlane(); virtual int RemovePlane();
@ -129,16 +131,16 @@ public:
inline void SetNoDisplay() { _display = false; } inline void SetNoDisplay() { _display = false; }
// Generate the text of a message from its parameters and the current context. // Generate the text of a message from its parameters and the current context.
virtual string GenText(const string& m, int c); virtual std::string GenText(const std::string& m, int c);
// Returns true if OK to transmit on this frequency // Returns true if OK to transmit on this frequency
inline bool GetFreqClear() { return freqClear; } inline bool GetFreqClear() { return freqClear; }
// Indicate that the frequency is in use // Indicate that the frequency is in use
inline void SetFreqInUse() { freqClear = false; receiving = true; } inline void SetFreqInUse() { freqClear = false; receiving = true; }
// Transmission to the ATC is finished and a response is required // Transmission to the ATC is finished and a response is required
void SetResponseReqd(const string& rid); void SetResponseReqd(const std::string& rid);
// Transmission finished - let ATC decide if a response is reqd and clear freq if necessary // Transmission finished - let ATC decide if a response is reqd and clear freq if necessary
void NotifyTransmissionFinished(const string& rid); void NotifyTransmissionFinished(const std::string& rid);
// Transmission finished and no response required // Transmission finished and no response required
inline void ReleaseFreq() { freqClear = true; receiving = false; } // TODO - check that the plane releasing the freq is the right one etc. inline void ReleaseFreq() { freqClear = true; receiving = false; } // TODO - check that the plane releasing the freq is the right one etc.
// The above 3 funcs under development!! // The above 3 funcs under development!!
@ -169,10 +171,10 @@ public:
inline void set_freq(const int fq) {freq = fq;} inline void set_freq(const int fq) {freq = fq;}
inline int get_range() const { return range; } inline int get_range() const { return range; }
inline void set_range(const int rg) {range = rg;} inline void set_range(const int rg) {range = rg;}
inline const string& get_ident() { return ident; } inline const std::string& get_ident() { return ident; }
inline void set_ident(const string& id) { ident = id; } inline void set_ident(const std::string& id) { ident = id; }
inline const string& get_name() { return name; } inline const std::string& get_name() { return name; }
inline void set_name(const string& nm) { name = nm; } inline void set_name(const std::string& nm) { name = nm; }
protected: protected:
@ -180,11 +182,11 @@ protected:
// Outputs the transmission either on screen or as audio depending on user preference // Outputs the transmission either on screen or as audio depending on user preference
// The refname is a string to identify this sample to the sound manager // The refname is a string to identify this sample to the sound manager
// The repeating flag indicates whether the message should be repeated continuously or played once. // The repeating flag indicates whether the message should be repeated continuously or played once.
void Render(string& msg, const string& refname = "", bool repeating = false); void Render(std::string& msg, const std::string& refname = "", bool repeating = false);
// Cease rendering all transmission from this station. // Cease rendering all transmission from this station.
// Requires the sound manager refname if audio, else "". // Requires the sound manager refname if audio, else "".
void NoRender(const string& refname); void NoRender(const std::string& refname);
// Transmit a message when channel becomes free of other dialog // Transmit a message when channel becomes free of other dialog
void Transmit(int callback_code = 0); void Transmit(int callback_code = 0);
@ -201,8 +203,8 @@ protected:
double x, y, z; double x, y, z;
int freq; int freq;
int range; int range;
string ident; // Code of the airport its at. std::string ident; // Code of the airport its at.
string name; // Name transmitted in the broadcast. std::string name; // Name transmitted in the broadcast.
atc_type _type; atc_type _type;
// Rendering related stuff // Rendering related stuff
@ -211,7 +213,7 @@ protected:
bool _voiceOK; // Flag - true if at least one voice has loaded OK bool _voiceOK; // Flag - true if at least one voice has loaded OK
FGATCVoice* _vPtr; FGATCVoice* _vPtr;
string pending_transmission; // derived classes set this string before calling Transmit(...) std::string pending_transmission; // derived classes set this string before calling Transmit(...)
bool freqClear; // Flag to indicate if the frequency is clear of ongoing dialog bool freqClear; // Flag to indicate if the frequency is clear of ongoing dialog
bool receiving; // Flag to indicate we are receiving a transmission bool receiving; // Flag to indicate we are receiving a transmission
bool responseReqd; // Flag to indicate we should be responding to a request/report bool responseReqd; // Flag to indicate we should be responding to a request/report
@ -219,7 +221,7 @@ protected:
double responseTime; // Time to take from end of request transmission to beginning of response double responseTime; // Time to take from end of request transmission to beginning of response
// The idea is that this will be slightly random. // The idea is that this will be slightly random.
double responseCounter; // counter to implement the above double responseCounter; // counter to implement the above
string responseID; // ID of the plane to respond to std::string responseID; // ID of the plane to respond to
bool respond; // Flag to indicate now is the time to respond - ie set following the count down of the response timer. bool respond; // Flag to indicate now is the time to respond - ie set following the count down of the response timer.
// Derived classes only need monitor this flag, and use the response ID, as long as they call FGATC::Update(...) // Derived classes only need monitor this flag, and use the response ID, as long as they call FGATC::Update(...)
bool _runReleaseCounter; // A timer for releasing the frequency after giving the message enough time to display bool _runReleaseCounter; // A timer for releasing the frequency after giving the message enough time to display
@ -241,8 +243,8 @@ private:
double _max_count; double _max_count;
}; };
inline istream& inline std::istream&
operator >> ( istream& fin, ATCData& a ) operator >> ( std::istream& fin, ATCData& a )
{ {
double f; double f;
char ch; char ch;
@ -280,14 +282,14 @@ operator >> ( istream& fin, ATCData& a )
if(ch != '"') a.name += ch; if(ch != '"') a.name += ch;
while(1) { while(1) {
//in >> noskipws //in >> noskipws
fin.unsetf(ios::skipws); fin.unsetf(std::ios::skipws);
fin >> ch; fin >> ch;
if((ch == '"') || (ch == 0x0A)) { if((ch == '"') || (ch == 0x0A)) {
break; break;
} // we shouldn't need the 0x0A but it makes a nice safely in case someone leaves off the " } // we shouldn't need the 0x0A but it makes a nice safely in case someone leaves off the "
a.name += ch; a.name += ch;
} }
fin.setf(ios::skipws); fin.setf(std::ios::skipws);
//cout << "Comm name = " << a.name << '\n'; //cout << "Comm name = " << a.name << '\n';
a.freq = (int)(f*100.0 + 0.5); a.freq = (int)(f*100.0 + 0.5);

View file

@ -24,6 +24,8 @@
# include <config.h> # include <config.h>
#endif #endif
#include <iostream>
#include <simgear/structure/exception.hxx> #include <simgear/structure/exception.hxx>
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
#include <simgear/sg_inlines.h> #include <simgear/sg_inlines.h>
@ -34,6 +36,8 @@
#include "xmlauto.hxx" #include "xmlauto.hxx"
using std::cout;
using std::endl;
FGPIDController::FGPIDController( SGPropertyNode *node ): FGPIDController::FGPIDController( SGPropertyNode *node ):
debug( false ), debug( false ),

View file

@ -32,6 +32,7 @@
#endif #endif
#include <stdio.h> // FILE*, fopen(), fread(), fwrite(), et. al. #include <stdio.h> // FILE*, fopen(), fread(), fwrite(), et. al.
#include <iostream> // for cout, endl
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/io/lowlevel.hxx> // endian tests #include <simgear/io/lowlevel.hxx> // endian tests
@ -44,6 +45,8 @@
#include "ExternalPipe.hxx" #include "ExternalPipe.hxx"
using std::cout;
using std::endl;
static const int MAX_BUF = 32768; static const int MAX_BUF = 32768;

View file

@ -38,8 +38,12 @@ INCLUDES
#include <string> #include <string>
#ifdef FGFS #ifdef FGFS
# include <simgear/props/props.hxx> # include <simgear/props/props.hxx>
# include <simgear/debug/logstream.hxx>
# define JSBDEBUG sglog() << loglevel(SG_FLIGHT, SG_ALERT)
#else #else
# include <iostream>
# include "simgear/props/props.hxx" # include "simgear/props/props.hxx"
# define JSBDEBUG std::cout
#endif #endif
#include "FGJSBBase.h" #include "FGJSBBase.h"
@ -54,9 +58,10 @@ DEFINITIONS
FORWARD DECLARATIONS FORWARD DECLARATIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
using namespace std;
namespace JSBSim { namespace JSBSim {
// Yuck - shouldn't be using in header files
using std::string;
using std::endl;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DOCUMENTATION CLASS DOCUMENTATION
@ -513,9 +518,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
Tie (const string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true) Tie (const string &name, V (*getter)(), void (*setter)(V) = 0, bool useDefault = true)
{ {
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault)) if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter), useDefault))
cout << "Failed to tie property " << name << " to functions" << endl; JSBDEBUG << "Failed to tie property " << name << " to functions" << endl;
else if (debug_lvl & 0x20) else if (debug_lvl & 0x20)
cout << name << endl; JSBDEBUG << name << endl;
} }
@ -541,9 +546,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
void (*setter)(int, V) = 0, bool useDefault = true) void (*setter)(int, V) = 0, bool useDefault = true)
{ {
if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault)) if (!tie(name.c_str(), SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
cout << "Failed to tie property " << name << " to indexed functions" << endl; JSBDEBUG << "Failed to tie property " << name << " to indexed functions" << endl;
else if (debug_lvl & 0x20) else if (debug_lvl & 0x20)
cout << name << endl; JSBDEBUG << name << endl;
} }
@ -571,9 +576,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
void (T::*setter)(V) = 0, bool useDefault = true) void (T::*setter)(V) = 0, bool useDefault = true)
{ {
if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault)) if (!tie(name.c_str(), SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
cout << "Failed to tie property " << name << " to object methods" << endl; JSBDEBUG << "Failed to tie property " << name << " to object methods" << endl;
else if (debug_lvl & 0x20) else if (debug_lvl & 0x20)
cout << name << endl; JSBDEBUG << name << endl;
} }
/** /**
@ -600,9 +605,9 @@ class FGPropertyManager : public SGPropertyNode, public FGJSBBase
void (T::*setter)(int, V) = 0, bool useDefault = true) void (T::*setter)(int, V) = 0, bool useDefault = true)
{ {
if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault)) if (!tie(name.c_str(), SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
cout << "Failed to tie property " << name << " to indexed object methods" << endl; JSBDEBUG << "Failed to tie property " << name << " to indexed object methods" << endl;
else if (debug_lvl & 0x20) else if (debug_lvl & 0x20)
cout << name << endl; JSBDEBUG << name << endl;
} }
}; };
} }

View file

@ -1,3 +1,5 @@
#include <ostream>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include "Math.hpp" #include "Math.hpp"
@ -6,6 +8,8 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
namespace yasim { namespace yasim {
using std::endl;
const float pi=3.14159; const float pi=3.14159;
float _help = 0; float _help = 0;
Rotorpart::Rotorpart() Rotorpart::Rotorpart()

View file

@ -57,5 +57,5 @@ int main(int argc, char** argv)
int pw=0, ph=0; int pw=0, ph=0;
w.calcPrefSize(&pw, &ph); w.calcPrefSize(&pw, &ph);
w.layout(0, 0, pw, ph); w.layout(0, 0, pw, ph);
writeProperties(cout, &props, true); writeProperties(std::cout, &props, true);
} }

View file

@ -1,4 +1,5 @@
// new_gui.cxx: implementation of XML-configurable GUI support. // new_gui.cxx: implementation of XML-configurable GUI support.
#include <iostream>
#include "new_gui.hxx" #include "new_gui.hxx"
@ -352,6 +353,12 @@ NewGUI::setupFont (SGPropertyNode *node)
// FGColor class. // FGColor class.
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
void
FGColor::print() const {
std::cerr << "red=" << _red << ", green=" << _green
<< ", blue=" << _blue << ", alpha=" << _alpha << std::endl;
}
bool bool
FGColor::merge(const SGPropertyNode *node) FGColor::merge(const SGPropertyNode *node)
{ {

View file

@ -264,10 +264,7 @@ public:
bool isValid() const { bool isValid() const {
return _red >= 0.0 && _green >= 0.0 && _blue >= 0.0; return _red >= 0.0 && _green >= 0.0 && _blue >= 0.0;
} }
void print() const { void print() const;
std::cerr << "red=" << _red << ", green=" << _green
<< ", blue=" << _blue << ", alpha=" << _alpha << std::endl;
}
inline void setRed(float red) { _red = red; } inline void setRed(float red) { _red = red; }
inline void setGreen(float green) { _green = green; } inline void setGreen(float green) { _green = green; }

View file

@ -29,8 +29,11 @@
#include <sstream> #include <sstream>
#include STL_IOMANIP #include STL_IOMANIP
#include <iostream>
#include STL_STRING #include STL_STRING
SG_USING_STD(string); SG_USING_STD(string);
using std::cout;
typedef string stdString; // puObject has a "string" member typedef string stdString; // puObject has a "string" member
#include <Main/fg_os.hxx> // fgGetKeyModifiers() #include <Main/fg_os.hxx> // fgGetKeyModifiers()

View file

@ -22,6 +22,7 @@
#include <iomanip> #include <iomanip>
#include <sstream> #include <sstream>
#include <iostream>
#include <string.h> #include <string.h>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>

View file

@ -25,6 +25,7 @@
#include <math.h> #include <math.h>
#include <algorithm> #include <algorithm>
#include <iostream>
#include <simgear/compiler.h> #include <simgear/compiler.h>
@ -36,6 +37,9 @@
SG_USING_STD(sort); SG_USING_STD(sort);
using std::cerr;
using std::endl;
/************************************************************************** /**************************************************************************
* FGNode * FGNode
*************************************************************************/ *************************************************************************/

View file

@ -25,17 +25,11 @@
#define _AIRWAYNETWORK_HXX_ #define _AIRWAYNETWORK_HXX_
#include STL_STRING #include STL_STRING
#include <fstream> #include <istream>
#include <set> #include <set>
#include <map> #include <map>
#include <vector> #include <vector>
SG_USING_STD(string);
SG_USING_STD(map);
SG_USING_STD(set);
SG_USING_STD(vector);
SG_USING_STD(fstream);
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
#include <simgear/misc/sgstream.hxx> #include <simgear/misc/sgstream.hxx>
@ -44,10 +38,10 @@ SG_USING_STD(fstream);
class FGAirway; // forward reference class FGAirway; // forward reference
typedef vector<FGAirway> FGAirwayVector; typedef std::vector<FGAirway> FGAirwayVector;
typedef vector<FGAirway *> FGAirwayPointerVector; typedef std::vector<FGAirway *> FGAirwayPointerVector;
typedef vector<FGAirway>::iterator FGAirwayVectorIterator; typedef std::vector<FGAirway>::iterator FGAirwayVectorIterator;
typedef vector<FGAirway*>::iterator FGAirwayPointerVectorIterator; typedef std::vector<FGAirway*>::iterator FGAirwayPointerVectorIterator;
/************************************************************************************** /**************************************************************************************
* class FGNode * class FGNode
@ -55,7 +49,7 @@ typedef vector<FGAirway*>::iterator FGAirwayPointerVectorIterator;
class FGNode class FGNode
{ {
private: private:
string ident; std::string ident;
double lat; double lat;
double lon; double lon;
int index; int index;
@ -63,32 +57,32 @@ private:
public: public:
FGNode(); FGNode();
FGNode(double lt, double ln, int idx, string id) { lat = lt; lon = ln; index = idx; ident = id;}; FGNode(double lt, double ln, int idx, std::string id) { lat = lt; lon = ln; index = idx; ident = id;};
void setIndex(int idx) { index = idx;}; void setIndex(int idx) { index = idx;};
void setLatitude (double val) { lat = val;}; void setLatitude (double val) { lat = val;};
void setLongitude(double val) { lon = val;}; void setLongitude(double val) { lon = val;};
//void setLatitude (const string& val) { lat = processPosition(val); }; //void setLatitude (const std::string& val) { lat = processPosition(val); };
//void setLongitude(const string& val) { lon = processPosition(val); }; //void setLongitude(const std::string& val) { lon = processPosition(val); };
void addAirway(FGAirway *segment) { next.push_back(segment); }; void addAirway(FGAirway *segment) { next.push_back(segment); };
double getLatitude() { return lat;}; double getLatitude() { return lat;};
double getLongitude(){ return lon;}; double getLongitude(){ return lon;};
int getIndex() { return index; }; int getIndex() { return index; };
string getIdent() { return ident; }; std::string getIdent() { return ident; };
FGNode *getAddress() { return this;}; FGNode *getAddress() { return this;};
FGAirwayPointerVectorIterator getBeginRoute() { return next.begin(); }; FGAirwayPointerVectorIterator getBeginRoute() { return next.begin(); };
FGAirwayPointerVectorIterator getEndRoute() { return next.end(); }; FGAirwayPointerVectorIterator getEndRoute() { return next.end(); };
bool matches(string ident, double lat, double lon); bool matches(std::string ident, double lat, double lon);
}; };
typedef vector<FGNode *> FGNodeVector; typedef std::vector<FGNode *> FGNodeVector;
typedef vector<FGNode *>::iterator FGNodeVectorIterator; typedef std::vector<FGNode *>::iterator FGNodeVectorIterator;
typedef map < string, FGNode *> node_map; typedef std::map < std::string, FGNode *> node_map;
typedef node_map::iterator node_map_iterator; typedef node_map::iterator node_map_iterator;
typedef node_map::const_iterator const_node_map_iterator; typedef node_map::const_iterator const_node_map_iterator;
@ -99,8 +93,8 @@ typedef node_map::const_iterator const_node_map_iterator;
class FGAirway class FGAirway
{ {
private: private:
string startNode; std::string startNode;
string endNode; std::string endNode;
double length; double length;
FGNode *start; FGNode *start;
FGNode *end; FGNode *end;
@ -108,37 +102,37 @@ private:
int type; // 1=low altitude; 2=high altitude airway int type; // 1=low altitude; 2=high altitude airway
int base; // base altitude int base; // base altitude
int top; // top altitude int top; // top altitude
string name; std::string name;
public: public:
FGAirway(); FGAirway();
FGAirway(FGNode *, FGNode *, int); FGAirway(FGNode *, FGNode *, int);
void setIndex (int val) { index = val; }; void setIndex (int val) { index = val; };
void setStartNodeRef (string val) { startNode = val; }; void setStartNodeRef (std::string val) { startNode = val; };
void setEndNodeRef (string val) { endNode = val; }; void setEndNodeRef (std::string val) { endNode = val; };
void setStart(node_map *nodes); void setStart(node_map *nodes);
void setEnd (node_map *nodes); void setEnd (node_map *nodes);
void setType (int tp) { type = tp;}; void setType (int tp) { type = tp;};
void setBase (int val) { base = val;}; void setBase (int val) { base = val;};
void setTop (int val) { top = val;}; void setTop (int val) { top = val;};
void setName (string val) { name = val;}; void setName (std::string val) { name = val;};
void setTrackDistance(); void setTrackDistance();
FGNode * getEnd() { return end;}; FGNode * getEnd() { return end;};
double getLength() { if (length == 0) setTrackDistance(); return length; }; double getLength() { if (length == 0) setTrackDistance(); return length; };
int getIndex() { return index; }; int getIndex() { return index; };
string getName() { return name; }; std::string getName() { return name; };
}; };
typedef vector<int> intVec; typedef std::vector<int> intVec;
typedef vector<int>::iterator intVecIterator; typedef std::vector<int>::iterator intVecIterator;
typedef vector<int>::const_iterator constIntVecIterator; typedef std::vector<int>::const_iterator constIntVecIterator;
class FGAirRoute class FGAirRoute
{ {
@ -158,10 +152,10 @@ public:
void add(const FGAirRoute &other); void add(const FGAirRoute &other);
void add(int node) {nodes.push_back(node);}; void add(int node) {nodes.push_back(node);};
friend istream& operator >> (istream& in, FGAirRoute& r); friend std::istream& operator >> (std::istream& in, FGAirRoute& r);
}; };
inline istream& operator >> ( istream& in, FGAirRoute& r ) inline std::istream& operator >> ( std::istream& in, FGAirRoute& r )
{ {
int node; int node;
in >> node; in >> node;
@ -170,8 +164,8 @@ inline istream& operator >> ( istream& in, FGAirRoute& r )
return in; return in;
} }
typedef vector<FGAirRoute> AirRouteVector; typedef std::vector<FGAirRoute> AirRouteVector;
typedef vector<FGAirRoute>::iterator AirRouteVectorIterator; typedef std::vector<FGAirRoute>::iterator AirRouteVectorIterator;
/************************************************************************************** /**************************************************************************************
* class FGAirwayNetwork * class FGAirwayNetwork

View file

@ -71,7 +71,6 @@ public:
{ } { }
~FGATCMain() { ~FGATCMain() {
cout << "FGATCMain destructor" << endl;
delete input0; delete input0;
delete input1; delete input1;
delete output0; delete output0;

View file

@ -24,6 +24,8 @@
# include "config.h" # include "config.h"
#endif #endif
#include <iostream>
#include <simgear/debug/logstream.hxx> #include <simgear/debug/logstream.hxx>
#include <simgear/math/sg_geodesy.hxx> #include <simgear/math/sg_geodesy.hxx>
#include <simgear/io/iochannel.hxx> #include <simgear/io/iochannel.hxx>
@ -167,7 +169,7 @@ bool FGGarmin::gen_message() {
garmin_sentence += gsa; garmin_sentence += gsa;
garmin_sentence += "\r\n"; garmin_sentence += "\r\n";
cout << garmin_sentence; std::cout << garmin_sentence;
length = garmin_sentence.length(); length = garmin_sentence.length();
strncpy( buf, garmin_sentence.c_str(), length ); strncpy( buf, garmin_sentence.c_str(), length );

View file

@ -48,8 +48,6 @@
#include "httpd.hxx" #include "httpd.hxx"
SG_USING_STD(string); SG_USING_STD(string);
SG_USING_STD(cout);
bool FGHttpd::open() { bool FGHttpd::open() {
if ( is_enabled() ) { if ( is_enabled() ) {

View file

@ -35,6 +35,7 @@
#include <simgear/props/props_io.hxx> #include <simgear/props/props_io.hxx>
#include <sstream> #include <sstream>
#include <iostream>
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include <Main/viewmgr.hxx> #include <Main/viewmgr.hxx>
@ -46,6 +47,9 @@
SG_USING_STD(stringstream); SG_USING_STD(stringstream);
SG_USING_STD(ends); SG_USING_STD(ends);
using std::cout;
using std::endl;
/** /**
* Props connection class. * Props connection class.
* This class represents a connection to props client. * This class represents a connection to props client.

View file

@ -26,6 +26,7 @@
#include <simgear/structure/exception.hxx> #include <simgear/structure/exception.hxx>
#include <simgear/misc/sg_path.hxx> #include <simgear/misc/sg_path.hxx>
#include <simgear/debug/logstream.hxx>
#include <Main/fg_props.hxx> #include <Main/fg_props.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
@ -453,7 +454,8 @@ void FGElectricalSystem::update (double dt) {
" " ); " " );
if ( node->apply_load( load, dt ) < 0.0 ) { if ( node->apply_load( load, dt ) < 0.0 ) {
cout << "Error drawing more current than available!" << endl; SG_LOG(SG_ALL, SG_ALERT,
"Error drawing more current than available!");
} }
} }
} }
@ -472,7 +474,8 @@ void FGElectricalSystem::update (double dt) {
" " ); " " );
if ( node->apply_load( load, dt ) < 0.0 ) { if ( node->apply_load( load, dt ) < 0.0 ) {
cout << "Error drawing more current than available!" << endl; SG_LOG(SG_ALL, SG_ALERT,
"Error drawing more current than available!");
} }
} }
} }
@ -492,7 +495,8 @@ void FGElectricalSystem::update (double dt) {
// cout << "battery load = " << load << endl; // cout << "battery load = " << load << endl;
if ( node->apply_load( load, dt ) < 0.0 ) { if ( node->apply_load( load, dt ) < 0.0 ) {
cout << "Error drawing more current than available!" << endl; SG_LOG(SG_ALL, SG_ALERT,
"Error drawing more current than available!");
} }
} }
} }