Ignore:
Timestamp:
01/10/17 14:36:29 (7 years ago)
Author:
oabramkina
Message:

Intermeadiate version for merging with new server functionalities.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/file.cpp

    r1009 r1021  
    1414#include "type.hpp" 
    1515#include "xios_spl.hpp" 
    16 #include "context_client.hpp" 
    1716#include "mpi.hpp" 
    1817 
     
    376375         { 
    377376           middlePart=filename.substr(pos1,pos2-pos1) ; 
    378            cout<<pos2<<endl ; 
    379377           pos2+=strEndDate.size() ; 
    380378           lastPart=filename.substr(pos2,filename.size()-pos2) ; 
     
    746744     int size = this->enabledFields.size(); 
    747745     for (int i = 0; i < size; ++i) 
    748        this->enabledFields[i]->sendReadDataRequest(); 
     746       this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    749747   } 
    750748 
     
    822820   { 
    823821     return vVariableGroup->createChildGroup(id); 
     822   } 
     823 
     824   void CFile::setContextClient(CContextClient* newContextClient) 
     825   { 
     826     client = newContextClient; 
     827   } 
     828 
     829   CContextClient* CFile::getContextClient() 
     830   { 
     831     return client; 
    824832   } 
    825833 
     
    853861   } 
    854862 
    855    void CFile::sendAddField(const string& id, const int srvPool) 
    856    { 
    857       sendAddItem(id, EVENT_ID_ADD_FIELD, srvPool); 
     863   void CFile::sendAddField(const string& id, CContextClient* client) 
     864   { 
     865      sendAddItem(id, EVENT_ID_ADD_FIELD, client); 
    858866    // CContext* context = CContext::getCurrent(); 
    859867 
     
    974982   } 
    975983 
    976    void CFile::sendAddAllVariables(const int srvPool) 
     984   void CFile::sendAddAllVariables(CContextClient* client) 
    977985   { 
    978986     std::vector<CVariable*> allVar = getAllVariables(); 
     
    982990     for (; it != itE; ++it) 
    983991     { 
    984        this->sendAddVariable((*it)->getId(), srvPool); 
    985        (*it)->sendAllAttributesToServer(srvPool); 
    986        (*it)->sendValue(srvPool); 
     992       this->sendAddVariable((*it)->getId(), client); 
     993       (*it)->sendAllAttributesToServer(client); 
     994       (*it)->sendValue(client); 
    987995     } 
    988996   } 
     
    10461054   } 
    10471055 
    1048    void CFile::sendAddVariable(const string& id, const int srvPool) 
    1049    { 
    1050       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, srvPool); 
     1056   void CFile::sendAddVariable(const string& id, CContextClient* client) 
     1057   { 
     1058      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client); 
    10511059    // CContext* context = CContext::getCurrent(); 
    10521060 
     
    11261134   Remark: This function must be called AFTER all active (enabled) files have been created on the server side 
    11271135   */ 
    1128    void CFile::sendEnabledFields() 
     1136//   void CFile::sendEnabledFields() 
     1137//   { 
     1138//     size_t size = this->enabledFields.size(); 
     1139//     for (size_t i = 0; i < size; ++i) 
     1140//     { 
     1141//       CField* field = this->enabledFields[i]; 
     1142//       this->sendAddField(field->getId()); 
     1143//       field->sendAllAttributesToServer(); 
     1144//       field->sendAddAllVariables(); 
     1145//     } 
     1146//   } 
     1147 
     1148   /*! 
     1149     \brief Sending all active (enabled) fields from client to server. 
     1150   Each field is identified uniquely by its string identity. Not only should we 
     1151   send the id to server but also we need to send ids of reference domain and reference axis. 
     1152   With these two id, it's easier to make reference to grid where all data should be written. 
     1153   Remark: This function must be called AFTER all active (enabled) files have been created on the server side 
     1154   */   void CFile::sendEnabledFields(CContextClient* client) 
    11291155   { 
    11301156     size_t size = this->enabledFields.size(); 
     
    11321158     { 
    11331159       CField* field = this->enabledFields[i]; 
    1134        this->sendAddField(field->getId()); 
    1135        field->sendAllAttributesToServer(); 
    1136        field->sendAddAllVariables(); 
     1160       this->sendAddField(field->getId(), client); 
     1161       field->sendAllAttributesToServer(client); 
     1162       field->sendAddAllVariables(client); 
    11371163     } 
    11381164   } 
    11391165 
    1140    void CFile::sendEnabledFields(const int srvPool) 
    1141    { 
    1142      size_t size = this->enabledFields.size(); 
    1143      for (size_t i = 0; i < size; ++i) 
    1144      { 
    1145        CField* field = this->enabledFields[i]; 
    1146        this->sendAddField(field->getId(), srvPool); 
    1147        field->sendAllAttributesToServer(srvPool); 
    1148        field->sendAddAllVariables(srvPool); 
    1149      } 
    1150    } 
    11511166 
    11521167   /*! 
Note: See TracChangeset for help on using the changeset viewer.