1
0
Fork 0

replace many auto_ptr by unique_ptr

This commit is contained in:
Torsten Dreyer 2016-11-14 22:20:14 +01:00
parent a3c4b2d953
commit 994ea1674b
25 changed files with 31 additions and 33 deletions

View file

@ -109,7 +109,7 @@ public:
bool hasInteriorPath(void) { return _hasInteriorPath;}
inline std::string& getInteriorPath() { return _interiorPath; }
private:
std::auto_ptr<FGNasalModelDataProxy> _nasal;
std::unique_ptr<FGNasalModelDataProxy> _nasal;
std::string _fxpath;
bool _ready;
bool _initialized;

View file

@ -28,7 +28,6 @@
#include <simgear/math/SGMath.hxx>
#include <vector>
#include <memory> // for std::auto_ptr
typedef std::vector<SGGeod> SGGeodVec;

View file

@ -360,7 +360,7 @@ private:
std::vector<STARRef> mSTARs;
std::vector<ApproachRef> mApproaches;
mutable std::auto_ptr<FGGroundNetwork> _groundNetwork;
mutable std::unique_ptr<FGGroundNetwork> _groundNetwork;
};
// find basic airport location info from airport database

View file

@ -33,7 +33,6 @@
#include <simgear/sg_inlines.h>
#include <string>
#include <memory> // for std::auto_ptr
#include "gnnode.hxx"
#include <Airports/airports_fwd.hxx>

View file

@ -261,7 +261,7 @@ public:
private:
SymbolDef* definition;
std::auto_ptr<SGCondition> enable;
std::unique_ptr<SGCondition> enable;
string_set required_states;
string_set excluded_states;
};
@ -350,7 +350,7 @@ public:
bool rotateToHeading;
bool roundPos; ///< should position be rounded to integer values
bool hasText;
std::auto_ptr<SGCondition> textEnable;
std::unique_ptr<SGCondition> textEnable;
bool textEnabled; ///< cache condition result
osg::Vec4 textColor;
osg::Vec2 textOffset;

View file

@ -198,10 +198,10 @@ private:
SGPropertyNode_ptr _customSymbols;
class CacheListener;
std::auto_ptr<CacheListener> _cacheListener;
std::unique_ptr<CacheListener> _cacheListener;
class ForceUpdateListener;
std::auto_ptr<ForceUpdateListener> _forceUpdateListener;
std::unique_ptr<ForceUpdateListener> _forceUpdateListener;
};
#endif // _INST_ND_HXX

View file

@ -41,7 +41,7 @@ public:
virtual void update(double dt);
private:
std::auto_ptr<SGMagVar> _magVar;
std::unique_ptr<SGMagVar> _magVar;
SGPropertyNode_ptr _magVarNode, _magDipNode;
};

View file

@ -28,7 +28,7 @@
#include "FGCommonInput.hxx"
#include "FGButton.hxx"
#include <memory> // for std::auto_ptr
#include <memory> // for std::unique_ptr
#include <simgear/structure/subsystem_mgr.hxx>
#include <plib/js.h>
@ -79,7 +79,7 @@ private:
joystick ();
virtual ~joystick ();
int jsnum;
std::auto_ptr<jsJoystick> plibJS;
std::unique_ptr<jsJoystick> plibJS;
int naxes;
int nbuttons;
axis * axes;

View file

@ -54,7 +54,7 @@ public:
private:
friend class FGMacOSXEventInputPrivate;
std::auto_ptr<FGMacOSXEventInputPrivate> d;
std::unique_ptr<FGMacOSXEventInputPrivate> d;
};
#endif

View file

@ -52,7 +52,7 @@ private:
void processMotion(int x, int y, const osgGA::GUIEventAdapter* ea);
class FGMouseInputPrivate;
std::auto_ptr<FGMouseInputPrivate> d;
std::unique_ptr<FGMouseInputPrivate> d;
};

View file

@ -34,7 +34,7 @@
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/structure/exception.hxx>
using std::auto_ptr;
using std::unique_ptr;
using std::string;
using namespace flightgear;
@ -347,7 +347,7 @@ GPS::update (double delta_time_sec)
if (!routeMgr->isRouteActive()) {
// initialise in OBS mode, with waypt set to the nearest airport.
// keep in mind at this point, _dataValid is not set
auto_ptr<FGPositioned::Filter> f(new FGAirport::HardSurfaceFilter());
unique_ptr<FGPositioned::Filter> f(new FGAirport::HardSurfaceFilter());
FGPositionedRef apt = FGPositioned::findClosest(_indicated_pos, 20.0, f.get());
if (apt) {
selectOBSMode(new flightgear::NavaidWaypoint(apt, NULL));
@ -1307,7 +1307,7 @@ void GPS::loadNearest()
return;
}
auto_ptr<FGPositioned::Filter> f(createFilter(ty));
unique_ptr<FGPositioned::Filter> f(createFilter(ty));
int limitCount = _scratchNode->getIntValue("max-results", 1);
double cutoffDistance = _scratchNode->getDoubleValue("cutoff-nm", 400.0);
@ -1386,7 +1386,7 @@ void GPS::search()
_searchResultIndex = 0;
_searchIsRoute = false;
auto_ptr<FGPositioned::Filter> f(createFilter(_searchType));
unique_ptr<FGPositioned::Filter> f(createFilter(_searchType));
if (_searchNames) {
_searchResults = FGPositioned::findAllWithName(_searchQuery, f.get(), _searchExact);
} else {

View file

@ -404,7 +404,7 @@ private:
SGGeod _turnPt;
SGGeod _turnCentre;
std::auto_ptr<flightgear::WayptController> _wayptController;
std::unique_ptr<flightgear::WayptController> _wayptController;
flightgear::WayptRef _prevWaypt;
flightgear::WayptRef _currentWaypt;

View file

@ -98,7 +98,7 @@ SGPropertyNode_ptr createServiceableProp(SGPropertyNode* aParent,
return n;
}
static std::auto_ptr<SGInterpTable> static_terminalRangeInterp,
static std::unique_ptr<SGInterpTable> static_terminalRangeInterp,
static_lowRangeInterp, static_highRangeInterp;
// Constructor

View file

@ -170,7 +170,7 @@ private:
class OptionsPrivate;
std::auto_ptr<OptionsPrivate> p;
std::unique_ptr<OptionsPrivate> p;
};
} // of namespace flightgear

View file

@ -38,8 +38,8 @@ public:
private:
void deinit ();
std::auto_ptr<SGModelPlacement> _aircraft;
std::auto_ptr<SGModelPlacement> _interior;
std::unique_ptr<SGModelPlacement> _aircraft;
std::unique_ptr<SGModelPlacement> _interior;
SGVec3d _velocity;
SGSharedPtr<FGFX> _fx;

View file

@ -101,7 +101,7 @@ private:
};
SGPropertyNode_ptr _models;
std::auto_ptr<Listener> _listener;
std::unique_ptr<Listener> _listener;
std::vector<Instance *> _instances;

View file

@ -83,7 +83,7 @@ private:
osg::Matrix _xform;
SGPropertyChangeListener* _listener;
std::auto_ptr<SGPropertyChangeListener> _pathListener;
std::unique_ptr<SGPropertyChangeListener> _pathListener;
/// should the 2D panel auto-hide when the view orientation changes
mutable SGPropertyNode_ptr _autoHide2d;

View file

@ -90,7 +90,7 @@ private:
typedef std::map<std::string, SGSharedPtr<FGAIMultiplayer> > MultiPlayerMap;
MultiPlayerMap mMultiPlayerMap;
std::auto_ptr<simgear::Socket> mSocket;
std::unique_ptr<simgear::Socket> mSocket;
simgear::IPAddress mServer;
bool mHaveServer;
bool mInitialised;

View file

@ -902,7 +902,7 @@ public:
// if we're performing a rebuild, the thread that is doing the work.
// otherwise, NULL
std::auto_ptr<RebuildThread> rebuilder;
std::unique_ptr<RebuildThread> rebuilder;
};
//////////////////////////////////////////////////////////////////////

View file

@ -307,7 +307,7 @@ public:
bool isComplete() const;
private:
class ThreadedGUISearchPrivate;
std::auto_ptr<ThreadedGUISearchPrivate> d;
std::unique_ptr<ThreadedGUISearchPrivate> d;
};
private:
NavDataCache();
@ -330,7 +330,7 @@ private:
static const std::string defaultDatFile[];
class NavDataCachePrivate;
std::auto_ptr<NavDataCachePrivate> d;
std::unique_ptr<NavDataCachePrivate> d;
};
} // of namespace flightgear

View file

@ -71,7 +71,7 @@ private:
void interpolateGreatCircle(const SGGeod& aFrom, const SGGeod& aTo, SGGeodVec& r) const;
std::auto_ptr<RoutePathPrivate> d;
std::unique_ptr<RoutePathPrivate> d;
};
#endif

View file

@ -51,7 +51,7 @@ public:
static const char* subsystemName() { return "http"; }
private:
bool _inited;
std::auto_ptr<simgear::HTTP::Client> _http;
std::unique_ptr<simgear::HTTP::Client> _http;
};
#endif // FG_HTTP_CLIENT_HXX

View file

@ -60,7 +60,7 @@ private:
bool _is_initialized, _enabled;
SGPropertyNode_ptr _sound_working, _sound_enabled, _volume, _device_name;
SGPropertyNode_ptr _velocityNorthFPS, _velocityEastFPS, _velocityDownFPS;
std::auto_ptr<Listener> _listener;
std::unique_ptr<Listener> _listener;
#if defined(ENABLE_FLITE)
std::map<std::string,VoiceSynthesizer*> _synthesizers;
#endif

View file

@ -101,7 +101,7 @@ private:
void shutdown();
friend class ScheduleParseThread;
std::auto_ptr<ScheduleParseThread> scheduleParser;
std::unique_ptr<ScheduleParseThread> scheduleParser;
// helper to read and parse the schedule data.
// this is run on a helper thread, so be careful about

View file

@ -292,7 +292,7 @@ protected:
CameraList _cameras;
osg::ref_ptr<osgViewer::Viewer> _viewer;
static osg::ref_ptr<CameraGroup> _defaultGroup;
std::auto_ptr<CameraGroupListener> _listener;
std::unique_ptr<CameraGroupListener> _listener;
// Near, far for the master camera if used.
float _zNear;