Ignore:
Timestamp:
02/18/15 10:13:41 (9 years ago)
Author:
rlacroix
Message:

CCalendar: Make getCurrentDate and update methods return a const reference.

The current date should only be modified by the update method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/calendar.cpp

    r550 r561  
    115115      } 
    116116 
    117       CDate& CCalendar::update(int step) 
     117      const CDate& CCalendar::update(int step) 
    118118      { 
    119119        info(20) << "update step : " << step << " timestep " << this->timestep << std::endl; 
    120         return (this->getCurrentDate() = this->getInitDate() + step * this->timestep); 
     120        return (this->currentDate = this->getInitDate() + step * this->timestep); 
    121121      } 
    122122 
     
    144144      const CDate& CCalendar::getInitDate(void) const     { return this->initDate; } 
    145145      const CDate& CCalendar::getTimeOrigin(void) const   { return this->timeOrigin; } 
    146       CDate& CCalendar::getCurrentDate(void)              { return this->currentDate; } 
     146      const CDate& CCalendar::getCurrentDate(void) const  { return this->currentDate; } 
    147147 
    148148      //----------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.