Ignore:
Timestamp:
05/12/20 11:52:13 (4 years ago)
Author:
ymipsl
Message:

XIOS coupling branch
Some updates.

First coupling test is beginning to work...

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp

    r1869 r1875  
    216216 
    217217   template<typename T> 
    218    void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client) 
     218   void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client, const string& objectId) 
    219219   { 
    220220     CAttributeMap& attrMap = *this; 
     
    222222     for (; it != itE; ++it) 
    223223     { 
    224        if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second), client); 
     224       if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second), client, objectId); 
    225225     } 
    226226   } 
    227227 
    228228   template <class T> 
    229    void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client) 
     229   void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client, const string& objectId ) 
    230230   { 
    231231      CAttributeMap & attrMap = *this; 
     
    235235 
    236236  template <class T> 
    237   void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, CContextClient* client) 
     237  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, CContextClient* client, const string& objectId) 
    238238  { 
    239239    CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE); 
     
    241241    { 
    242242      CMessage msg; 
    243       msg<<this->getId();  
     243      if (objectId.empty()) msg << this->getId(); 
     244      else msg << objectId; 
    244245      msg << attr.getName(); 
    245246      msg << attr; 
     
    254255/* specialisation for context, because context Id on client is not the same on server, and no need to transfer context Id */ 
    255256  template <> 
    256   void CObjectTemplate<CContext>::sendAttributToServer(CAttribute& attr, CContextClient* client) 
     257  void CObjectTemplate<CContext>::sendAttributToServer(CAttribute& attr, CContextClient* client, const string& objectId) 
    257258  { 
    258259    CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE); 
     
    278279 
    279280  template<class T> 
    280   void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, CContextClient* client) 
     281  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, CContextClient* client, const string& objectId) 
    281282  { 
    282283    typedef typename T::EEventId ItemType; 
     
    285286     { 
    286287       CMessage msg; 
    287        msg << this->getId(); 
     288       if (objectId.empty()) msg << this->getId(); 
     289       else msg << objectId; 
    288290       msg << id; 
    289291       const std::list<int>& ranks = client->getRanksServerLeader(); 
Note: See TracChangeset for help on using the changeset viewer.