i tried to make sure accessor functions which return by reference act on const objects. also replaced some iterators with const_iterator and a few return/pass by reference that were missed the first time around:
Index: src/AIModel/AIAircraft.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIAircraft.hxx,v retrieving revision 1.15 diff -u -r1.15 AIAircraft.hxx --- src/AIModel/AIAircraft.hxx 4 Jun 2005 09:38:52 -0000 1.15 +++ src/AIModel/AIAircraft.hxx 26 Oct 2005 01:05:25 -0000 @@ -61,7 +61,7 @@ void SetPerformance(const PERF_STRUCT *ps); void SetFlightPlan(FGAIFlightPlan *f); - FGAIFlightPlan* GetFlightPlan() { return fp; }; + FGAIFlightPlan* GetFlightPlan() const { return fp; }; void AccelTo(double speed); void PitchTo(double angle); void RollTo(double angle); Index: src/AIModel/AIBase.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIBase.hxx,v retrieving revision 1.43 diff -u -r1.43 AIBase.hxx --- src/AIModel/AIBase.hxx 15 Oct 2005 14:55:51 -0000 1.43 +++ src/AIModel/AIBase.hxx 26 Oct 2005 01:05:25 -0000 @@ -108,7 +108,7 @@ FGAIBase(); virtual ~FGAIBase(); virtual void update(double dt); - inline Point3D GetPos() { return(pos); } + inline const Point3D& GetPos() const { return(pos); } enum object_type { otNull = 0, otAircraft, otShip, otCarrier, otBallistic, otRocket, otStorm, otThermal, otStatic, Index: src/AIModel/AIFlightPlan.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIFlightPlan.cxx,v retrieving revision 1.13 diff -u -r1.13 AIFlightPlan.cxx --- src/AIModel/AIFlightPlan.cxx 25 Oct 2005 13:49:56 -0000 1.13 +++ src/AIModel/AIFlightPlan.cxx 26 Oct 2005 01:05:25 -0000 @@ -295,8 +295,8 @@ } -FGAIFlightPlan::waypoint* -FGAIFlightPlan::getPreviousWaypoint( void ) +FGAIFlightPlan::waypoint* const +FGAIFlightPlan::getPreviousWaypoint( void ) const { if (wpt_iterator == waypoints.begin()) { return 0; @@ -306,14 +306,14 @@ } } -FGAIFlightPlan::waypoint* -FGAIFlightPlan::getCurrentWaypoint( void ) +FGAIFlightPlan::waypoint* const +FGAIFlightPlan::getCurrentWaypoint( void ) const { return *wpt_iterator; } -FGAIFlightPlan::waypoint* -FGAIFlightPlan::getNextWaypoint( void ) +FGAIFlightPlan::waypoint* const +FGAIFlightPlan::getNextWaypoint( void ) const { wpt_vector_iterator i = waypoints.end(); i--; // end() points to one element after the last one. @@ -344,7 +344,7 @@ } // gives distance in feet from a position to a waypoint -double FGAIFlightPlan::getDistanceToGo(double lat, double lon, waypoint* wp){ +double FGAIFlightPlan::getDistanceToGo(double lat, double lon, waypoint* wp) const{ // get size of a degree2 at the present latitude // this won't work over large distances double ft_per_deg_lat = 366468.96 - 3717.12 * cos(lat / SG_RADIANS_TO_DEGREES); @@ -386,12 +386,12 @@ } -double FGAIFlightPlan::getBearing(waypoint* first, waypoint* second){ +double FGAIFlightPlan::getBearing(waypoint* first, waypoint* second) const{ return getBearing(first->latitude, first->longitude, second); } -double FGAIFlightPlan::getBearing(double lat, double lon, waypoint* wp){ +double FGAIFlightPlan::getBearing(double lat, double lon, waypoint* wp) const{ double course, distance; // double latd = lat; // double lond = lon; Index: src/AIModel/AIFlightPlan.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIFlightPlan.hxx,v retrieving revision 1.11 diff -u -r1.11 AIFlightPlan.hxx --- src/AIModel/AIFlightPlan.hxx 25 Oct 2005 13:49:56 -0000 1.11 +++ src/AIModel/AIFlightPlan.hxx 26 Oct 2005 01:05:25 -0000 @@ -62,37 +62,37 @@ const string& airline); ~FGAIFlightPlan(); - waypoint* getPreviousWaypoint( void ); - waypoint* getCurrentWaypoint( void ); - waypoint* getNextWaypoint( void ); + waypoint* const getPreviousWaypoint( void ) const; + waypoint* const getCurrentWaypoint( void ) const; + waypoint* const getNextWaypoint( void ) const; void IncrementWaypoint( bool erase ); - double getDistanceToGo(double lat, double lon, waypoint* wp); - int getLeg () { return leg;}; + double getDistanceToGo(double lat, double lon, waypoint* wp) const; + int getLeg () const { return leg;}; void setLeadDistance(double speed, double bearing, waypoint* current, waypoint* next); void setLeadDistance(double distance_ft); double getLeadDistance( void ) const {return lead_distance;} - double getBearing(waypoint* previous, waypoint* next); - double getBearing(double lat, double lon, waypoint* next); - time_t getStartTime() { return start_time; }; + double getBearing(waypoint* previous, waypoint* next) const; + double getBearing(double lat, double lon, waypoint* next) const; + time_t getStartTime() const { return start_time; }; void create(FGAirport *dep, FGAirport *arr, int leg, double alt, double speed, double lat, double lon, bool firstLeg, double radius, const string& fltType, const string& aircraftType, const string& airline); void setLeg(int val) { leg = val;}; void setTime(time_t st) { start_time = st; }; - int getGate() { return gateId; }; - double getLeadInAngle() { return leadInAngle; }; - const string& getRunway() { return rwy._rwy_no; }; - const string& getRunwayId() { return rwy._id; }; + int getGate() const { return gateId; }; + double getLeadInAngle() const { return leadInAngle; }; + const string& getRunway() const { return rwy._rwy_no; }; + const string& getRunwayId() const { return rwy._id; }; void setRepeat(bool r) { repeat = r; }; - bool getRepeat(void) { return repeat; }; + bool getRepeat(void) const { return repeat; }; void restart(void); private: FGRunway rwy; typedef vector <waypoint*> wpt_vector_type; - typedef wpt_vector_type::iterator wpt_vector_iterator; + typedef wpt_vector_type::const_iterator wpt_vector_iterator; wpt_vector_type waypoints; wpt_vector_iterator wpt_iterator; @@ -121,4 +121,3 @@ #endif // _FG_AIFLIGHTPLAN_HXX - Index: src/AIModel/AIManager.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIManager.cxx,v retrieving revision 1.54 diff -u -r1.54 AIManager.cxx --- src/AIModel/AIManager.cxx 15 Oct 2005 14:55:51 -0000 1.54 +++ src/AIModel/AIManager.cxx 26 Oct 2005 01:05:25 -0000 @@ -397,7 +397,7 @@ void FGAIManager::processScenario( const string &filename ) { FGAIScenario* s = new FGAIScenario( filename ); for (int i=0;i<s->nEntries();i++) { - FGAIModelEntity* en = s->getNextEntry(); + FGAIModelEntity* const en = s->getNextEntry(); if (en) { if ( en->m_type == "aircraft") { @@ -430,7 +430,7 @@ // This code keeps track of models that have already been loaded // Eventually we'd prbably need to find a way to keep track of models // that are unloaded again -ssgBranch * FGAIManager::getModel(const string& path) +ssgBranch * FGAIManager::getModel(const string& path) const { ModelVecIterator i = loadedModels.begin(); while (i != loadedModels.end()) Index: src/AIModel/AIManager.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIManager.hxx,v retrieving revision 1.29 diff -u -r1.29 AIManager.hxx --- src/AIModel/AIManager.hxx 15 Oct 2005 14:55:51 -0000 1.29 +++ src/AIModel/AIManager.hxx 26 Oct 2005 01:05:25 -0000 @@ -46,12 +46,12 @@ string path; public: FGModelID(const string& pth, ssgBranch * mdl) { path =pth; model=mdl;}; - ssgBranch *getModelId() { return model;}; - const string & getPath() { return path;}; + ssgBranch * const getModelId() const { return model;}; + const string & getPath() const { return path;}; }; typedef vector<FGModelID> ModelVec; -typedef vector<FGModelID>::iterator ModelVecIterator; +typedef vector<FGModelID>::const_iterator ModelVecIterator; class FGAIThermal; @@ -92,23 +92,23 @@ void destroyObject( int ID ); - inline double get_user_latitude() { return user_latitude; } - inline double get_user_longitude() { return user_longitude; } - inline double get_user_altitude() { return user_altitude; } - inline double get_user_heading() { return user_heading; } - inline double get_user_pitch() { return user_pitch; } - inline double get_user_yaw() { return user_yaw; } - inline double get_user_speed() {return user_speed; } - inline double get_wind_from_east() {return wind_from_east; } - inline double get_wind_from_north() {return wind_from_north; } + inline double get_user_latitude() const { return user_latitude; } + inline double get_user_longitude() const { return user_longitude; } + inline double get_user_altitude() const { return user_altitude; } + inline double get_user_heading() const { return user_heading; } + inline double get_user_pitch() const { return user_pitch; } + inline double get_user_yaw() const { return user_yaw; } + inline double get_user_speed() const {return user_speed; } + inline double get_wind_from_east() const {return wind_from_east; } + inline double get_wind_from_north() const {return wind_from_north; } - inline int getNum( FGAIBase::object_type ot ) { + inline int getNum( FGAIBase::object_type ot ) const { return (0 < ot && ot < FGAIBase::MAX_OBJECTS) ? numObjects[ot] : numObjects[0]; } void processScenario( const string &filename ); - ssgBranch * getModel(const string& path); + ssgBranch * getModel(const string& path) const; void setModel(const string& path, ssgBranch *model); static bool getStartPosition(const string& id, const string& pid, Index: src/AIModel/AIScenario.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIScenario.cxx,v retrieving revision 1.27 diff -u -r1.27 AIScenario.cxx --- src/AIModel/AIScenario.cxx 1 Oct 2005 09:56:53 -0000 1.27 +++ src/AIModel/AIScenario.cxx 26 Oct 2005 01:05:25 -0000 @@ -131,7 +131,7 @@ } -FGAIModelEntity* +FGAIModelEntity* const FGAIScenario::getNextEntry( void ) { if (entries.size() == 0) return 0; @@ -171,7 +171,7 @@ { list<ParkPosition> retval; - vector<SGPropertyNode_ptr>::iterator it; + vector<SGPropertyNode_ptr>::const_iterator it; vector<SGPropertyNode_ptr> children = entry_node->getChildren(name); for (it = children.begin(); it != children.end(); ++it) { string name = (*it)->getStringValue("name", "unnamed"); Index: src/AIModel/AIScenario.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIScenario.hxx,v retrieving revision 1.10 diff -u -r1.10 AIScenario.hxx --- src/AIModel/AIScenario.hxx 3 Jul 2005 09:39:14 -0000 1.10 +++ src/AIModel/AIScenario.hxx 26 Oct 2005 01:05:26 -0000 @@ -37,13 +37,13 @@ FGAIScenario(const string &filename); ~FGAIScenario(); - FGAIModelEntity* getNextEntry( void ); + FGAIModelEntity* const getNextEntry( void ); int nEntries( void ); private: typedef vector <FGAIModelEntity*> entry_vector_type; - typedef entry_vector_type::iterator entry_vector_iterator; + typedef entry_vector_type::const_iterator entry_vector_iterator; entry_vector_type entries; entry_vector_iterator entry_iterator; Index: src/AIModel/submodel.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/submodel.hxx,v retrieving revision 1.3 diff -u -r1.3 submodel.hxx --- src/AIModel/submodel.hxx 7 Nov 2004 14:46:21 -0000 1.3 +++ src/AIModel/submodel.hxx 26 Oct 2005 01:05:26 -0000 @@ -89,7 +89,7 @@ private: typedef vector <submodel*> submodel_vector_type; - typedef submodel_vector_type::iterator submodel_vector_iterator; + typedef submodel_vector_type::const_iterator submodel_vector_iterator; submodel_vector_type submodels; submodel_vector_iterator submodel_iterator; Index: src/ATC/AIGAVFRTraffic.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/ATC/AIGAVFRTraffic.cxx,v retrieving revision 1.5 diff -u -r1.5 AIGAVFRTraffic.cxx --- src/ATC/AIGAVFRTraffic.cxx 20 Mar 2004 03:13:29 -0000 1.5 +++ src/ATC/AIGAVFRTraffic.cxx 26 Oct 2005 01:05:26 -0000 @@ -72,7 +72,7 @@ // Init en-route to destID at point pt. // TODO - no idea what to do if pt is above planes ceiling due mountains!! -bool FGAIGAVFRTraffic::Init(Point3D pt, string destID, const string& callsign) { +bool FGAIGAVFRTraffic::Init(const Point3D& pt, const string& destID, const string& callsign) { FGAILocalTraffic::Init(callsign, destID, EN_ROUTE); // TODO FIXME - to get up and running we're going to ignore elev and get FGAIMgr to // pass in known good values for the test location. Need to fix this!!! (or at least canonically decide who has responsibility for setting elev). @@ -101,7 +101,7 @@ } // Init at srcID to fly to destID -bool FGAIGAVFRTraffic::Init(string srcID, string destID, const string& callsign, OperatingState state) { +bool FGAIGAVFRTraffic::Init(const string& srcID, const string& destID, const string& callsign, OperatingState state) { _enroute = false; FGAILocalTraffic::Init(callsign, srcID, PARKED); return(true); Index: src/ATC/AIGAVFRTraffic.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/ATC/AIGAVFRTraffic.hxx,v retrieving revision 1.2 diff -u -r1.2 AIGAVFRTraffic.hxx --- src/ATC/AIGAVFRTraffic.hxx 19 Sep 2004 16:33:38 -0000 1.2 +++ src/ATC/AIGAVFRTraffic.hxx 26 Oct 2005 01:05:26 -0000 @@ -42,9 +42,9 @@ ~FGAIGAVFRTraffic(); // Init en-route to destID at point pt. (lat, lon, elev) (elev in meters, lat and lon in degrees). - bool Init(Point3D pt, string destID, const string& callsign); + bool Init(const Point3D& pt, const string& destID, const string& callsign); // Init at srcID to fly to destID - bool Init(string srcID, string destID, const string& callsign, OperatingState state = PARKED); + bool Init(const string& srcID, const string& destID, const string& callsign, OperatingState state = PARKED); // Run the internal calculations void Update(double dt); Index: src/ATC/tower.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/ATC/tower.hxx,v retrieving revision 1.30 diff -u -r1.30 tower.hxx --- src/ATC/tower.hxx 25 Oct 2005 13:49:56 -0000 1.30 +++ src/ATC/tower.hxx 26 Oct 2005 01:05:26 -0000 @@ -162,14 +162,14 @@ // 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() { return activeRwy; } - inline const RunwayDetails& GetActiveRunwayDetails() { return rwy; } + inline const string& GetActiveRunway() const { return activeRwy; } + inline const RunwayDetails& GetActiveRunwayDetails() const { return rwy; } // Get the pattern direction of the active rwy. - inline int GetPatternDirection() { return rwy.patternDirection; } + inline int GetPatternDirection() const { return rwy.patternDirection; } - inline const string& get_trans_ident() { return trans_ident; } + inline const string& get_trans_ident() const { return trans_ident; } - inline FGGround* GetGroundPtr() { return ground; } + inline FGGround* const GetGroundPtr() const { return ground; } // Returns true if positions of crosswind/downwind/base leg turns should be constrained by previous traffic // plus the constraint position as a rwy orientated orthopos (meters) Index: src/Environment/environment_ctrl.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/environment_ctrl.cxx,v retrieving revision 1.36 diff -u -r1.36 environment_ctrl.cxx --- src/Environment/environment_ctrl.cxx 25 Oct 2005 13:49:57 -0000 1.36 +++ src/Environment/environment_ctrl.cxx 26 Oct 2005 01:05:26 -0000 @@ -640,7 +640,7 @@ m->getPressure_inHg() ); vector<SGMetarCloud> cv = m->getClouds(); - vector<SGMetarCloud>::iterator cloud; + vector<SGMetarCloud>::const_iterator cloud; const char *cl = "/environment/clouds/layer[%i]"; for (i = 0, cloud = cv.begin(); cloud != cv.end(); cloud++, i++) { Index: src/Environment/fgclouds.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/fgclouds.cxx,v retrieving revision 1.6 diff -u -r1.6 fgclouds.cxx --- src/Environment/fgclouds.cxx 25 Oct 2005 13:49:57 -0000 1.6 +++ src/Environment/fgclouds.cxx 26 Oct 2005 01:05:27 -0000 @@ -306,7 +306,7 @@ m->getPressure_inHg() ); vector<SGMetarCloud> cv = m->getClouds(); - vector<SGMetarCloud>::iterator cloud; + vector<SGMetarCloud>::const_iterator cloud; const char *cl = "/environment/clouds/layer[%i]"; for (i = 0, cloud = cv.begin(); cloud != cv.end(); cloud++, i++) { Index: src/Environment/fgmetar.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Environment/fgmetar.cxx,v retrieving revision 1.1 diff -u -r1.1 fgmetar.cxx --- src/Environment/fgmetar.cxx 20 Jan 2005 09:28:45 -0000 1.1 +++ src/Environment/fgmetar.cxx 26 Oct 2005 01:05:27 -0000 @@ -128,7 +128,7 @@ // snow cover map<string, SGMetarRunway> rm = getRunways(); - map<string, SGMetarRunway>::iterator runway; + map<string, SGMetarRunway>::const_iterator runway; for (runway = rm.begin(); runway != rm.end(); runway++) { SGMetarRunway rwy = runway->second; if (rwy.getDeposit() >= 3 ) { Index: src/Navaids/navdb.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Navaids/navdb.cxx,v retrieving revision 1.10 diff -u -r1.10 navdb.cxx --- src/Navaids/navdb.cxx 2 Oct 2005 17:57:16 -0000 1.10 +++ src/Navaids/navdb.cxx 26 Oct 2005 01:05:30 -0000 @@ -291,10 +291,10 @@ double threshold ) { nav_map_type navmap = loclist->get_navaids(); - nav_map_iterator freq = navmap.begin(); + nav_map_const_iterator freq = navmap.begin(); while ( freq != navmap.end() ) { nav_list_type locs = freq->second; - nav_list_iterator loc = locs.begin(); + nav_list_const_iterator loc = locs.begin(); while ( loc != locs.end() ) { string name = (*loc)->get_name(); string::size_type pos1 = name.find(" "); Index: src/Navaids/navlist.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Navaids/navlist.cxx,v retrieving revision 1.13 diff -u -r1.13 navlist.cxx --- src/Navaids/navlist.cxx 25 Oct 2005 13:49:57 -0000 1.13 +++ src/Navaids/navlist.cxx 26 Oct 2005 01:05:31 -0000 @@ -296,8 +296,8 @@ // cout << "Master index = " << master_index << endl; // cout << "beacon search length = " << beacons.size() << endl; - nav_list_iterator current = navs.begin(); - nav_list_iterator last = navs.end(); + nav_list_const_iterator current = navs.begin(); + nav_list_const_iterator last = navs.end(); Point3D aircraft = sgGeodToCart( Point3D(lon_rad, lat_rad, Index: src/Navaids/navrecord.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Navaids/navrecord.hxx,v retrieving revision 1.6 diff -u -r1.6 navrecord.hxx --- src/Navaids/navrecord.hxx 1 Oct 2005 09:56:53 -0000 1.6 +++ src/Navaids/navrecord.hxx 26 Oct 2005 01:05:31 -0000 @@ -88,11 +88,11 @@ inline int get_range() const { return range; } inline double get_multiuse() const { return multiuse; } inline void set_multiuse( double m ) { multiuse = m; } - inline const char *get_ident() { return ident.c_str(); } - inline string get_name() { return name; } - inline string get_apt_id() { return apt_id; } - inline bool get_serviceable() { return serviceable; } - inline const char *get_trans_ident() { return trans_ident.c_str(); } + inline const char *get_ident() const { return ident.c_str(); } + inline const string& get_name() const { return name; } + inline const string& get_apt_id() const { return apt_id; } + inline bool get_serviceable() const { return serviceable; } + inline const char *get_trans_ident() const { return trans_ident.c_str(); } friend istream& operator>> ( istream&, FGNavRecord& ); }; @@ -182,7 +182,7 @@ inline FGTACANRecord(void); inline ~FGTACANRecord(void) {} - inline string get_channel() { return channel; } + inline const string& get_channel() const { return channel; } inline int get_freq() const { return freq; } friend istream& operator>> ( istream&, FGTACANRecord& ); }; Index: src/Objects/ssgEntityArray.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Objects/ssgEntityArray.hxx,v retrieving revision 1.2 diff -u -r1.2 ssgEntityArray.hxx --- src/Objects/ssgEntityArray.hxx 28 May 2003 16:57:26 -0000 1.2 +++ src/Objects/ssgEntityArray.hxx 26 Oct 2005 01:05:31 -0000 @@ -32,18 +32,18 @@ ssgEntityArray (void) ; virtual ~ssgEntityArray (void) ; - ssgEntity *getModel () { return model ; } + ssgEntity *getModel () const { return model ; } void setModel ( ssgEntity *entity ) { model = entity; } void removeModel () ; void replaceModel ( ssgEntity *new_entity ) ; - ssgVertexArray *getLocations () { return locations; } - ssgVertexArray *getOrientations () { return orientations; } + ssgVertexArray *getLocations () const { return locations; } + ssgVertexArray *getOrientations () const { return orientations; } - float *getLocation ( int i ) { return locations->get( i ); } - float *getOrientation ( int i ) { return orientations->get( i ); } + float *getLocation ( int i ) const { return locations->get( i ); } + float *getOrientation ( int i ) const { return orientations->get( i ); } void addPlacement ( sgVec3 loc, sgVec3 orient ); - virtual int getNumPlacements() { return locations->getNum(); } + virtual int getNumPlacements() const { return locations->getNum(); } void removeAllPlacements(); ssgTransform *getPosTransform() { return pos; } Index: src/Scenery/newcache.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Scenery/newcache.hxx,v retrieving revision 1.4 diff -u -r1.4 newcache.hxx --- src/Scenery/newcache.hxx 19 Nov 2004 22:10:43 -0000 1.4 +++ src/Scenery/newcache.hxx 26 Oct 2005 01:05:31 -0000 @@ -97,8 +97,8 @@ void clear_cache(); // Return a pointer to the specified tile cache entry - inline FGTileEntry *get_tile( const long tile_index ) { - tile_map_iterator it = tile_cache.find( tile_index ); + inline FGTileEntry *get_tile( const long tile_index ) const { + const_tile_map_iterator it = tile_cache.find( tile_index ); if ( it != tile_cache.end() ) { it->second->set_timestamp(globals->get_sim_time_sec()); return it->second; @@ -108,7 +108,7 @@ } // Return a pointer to the specified tile cache entry - inline FGTileEntry *get_tile( const SGBucket& b ) { + inline FGTileEntry *get_tile( const SGBucket& b ) const { return get_tile( b.gen_index() ); } @@ -118,7 +118,7 @@ // External linear traversal of cache inline void reset_traversal() { current = tile_cache.begin(); } inline bool at_end() { return current == tile_cache.end(); } - inline FGTileEntry *get_current() { + inline FGTileEntry *get_current() const { // cout << "index = " << current->first << endl; return current->second; } Index: src/Scenery/tileentry.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Scenery/tileentry.hxx,v retrieving revision 1.20 diff -u -r1.20 tileentry.hxx --- src/Scenery/tileentry.hxx 25 Oct 2005 13:49:58 -0000 1.20 +++ src/Scenery/tileentry.hxx 26 Oct 2005 01:05:31 -0000 @@ -274,7 +274,7 @@ /** * return the SSG Transform node for the terrain */ - inline ssgPlacementTransform *get_terra_transform() { return terra_transform; } + inline ssgPlacementTransform *get_terra_transform() const { return terra_transform; } inline double get_timestamp() const { return timestamp; } inline void set_timestamp( double time_ms ) { timestamp = time_ms; } Index: src/Scenery/tilemgr.cxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Scenery/tilemgr.cxx,v retrieving revision 1.48 diff -u -r1.48 tilemgr.cxx --- src/Scenery/tilemgr.cxx 5 Sep 2005 13:25:09 -0000 1.48 +++ src/Scenery/tilemgr.cxx 26 Oct 2005 01:05:32 -0000 @@ -156,7 +156,7 @@ // schedule a needed buckets for loading -void FGTileMgr::schedule_needed( double vis, SGBucket curr_bucket) { +void FGTileMgr::schedule_needed( double vis, const SGBucket& curr_bucket) { // sanity check (unfortunately needed!) if ( longitude < -180.0 || longitude > 180.0 || latitude < -90.0 || latitude > 90.0 ) Index: src/Scenery/tilemgr.hxx =================================================================== RCS file: /var/cvs/FlightGear-0.9/source/src/Scenery/tilemgr.hxx,v retrieving revision 1.22 diff -u -r1.22 tilemgr.hxx --- src/Scenery/tilemgr.hxx 14 Aug 2005 12:57:13 -0000 1.22 +++ src/Scenery/tilemgr.hxx 26 Oct 2005 01:05:32 -0000 @@ -80,7 +80,7 @@ void sched_tile( const SGBucket& b, const bool is_inner_ring ); // schedule a needed buckets for loading - void schedule_needed(double visibility_meters, SGBucket curr_bucket); + void schedule_needed(double visibility_meters, const SGBucket& curr_bucket); FGHitList hit_list; @@ -178,8 +178,8 @@ // tiles... void refresh_view_timestamps(); - inline SGBucket get_current_bucket () { return current_bucket; } - inline SGBucket get_previous_bucket () { return previous_bucket; } + inline const SGBucket& get_current_bucket () const { return current_bucket; } + inline const SGBucket& get_previous_bucket () const { return previous_bucket; } static bool set_tile_filter( bool f ); static int tile_filter_cb( ssgEntity *, int );
--alex-- -- | I believe the moment is at hand when, by a paranoiac and active | | advance of the mind, it will be possible (simultaneously with | | automatism and other passive states) to systematize confusion | | and thus to help to discredit completely the world of reality. |
_______________________________________________ Flightgear-devel mailing list Flightgear-devel@flightgear.org http://mail.flightgear.org/mailman/listinfo/flightgear-devel 2f585eeea02e2c79d7b1d8c4963bae2d