Changeset 206 for XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp
- Timestamp:
- 05/30/11 15:17:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp
r205 r206 6 6 7 7 #include "node_type.hpp" 8 8 #include "calendar_util.hpp" 9 9 #include "xios_manager.hpp" 10 10 … … 19 19 , grid(), file() 20 20 , freq_operation(), freq_write() 21 , last_Write(), last_operation() 21 22 , foperation() 22 23 , data() … … 28 29 , grid(), file() 29 30 , freq_operation(), freq_write() 31 , last_Write(), last_operation() 30 32 , foperation() 31 33 , data() … … 42 44 //---------------------------------------------------------------- 43 45 46 bool CField::updateDataServer 47 (const date::CDate & currDate, const std::deque<ARRAY(double, 1)> storedClient) 48 { 49 if ((*last_operation + freq_operation) >= currDate) 50 { 51 ARRAY_CREATE(input, double, 1, [0]); 52 this->grid->inputFieldServer(storedClient, input); 53 (*this->foperation)(input); 54 *last_operation = currDate; 55 } 56 57 if ((*last_Write + freq_write) >= currDate) 58 { 59 *last_Write = currDate; 60 return (true); 61 } 62 return (false); 63 } 64 65 //---------------------------------------------------------------- 66 44 67 void CField::setRelFile(const boost::shared_ptr<CFile> _file) 45 68 { … … 132 155 //---------------------------------------------------------------- 133 156 134 ARRAY(double, 1) 157 ARRAY(double, 1) CField::getData(void) const 135 158 { 136 159 return(this->data); 160 } 161 162 //---------------------------------------------------------------- 163 164 boost::shared_ptr<date::CDate> CField::getLastWriteDate(void) const 165 { 166 return(this->last_Write); 167 } 168 169 //---------------------------------------------------------------- 170 171 boost::shared_ptr<date::CDate> CField::getLastOperationDate(void) const 172 { 173 return(this->last_operation); 137 174 } 138 175 … … 173 210 using namespace date; 174 211 175 StdString id = this->getBaseFieldReference()->getId(); 212 StdString id = this->getBaseFieldReference()->getId(); 213 boost::shared_ptr<CContext> _context = 214 CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()); 215 176 216 if (operation.isEmpty() || freq_op.isEmpty() || this->file->output_freq.isEmpty()) 177 217 { … … 187 227 this->freq_write = 188 228 CDuration::FromString(this->file->output_freq.getValue()); 229 this->last_Write = boost::shared_ptr<xmlioserver::date::CDate> 230 (new date::CDate(_context->getCalendar()->getInitDate())); 231 this->last_operation = boost::shared_ptr<xmlioserver::date::CDate> 232 (new date::CDate(_context->getCalendar()->getInitDate())); 189 233 this->foperation = 190 234 boost::shared_ptr<func::CFunctor>(new CInstant(this->data)); … … 194 238 this->freq_operation = CDuration::FromString(freq_op.getValue()); 195 239 this->freq_write = CDuration::FromString(this->file->output_freq.getValue()); 240 this->last_Write = boost::shared_ptr<xmlioserver::date::CDate> 241 (new date::CDate(_context->getCalendar()->getInitDate())); 242 this->last_operation = boost::shared_ptr<xmlioserver::date::CDate> 243 (new date::CDate(_context->getCalendar()->getInitDate())); 196 244 197 245 #define DECLARE_FUNCTOR(MType, mtype) \
Note: See TracChangeset
for help on using the changeset viewer.