#ifndef __FIELD_IMPL_HPP__ #define __FIELD_IMPL_HPP__ #include "xmlioserver_spl.hpp" #include "field.hpp" #include "context.hpp" #include "grid.hpp" namespace xmlioserver { namespace tree { template void CField::setData(const ARRAY(double, N) _data) { const std::vector > & refField=getAllReference(); std::vector >::const_iterator it = refField.begin(), end = refField.end(); for (; it != end; it++) (*it)->updateData(_data) ; } template bool CField::updateData(const ARRAY(double, N) _data) { shared_ptr context=CObjectFactory::GetObject(CObjectFactory::GetCurrentContextId()) ; const date::CDate & currDate = context->getCalendar()->getCurrentDate(); const date::CDate opeDate = *last_operation + freq_operation; const date::CDate writeDate = *last_Write + freq_write; info(50) << "CField::updateData " << currDate << " : send data to " << this->getBaseFieldId() << std::endl; info(50) << "Next operation " << opeDate<data->num_elements() != this->grid->storeIndex_client->num_elements()) { this->data->resize(boost::extents[this->grid->storeIndex_client ->num_elements()]); } ARRAY_CREATE(input, double, 1, [this->data->num_elements()]); this->grid->inputField(_data, input); (*this->foperation)(input); *last_operation = currDate; info(50) << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; } if (writeDate < (currDate + freq_operation)) { this->foperation->final(); *last_Write = writeDate; info(50) << "(*last_Write = currDate) : " << *last_Write << " = " << currDate << std::endl; sendUpdateData() ; return (true); } return (false); } } // namespace tree } // namespace xmlioserver #endif