]> git.mxchange.org Git - flightgear.git/commitdiff
Alex Romosan:
authorehofman <ehofman>
Wed, 26 Oct 2005 09:03:49 +0000 (09:03 +0000)
committerehofman <ehofman>
Wed, 26 Oct 2005 09:03:49 +0000 (09:03 +0000)
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.

23 files changed:
src/AIModel/AIAircraft.hxx
src/AIModel/AIBase.hxx
src/AIModel/AIFlightPlan.cxx
src/AIModel/AIFlightPlan.hxx
src/AIModel/AIManager.cxx
src/AIModel/AIManager.hxx
src/AIModel/AIScenario.cxx
src/AIModel/AIScenario.hxx
src/AIModel/submodel.hxx
src/ATC/AIGAVFRTraffic.cxx
src/ATC/AIGAVFRTraffic.hxx
src/ATC/tower.hxx
src/Environment/environment_ctrl.cxx
src/Environment/fgclouds.cxx
src/Environment/fgmetar.cxx
src/Navaids/navdb.cxx
src/Navaids/navlist.cxx
src/Navaids/navrecord.hxx
src/Objects/ssgEntityArray.hxx
src/Scenery/newcache.hxx
src/Scenery/tileentry.hxx
src/Scenery/tilemgr.cxx
src/Scenery/tilemgr.hxx

index 022572563bdc9fc641b989e1880ee225c92ae738..9417fb5d1307fe1b5b6c87a52d66c1e8c2c95321 100644 (file)
@@ -61,7 +61,7 @@ public:
 
         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 4f17130592d5ef908ca436b5ea60f1b3f7ed74d1..584e737147d08552ca9a3b693129a7cf1d2b6d1e 100644 (file)
@@ -108,7 +108,7 @@ public:
     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 39ca074d864eb2d81fa03d507fa55a91c428df42..db4061b13d35755ab62daa9e9d8154b87bd60b84 100644 (file)
@@ -295,8 +295,8 @@ FGAIFlightPlan::~FGAIFlightPlan()
 }
 
 
-FGAIFlightPlan::waypoint*
-FGAIFlightPlan::getPreviousWaypoint( void )
+FGAIFlightPlan::waypoint* const
+FGAIFlightPlan::getPreviousWaypoint( void ) const
 {
   if (wpt_iterator == waypoints.begin()) {
     return 0;
@@ -306,14 +306,14 @@ FGAIFlightPlan::getPreviousWaypoint( void )
   }
 }
 
-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 @@ void FGAIFlightPlan::IncrementWaypoint(bool eraseWaypoints )
 }
 
 // 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 @@ void FGAIFlightPlan::setLeadDistance(double distance_ft){
 }
 
 
-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 3c6ed9bcaf2428ea02868282e2b6acb35e22258b..17a5d1c277dd6a3d6441b0e08b019abee09fc60d 100644 (file)
@@ -62,37 +62,37 @@ public:
                 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 @@ private:
 
 
 #endif  // _FG_AIFLIGHTPLAN_HXX
-
index 96742864e3fb574593e04a542ef3fa9ee0b84cd3..8b7154059a1f0f2d98b6f8dcec705f365a8d5f5a 100644 (file)
@@ -397,7 +397,7 @@ void FGAIManager::processThermal( FGAIThermal* thermal ) {
 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 @@ void FGAIManager::processScenario( const string &filename ) {
 // 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 86eaab9a1b9fe5971bb75d8e4e564b00e4bd351a..66c89a2f4ddece343ac99392f5ebd4ee24d0e57a 100644 (file)
@@ -46,12 +46,12 @@ private:
   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 @@ public:
 
     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 int getNum( FGAIBase::object_type ot ) {
+    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 ) 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 4491308fef9c75ba713bff26860e1c0e7f51232c..97a60fd4ce5b4bded0f582cf499787bf4c9173cf 100644 (file)
@@ -131,7 +131,7 @@ FGAIScenario::~FGAIScenario()
 }
 
 
-FGAIModelEntity*
+FGAIModelEntity* const
 FGAIScenario::getNextEntry( void )
 {
   if (entries.size() == 0) return 0;
@@ -171,7 +171,7 @@ getAllOffsetNodeVals(const char* name, SGPropertyNode * entry_node)
 {
   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 a6b46ccc2eface07c88be12f7224be68779dc8f3..992f30bb1a1c34f9b978289a4331b653ed5a3922 100644 (file)
@@ -37,13 +37,13 @@ public:
    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 7c733d48e33c04e8ffbc89129884516622353f6d..143f8b74edeb973036119b2453b8c365369a08c5 100644 (file)
@@ -89,7 +89,7 @@ public:
 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 771e6013ddf57d24b3b182a55d30bdf5a5428df7..72c7685a51c50322d015b244dbc3b4e3a93be3bf 100644 (file)
@@ -72,7 +72,7 @@ FGAIGAVFRTraffic::~FGAIGAVFRTraffic() {
 
 // 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 @@ bool FGAIGAVFRTraffic::Init(Point3D pt, string destID, const string& callsign) {
 }
 
 // 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 c094f60a437fa61b1dc76abbccf7cf40380df5b3..48c9ce9408176d0e0df5079e8515646adb2d7472 100644 (file)
@@ -42,9 +42,9 @@ public:
        ~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 de0bf632f7081e1e502102459cb39f266a96b9d3..69fce9ef905d83159964cfe5dacf04a098a4c635 100644 (file)
@@ -162,14 +162,14 @@ public:
        
        // 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 361ca423cd518618902303a1f08177f99643daea..5625cd666c94eef69bdb97ad36929f171cacea1c 100644 (file)
@@ -640,7 +640,7 @@ FGMetarEnvironmentCtrl::update_metar_properties( const FGMetar *m )
                 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 9a5b5123600417a0c5cf5947797f6225c5ca21c2..b3964c2961c987bbc4f5d80c7967465369a3db95 100644 (file)
@@ -306,7 +306,7 @@ FGClouds::update_metar_properties( FGMetar *m )
                 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 0f71c8e4bb355eb44921fedc68978779205faf66..acb5d57450c0e3883f25c3c795c0179d7f5cb79e 100644 (file)
@@ -128,7 +128,7 @@ FGMetar::FGMetar(const string& icao, const string& proxy, const string& port, co
 
        // 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 b9d5afc099af93901629e62de5760880660cd075..60aac0c3ea24724033861f559028feb6968eb39e 100644 (file)
@@ -291,10 +291,10 @@ void fgNavDBAlignLOCwithRunway( FGRunwayList *runways, FGNavList *loclist,
                                 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 4b866580f9e0fee807495878ffe4aed42dc29ad6..4b058e7252a39270da97d73a3587debec4756b35 100644 (file)
@@ -296,8 +296,8 @@ FGNavRecord *FGNavList::findClosest( double lon_rad, double lat_rad,
     // 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 34d3a579ba80b12022a4902848e572fe3263c4e3..8b950abc55d665a310ed60ca519a9a3e5a401017 100644 (file)
@@ -88,11 +88,11 @@ public:
     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 @@ public:
     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 22612a4bd20352b8cc12b2be2a270e43e4829938..659d6d6c5ea4134b801f45a66342d894737510b8 100644 (file)
@@ -32,18 +32,18 @@ public:
     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 de0db296d75cad23c5733c576c3709e099c3a9db..7f2b8ccebc49deccd086f7876cc47d0249efb968 100644 (file)
@@ -97,8 +97,8 @@ public:
     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 @@ public:
     }
 
     // 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 @@ public:
     // 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 51d3d34d0f1f89ecff2ee6fc82a3bffa48a72fe7..e7f6fd3b21c15dce5d8bde4b015b33189c47c8b4 100644 (file)
@@ -274,7 +274,7 @@ public:
     /**
      * 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 fd986a0ec769edec7f2bd4d354f9ca5c85b67439..af7195b44cb62aa23fff879a769a6541ac3ac9ef 100644 (file)
@@ -156,7 +156,7 @@ void FGTileMgr::sched_tile( const SGBucket& b, const bool is_inner_ring ) {
 
 
 // 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 a487264dadf67d7b75e2fd574c65b254caafcf62..18af47d9422dc39d5a56cf5ababab07ce14bc830 100644 (file)
@@ -80,7 +80,7 @@ private:
     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 @@ public:
     // 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 );