Ignore:
Timestamp:
08/20/21 14:38:23 (3 years ago)
Author:
ymipsl
Message:

New functionnality : domain, axis and scalar can now be retrieve with new syntax id :
ex. for domain :

id="domainId" : old syntax, working as before
id="fieldId::domainId" : get the domain related to "domainId" associated to the field "fieldId", work if only 1 domain related to domainId is associated to the field.
id="fieldId::domainId[n]" : get the nth domain related to "domainId" associated to the field "fieldId"
id="fieldId::" : get the domain associated the the field "fieldId, work if grid associated to th field is composed with exactly 1 domain (and possibly other components axis or scalars)
id="fieldId::[n] : get the nth domain composing the grid associated to the field

YM

File:
1 edited

Legend:

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

    r1984 r2203  
    8585         static T* createAlias(const string& id, const string& alias) ; 
    8686         void createAlias(const string& alias) ; 
    87           
     87 
    8888         static const vector<T*> getAll() ; 
    8989         static const vector<T*> getAll(const string& contextId) ; 
     
    9292         void generateFortran2003Interface(ostream& oss) ; 
    9393         void generateFortranInterface(ostream& oss) ; 
     94       
     95      // manage inherited id which is herited by reference 
     96        void setInheritedId(T* obj) ; 
     97        bool hasInheritedId(void) { return hasInheritedId_ ;} 
     98        string getInheritedId(void) { return  inheritedId_ ;} 
    9499 
     100      private:   
     101         std::string inheritedId_ ; 
     102         bool hasInheritedId_ = false; 
     103 
     104      // manage the template id 
     105      public: 
     106         void setTemplateId(T* obj) ; //<! set the id of the object that served as template  
     107         bool hasTemplateId(void) {return hasTemplateId_;} //<! return  hasTemplateId_ 
     108         string getTemplateId(void) 
     109         { 
     110           if (hasTemplateId_) return templateId_  ; 
     111           else if (hasId() && !hasAutoGeneratedId()) return getId() ; 
     112           else if (hasInheritedId()) return getInheritedId() ; 
     113           else return getId() ; 
     114         } 
     115      private: 
     116         std::string templateId_ ;    //<! the id of the object that served as template  
     117         bool hasTemplateId_ = false; //<! true if templateId is set 
     118       
    95119      protected : 
    96120 
Note: See TracChangeset for help on using the changeset viewer.