Ignore:
Timestamp:
11/13/14 15:09:14 (9 years ago)
Author:
mhnguyen
Message:

Implementing buffer size auto-detection for mode client -server

+) Process xml tree in client side then send all the information to server
+) Only information enabled fields in enabled files are sent to server
+) Some important change in structure of code which must be refactored

Test
+) On Curie
+) Only mode client-server
+) Passed for all tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/attribute_map.cpp

    r501 r509  
    1313      CAttributeMap::~CAttributeMap(void) 
    1414      { /* Ne rien faire de plus */ } 
    15        
     15 
    1616      ///-------------------------------------------------------------- 
    1717 
     
    3030 
    3131      bool CAttributeMap::hasAttribute(const StdString & key) const 
    32       {  
    33          return (this->find(key) != this->end());  
    34       } 
    35        
    36       //--------------------------------------------------------------- 
    37        
     32      { 
     33         return (this->find(key) != this->end()); 
     34      } 
     35 
     36      void CAttributeMap::clearAttribute(const StdString& key) 
     37      { 
     38        if (hasAttribute(key)) this->find(key)->second->reset(); 
     39      } 
     40 
     41      //--------------------------------------------------------------- 
     42 
    3843      void CAttributeMap::setAttribute(const StdString & key, CAttribute * const attr) 
    3944      { 
     
    4752//         this->find(key)->second->setAnyValue(attr->getAnyValue()); 
    4853      } 
    49        
    50       //--------------------------------------------------------------- 
    51        
     54 
     55      //--------------------------------------------------------------- 
     56 
    5257      CAttribute * CAttributeMap::operator[](const StdString & key) 
    5358      { 
     
    5762         return (SuperClassMap::operator[](key)); 
    5863      } 
    59        
    60       //--------------------------------------------------------------- 
    61        
     64 
     65      //--------------------------------------------------------------- 
     66 
    6267      StdString CAttributeMap::toString(void) const 
    6368      { 
    6469         typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
    6570         StdOStringStream oss; 
    66           
     71 
    6772         SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end(); 
    6873         for (; it != end; it++) 
     
    7479         return (oss.str()); 
    7580      } 
    76        
    77       //--------------------------------------------------------------- 
    78        
     81 
     82      //--------------------------------------------------------------- 
     83 
    7984      void CAttributeMap::fromString(const StdString & str) 
    80       {  
     85      { 
    8186         ERROR("CAttributeMap::fromString(const StdString & str)", 
    82                << "[ str = " << str << "] Not implemented yet !");  
    83       } 
    84        
     87               << "[ str = " << str << "] Not implemented yet !"); 
     88      } 
     89 
    8590      //--------------------------------------------------------------- 
    8691 
    8792      //StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap) 
    8893      //{ os << attributmap.toString(); return (os); } 
    89        
    90       //--------------------------------------------------------------- 
    91        
     94 
     95      //--------------------------------------------------------------- 
     96 
    9297      void CAttributeMap::setAttributes(const xml::THashAttributes & attributes) 
    9398      { 
     
    104109         } 
    105110      } 
    106        
    107       //--------------------------------------------------------------- 
    108        
     111 
     112      //--------------------------------------------------------------- 
     113 
     114      /*! 
     115      \brief Set attributes from a specific attributemap, considered parent. 
     116         The child attribute map will insert the attributes of its parent into its current attribute map. 
     117      The existing attributes can be filled with the values of the parent map if they are empty or 
     118      simply replaced by these values depending on choice of user. 
     119      \param [in] _parent Attribute map from which the current map gets attributes. 
     120      \param [in] apply Specify if current attribute map is replaced by the attributes of parent (false) 
     121                    or filled in in case of emptyp (true) 
     122      */ 
    109123      void CAttributeMap::setAttributes(const CAttributeMap * const _parent, bool apply) 
    110124      { 
    111125         typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
    112           
     126 
    113127         SuperClassMap::const_iterator it = _parent->begin(), end = _parent->end(); 
    114128         for (; it != end; it++) 
     
    130144         } 
    131145      } 
    132        
    133       //--------------------------------------------------------------- 
    134 /*       
     146 
     147      //--------------------------------------------------------------- 
     148/* 
    135149      void CAttributeMap::toBinary(StdOStream & os) const 
    136150      { 
    137151         typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
    138152         SuperClassMap::const_iterator it = this->begin(), end = this->end(); 
    139           
     153 
    140154         const StdSize nbatt = SuperClassMap::size(); 
    141155         os.write (reinterpret_cast<const char*>(&nbatt) , sizeof(StdSize)); 
    142           
     156 
    143157         for (; it != end; it++) 
    144158         { 
    145159            const StdString & key   = it->first; 
    146             const CAttribute* value = it->second;             
     160            const CAttribute* value = it->second; 
    147161            const StdSize size = key.size(); 
    148              
     162 
    149163            os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize)); 
    150164            os.write (key.data(), size * sizeof(char)); 
    151              
     165 
    152166            if (!value->isEmpty()) 
    153167            { 
     
    156170               value->toBinary(os); 
    157171            } 
    158             else  
     172            else 
    159173            { 
    160174               bool b = false; 
     
    163177         } 
    164178      } 
    165        
    166       //--------------------------------------------------------------- 
    167        
     179 
     180      //--------------------------------------------------------------- 
     181 
    168182      void CAttributeMap::fromBinary(StdIStream & is) 
    169183      { 
    170184         StdSize nbatt = 0; 
    171185         is.read (reinterpret_cast<char*>(&nbatt), sizeof(StdSize)); 
    172           
     186 
    173187         for (StdSize i = 0; i < nbatt; i++) 
    174188         { 
     
    178192            StdString key(size, ' '); 
    179193            is.read (const_cast<char *>(key.data()), size * sizeof(char)); 
    180              
     194 
    181195            if (!this->hasAttribute(key)) 
    182196               ERROR("CAttributeMap::fromBinary(StdIStream & is)", 
    183197                     << "[ key = " << key << "] key not found !"); 
    184                                          
     198 
    185199            is.read (reinterpret_cast<char*>(&hasValue), sizeof(bool)); 
    186              
    187             if (hasValue)           
     200 
     201            if (hasValue) 
    188202               this->operator[](key)->fromBinary(is); 
    189203         } 
    190204      } 
    191  */      
     205 */ 
    192206      void CAttributeMap::generateCInterface(ostream& oss, const string& className) 
    193207      { 
     
    208222           it->second->generateFortran2003Interface(oss,className) ; 
    209223           it->second->generateFortran2003InterfaceIsDefined(oss,className) ; 
    210            
     224 
    211225           oss<<iendl<<iendl ; 
    212226         } 
    213       }       
    214   
     227      } 
     228 
    215229      ///-------------------------------------------------------------- 
    216230 
     
    221235         SuperClassMap::const_iterator it ; 
    222236         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    223           
    224          oss2=new ostringstream ; 
    225           
    226          *oss2<<"( "<<className<<"_hdl"  ; 
    227           
    228          for ( it=begin ; it != end; it++)  
     237 
     238         oss2=new ostringstream ; 
     239 
     240         *oss2<<"( "<<className<<"_hdl"  ; 
     241 
     242         for ( it=begin ; it != end; it++) 
    229243         { 
    230244           *oss2<<", "<<it->second->getName()<<"_" ; 
    231            if (oss2->str().size()>90)  
    232            { 
    233              oss<<oss2->str()<<"  &"<<iendl ; 
    234              delete oss2 ; 
    235              oss2=new ostringstream ; 
    236            } 
    237          } 
    238          *oss2<<" )" ; 
    239          oss<<oss2->str()<<iendl ; 
    240          oss<<iendl ; 
    241          delete oss2 ;  
    242           
     245           if (oss2->str().size()>90) 
     246           { 
     247             oss<<oss2->str()<<"  &"<<iendl ; 
     248             delete oss2 ; 
     249             oss2=new ostringstream ; 
     250           } 
     251         } 
     252         *oss2<<" )" ; 
     253         oss<<oss2->str()<<iendl ; 
     254         oss<<iendl ; 
     255         delete oss2 ; 
     256 
    243257         oss<<"IMPLICIT NONE"<<iendl++ ; 
    244258         oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ; 
    245           
     259 
    246260         for (it=begin; it != end; it++) 
    247261         { 
    248262           it->second->generateFortranInterfaceDeclaration_(oss,className) ; 
    249263         } 
    250           
    251          oss<<iendl ; 
    252           
     264 
     265         oss<<iendl ; 
     266 
    253267         for (it=begin; it != end; it++) 
    254268         { 
     
    256270           oss<<iendl ; 
    257271         } 
    258           
     272 
    259273         oss<<iendl--<<iendl-- ; 
    260274         oss<<"END SUBROUTINE xios(set_"<<className<<"_attr_hdl_)"<<iendl ; 
    261           
    262       }       
     275 
     276      } 
    263277 
    264278      void CAttributeMap::generateFortranInterfaceGet_hdl_(ostream& oss, const string& className) 
     
    268282         SuperClassMap::const_iterator it ; 
    269283         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    270           
    271          oss2=new ostringstream ; 
    272           
    273          *oss2<<"( "<<className<<"_hdl"  ; 
    274           
    275          for ( it=begin ; it != end; it++)  
     284 
     285         oss2=new ostringstream ; 
     286 
     287         *oss2<<"( "<<className<<"_hdl"  ; 
     288 
     289         for ( it=begin ; it != end; it++) 
    276290         { 
    277291           *oss2<<", "<<it->second->getName()<<"_" ; 
    278            if (oss2->str().size()>90)  
    279            { 
    280              oss<<oss2->str()<<"  &"<<iendl ; 
    281              delete oss2 ; 
    282              oss2=new ostringstream ; 
    283            } 
    284          } 
    285          *oss2<<" )" ; 
    286          oss<<oss2->str()<<iendl ; 
    287          oss<<iendl ; 
    288          delete oss2 ;  
    289           
     292           if (oss2->str().size()>90) 
     293           { 
     294             oss<<oss2->str()<<"  &"<<iendl ; 
     295             delete oss2 ; 
     296             oss2=new ostringstream ; 
     297           } 
     298         } 
     299         *oss2<<" )" ; 
     300         oss<<oss2->str()<<iendl ; 
     301         oss<<iendl ; 
     302         delete oss2 ; 
     303 
    290304         oss<<"IMPLICIT NONE"<<iendl++ ; 
    291305         oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ; 
    292           
     306 
    293307         for (it=begin; it != end; it++) 
    294308         { 
    295309           it->second->generateFortranInterfaceGetDeclaration_(oss,className) ; 
    296310         } 
    297           
    298          oss<<iendl ; 
    299           
     311 
     312         oss<<iendl ; 
     313 
    300314         for (it=begin; it != end; it++) 
    301315         { 
     
    303317           oss<<iendl ; 
    304318         } 
    305           
     319 
    306320         oss<<iendl--<<iendl-- ; 
    307321         oss<<"END SUBROUTINE xios(get_"<<className<<"_attr_hdl_)"<<iendl ; 
    308           
    309       }      
    310        
     322 
     323      } 
     324 
    311325 
    312326      void CAttributeMap::generateFortranInterfaceIsDefined_hdl_(ostream& oss, const string& className) 
     
    316330         SuperClassMap::const_iterator it ; 
    317331         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    318           
    319          oss2=new ostringstream ; 
    320           
    321          *oss2<<"( "<<className<<"_hdl"  ; 
    322           
    323          for ( it=begin ; it != end; it++)  
     332 
     333         oss2=new ostringstream ; 
     334 
     335         *oss2<<"( "<<className<<"_hdl"  ; 
     336 
     337         for ( it=begin ; it != end; it++) 
    324338         { 
    325339           *oss2<<", "<<it->second->getName()<<"_" ; 
    326            if (oss2->str().size()>90)  
    327            { 
    328              oss<<oss2->str()<<"  &"<<iendl ; 
    329              delete oss2 ; 
    330              oss2=new ostringstream ; 
    331            } 
    332          } 
    333          *oss2<<" )" ; 
    334          oss<<oss2->str()<<iendl ; 
    335          oss<<iendl ; 
    336          delete oss2 ;  
    337           
     340           if (oss2->str().size()>90) 
     341           { 
     342             oss<<oss2->str()<<"  &"<<iendl ; 
     343             delete oss2 ; 
     344             oss2=new ostringstream ; 
     345           } 
     346         } 
     347         *oss2<<" )" ; 
     348         oss<<oss2->str()<<iendl ; 
     349         oss<<iendl ; 
     350         delete oss2 ; 
     351 
    338352         oss<<"IMPLICIT NONE"<<iendl++ ; 
    339353         oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ; 
    340           
     354 
    341355         for (it=begin; it != end; it++) 
    342356         { 
    343357           it->second->generateFortranInterfaceIsDefinedDeclaration_(oss,className) ; 
    344358         } 
    345           
    346          oss<<iendl ; 
    347           
     359 
     360         oss<<iendl ; 
     361 
    348362         for (it=begin; it != end; it++) 
    349363         { 
     
    351365           oss<<iendl ; 
    352366         } 
    353           
     367 
    354368         oss<<iendl--<<iendl-- ; 
    355369         oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl_)"<<iendl ; 
    356           
    357       }       
    358         
     370 
     371      } 
     372 
    359373 
    360374      void CAttributeMap::generateFortranInterface_hdl(ostream& oss, const string& className) 
     
    364378         SuperClassMap::const_iterator it ; 
    365379         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    366           
    367          oss2=new ostringstream ; 
    368          *oss2<<"( "<<className<<"_hdl"  ; 
    369          for ( it=begin ; it != end; it++)  
    370          { 
    371            *oss2<<", "<<it->second->getName() ; 
    372            if (oss2->str().size()>90)  
    373            { 
    374              oss<<oss2->str()<<"  &"<<iendl ; 
    375              delete oss2 ; 
    376              oss2=new ostringstream ; 
    377            } 
    378          } 
    379          *oss2<<" )" ; 
    380          oss<<oss2->str()<<iendl ; 
    381          oss<<iendl ; 
    382          delete oss2 ;  
    383          oss2=new ostringstream ; 
    384           
     380 
     381         oss2=new ostringstream ; 
     382         *oss2<<"( "<<className<<"_hdl"  ; 
     383         for ( it=begin ; it != end; it++) 
     384         { 
     385           *oss2<<", "<<it->second->getName() ; 
     386           if (oss2->str().size()>90) 
     387           { 
     388             oss<<oss2->str()<<"  &"<<iendl ; 
     389             delete oss2 ; 
     390             oss2=new ostringstream ; 
     391           } 
     392         } 
     393         *oss2<<" )" ; 
     394         oss<<oss2->str()<<iendl ; 
     395         oss<<iendl ; 
     396         delete oss2 ; 
     397         oss2=new ostringstream ; 
     398 
    385399         oss<<"IMPLICIT NONE"<<iendl++ ; 
    386400         oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ; 
    387           
     401 
    388402         for (it=begin; it != end; it++) 
    389403         { 
    390404           it->second->generateFortranInterfaceDeclaration(oss,className) ; 
    391405         } 
    392           
    393          oss<<iendl ; 
    394           
     406 
     407         oss<<iendl ; 
     408 
    395409         oss<<"CALL xios(set_"<<className<<"_attr_hdl_)  &"<<iendl ; 
    396           
    397          *oss2<<"( "<<className<<"_hdl"  ; 
    398          for ( it=begin ; it != end; it++)  
    399          { 
    400            *oss2<<", "<<it->second->getName() ; 
    401            if (oss2->str().size()>90)  
     410 
     411         *oss2<<"( "<<className<<"_hdl"  ; 
     412         for ( it=begin ; it != end; it++) 
     413         { 
     414           *oss2<<", "<<it->second->getName() ; 
     415           if (oss2->str().size()>90) 
    402416           { 
    403417             oss<<oss2->str()<<"  &"<<iendl ; 
     
    408422         *oss2<<" )" ; 
    409423         oss<<oss2->str() ; 
    410          delete oss2 ;  
    411           
     424         delete oss2 ; 
     425 
    412426         oss<<iendl--<<iendl-- ; 
    413427         oss<<"END SUBROUTINE xios(set_"<<className<<"_attr_hdl)"<<iendl ; 
    414       }       
    415        
    416   
     428      } 
     429 
     430 
    417431      void CAttributeMap::generateFortranInterfaceGet_hdl(ostream& oss, const string& className) 
    418432      { 
     
    421435         SuperClassMap::const_iterator it ; 
    422436         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    423           
    424          oss2=new ostringstream ; 
    425          *oss2<<"( "<<className<<"_hdl"  ; 
    426          for ( it=begin ; it != end; it++)  
    427          { 
    428            *oss2<<", "<<it->second->getName() ; 
    429            if (oss2->str().size()>90)  
    430            { 
    431              oss<<oss2->str()<<"  &"<<iendl ; 
    432              delete oss2 ; 
    433              oss2=new ostringstream ; 
    434            } 
    435          } 
    436          *oss2<<" )" ; 
    437          oss<<oss2->str()<<iendl ; 
    438          oss<<iendl ; 
    439          delete oss2 ;  
    440          oss2=new ostringstream ; 
    441           
     437 
     438         oss2=new ostringstream ; 
     439         *oss2<<"( "<<className<<"_hdl"  ; 
     440         for ( it=begin ; it != end; it++) 
     441         { 
     442           *oss2<<", "<<it->second->getName() ; 
     443           if (oss2->str().size()>90) 
     444           { 
     445             oss<<oss2->str()<<"  &"<<iendl ; 
     446             delete oss2 ; 
     447             oss2=new ostringstream ; 
     448           } 
     449         } 
     450         *oss2<<" )" ; 
     451         oss<<oss2->str()<<iendl ; 
     452         oss<<iendl ; 
     453         delete oss2 ; 
     454         oss2=new ostringstream ; 
     455 
    442456         oss<<"IMPLICIT NONE"<<iendl++ ; 
    443457         oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ; 
    444           
     458 
    445459         for (it=begin; it != end; it++) 
    446460         { 
    447461           it->second->generateFortranInterfaceGetDeclaration(oss,className) ; 
    448462         } 
    449           
    450          oss<<iendl ; 
    451           
     463 
     464         oss<<iendl ; 
     465 
    452466         oss<<"CALL xios(get_"<<className<<"_attr_hdl_)  &"<<iendl ; 
    453           
    454          *oss2<<"( "<<className<<"_hdl"  ; 
    455          for ( it=begin ; it != end; it++)  
    456          { 
    457            *oss2<<", "<<it->second->getName() ; 
    458            if (oss2->str().size()>90)  
     467 
     468         *oss2<<"( "<<className<<"_hdl"  ; 
     469         for ( it=begin ; it != end; it++) 
     470         { 
     471           *oss2<<", "<<it->second->getName() ; 
     472           if (oss2->str().size()>90) 
    459473           { 
    460474             oss<<oss2->str()<<"  &"<<iendl ; 
     
    465479         *oss2<<" )" ; 
    466480         oss<<oss2->str() ; 
    467          delete oss2 ;  
    468           
     481         delete oss2 ; 
     482 
    469483         oss<<iendl--<<iendl-- ; 
    470484         oss<<"END SUBROUTINE xios(get_"<<className<<"_attr_hdl)"<<iendl ; 
    471       }       
     485      } 
    472486 
    473487 
     
    478492         SuperClassMap::const_iterator it ; 
    479493         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    480           
    481          oss2=new ostringstream ; 
    482          *oss2<<"( "<<className<<"_hdl"  ; 
    483          for ( it=begin ; it != end; it++)  
    484          { 
    485            *oss2<<", "<<it->second->getName() ; 
    486            if (oss2->str().size()>90)  
    487            { 
    488              oss<<oss2->str()<<"  &"<<iendl ; 
    489              delete oss2 ; 
    490              oss2=new ostringstream ; 
    491            } 
    492          } 
    493          *oss2<<" )" ; 
    494          oss<<oss2->str()<<iendl ; 
    495          oss<<iendl ; 
    496          delete oss2 ;  
    497          oss2=new ostringstream ; 
    498           
     494 
     495         oss2=new ostringstream ; 
     496         *oss2<<"( "<<className<<"_hdl"  ; 
     497         for ( it=begin ; it != end; it++) 
     498         { 
     499           *oss2<<", "<<it->second->getName() ; 
     500           if (oss2->str().size()>90) 
     501           { 
     502             oss<<oss2->str()<<"  &"<<iendl ; 
     503             delete oss2 ; 
     504             oss2=new ostringstream ; 
     505           } 
     506         } 
     507         *oss2<<" )" ; 
     508         oss<<oss2->str()<<iendl ; 
     509         oss<<iendl ; 
     510         delete oss2 ; 
     511         oss2=new ostringstream ; 
     512 
    499513         oss<<"IMPLICIT NONE"<<iendl++ ; 
    500514         oss<<"TYPE(txios("<<className<<")) , INTENT(IN) :: "<<className<<"_hdl"<<iendl ; 
    501           
     515 
    502516         for (it=begin; it != end; it++) 
    503517         { 
    504518           it->second->generateFortranInterfaceIsDefinedDeclaration(oss,className) ; 
    505519         } 
    506           
    507          oss<<iendl ; 
    508           
     520 
     521         oss<<iendl ; 
     522 
    509523         oss<<"CALL xios(is_defined_"<<className<<"_attr_hdl_)  &"<<iendl ; 
    510           
    511          *oss2<<"( "<<className<<"_hdl"  ; 
    512          for ( it=begin ; it != end; it++)  
    513          { 
    514            *oss2<<", "<<it->second->getName() ; 
    515            if (oss2->str().size()>90)  
     524 
     525         *oss2<<"( "<<className<<"_hdl"  ; 
     526         for ( it=begin ; it != end; it++) 
     527         { 
     528           *oss2<<", "<<it->second->getName() ; 
     529           if (oss2->str().size()>90) 
    516530           { 
    517531             oss<<oss2->str()<<"  &"<<iendl ; 
     
    522536         *oss2<<" )" ; 
    523537         oss<<oss2->str() ; 
    524          delete oss2 ;  
    525           
     538         delete oss2 ; 
     539 
    526540         oss<<iendl--<<iendl-- ; 
    527541         oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr_hdl)"<<iendl ; 
    528       }       
    529  
    530        
     542      } 
     543 
     544 
    531545      void CAttributeMap::generateFortranInterface_id(ostream& oss, const string& className) 
    532546      { 
     
    535549         SuperClassMap::const_iterator it ; 
    536550         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    537           
     551 
    538552         oss2=new ostringstream ; 
    539553         *oss2<<"( "<<className<<"_id"  ; 
    540          for ( it=begin ; it != end; it++)  
    541          { 
    542            *oss2<<", "<<it->second->getName() ; 
    543            if (oss2->str().size()>90)  
    544            { 
    545              oss<<oss2->str()<<"  &"<<iendl ; 
    546              delete oss2 ; 
    547              oss2=new ostringstream ; 
    548            } 
    549          } 
    550          *oss2<<" )" ; 
    551          oss<<oss2->str()<<iendl ; 
    552          oss<<iendl ; 
    553          delete oss2 ;  
    554          oss2=new ostringstream ; 
    555           
     554         for ( it=begin ; it != end; it++) 
     555         { 
     556           *oss2<<", "<<it->second->getName() ; 
     557           if (oss2->str().size()>90) 
     558           { 
     559             oss<<oss2->str()<<"  &"<<iendl ; 
     560             delete oss2 ; 
     561             oss2=new ostringstream ; 
     562           } 
     563         } 
     564         *oss2<<" )" ; 
     565         oss<<oss2->str()<<iendl ; 
     566         oss<<iendl ; 
     567         delete oss2 ; 
     568         oss2=new ostringstream ; 
     569 
    556570         oss<<"IMPLICIT NONE"<<iendl++ ; 
    557571 
    558572         oss<<"TYPE(txios("<<className<<"))  :: "<<className<<"_hdl"<<iendl ; 
    559573         oss<<"CHARACTER(LEN=*), INTENT(IN) ::"<<className<<"_id"<<iendl ; 
    560           
     574 
    561575         for (it=begin; it != end; it++) 
    562576         { 
    563577           it->second->generateFortranInterfaceDeclaration(oss,className) ; 
    564578         } 
    565           
    566          oss<<iendl ; 
    567          oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ;  
     579 
     580         oss<<iendl ; 
     581         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ; 
    568582         oss<<"CALL xios(set_"<<className<<"_attr_hdl_)   &"<<iendl ; 
    569583         *oss2<<"( "<<className<<"_hdl"  ; 
    570          for ( it=begin ; it != end; it++)  
    571          { 
    572            *oss2<<", "<<it->second->getName() ; 
    573            if (oss2->str().size()>90)  
     584         for ( it=begin ; it != end; it++) 
     585         { 
     586           *oss2<<", "<<it->second->getName() ; 
     587           if (oss2->str().size()>90) 
    574588           { 
    575589             oss<<oss2->str()<<"  &"<<iendl ; 
     
    580594         *oss2<<" )" ; 
    581595         oss<<oss2->str() ; 
    582          delete oss2 ;  
    583           
     596         delete oss2 ; 
     597 
    584598         oss<<iendl--<<iendl-- ; 
    585599         oss<<"END SUBROUTINE xios(set_"<<className<<"_attr)"<<iendl ; 
    586           
    587       }       
    588        
     600 
     601      } 
     602 
    589603      void CAttributeMap::generateFortranInterfaceGet_id(ostream& oss, const string& className) 
    590604      { 
     
    593607         SuperClassMap::const_iterator it ; 
    594608         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    595           
     609 
    596610         oss2=new ostringstream ; 
    597611         *oss2<<"( "<<className<<"_id"  ; 
    598          for ( it=begin ; it != end; it++)  
    599          { 
    600            *oss2<<", "<<it->second->getName() ; 
    601            if (oss2->str().size()>90)  
    602            { 
    603              oss<<oss2->str()<<"  &"<<iendl ; 
    604              delete oss2 ; 
    605              oss2=new ostringstream ; 
    606            } 
    607          } 
    608          *oss2<<" )" ; 
    609          oss<<oss2->str()<<iendl ; 
    610          oss<<iendl ; 
    611          delete oss2 ;  
    612          oss2=new ostringstream ; 
    613           
     612         for ( it=begin ; it != end; it++) 
     613         { 
     614           *oss2<<", "<<it->second->getName() ; 
     615           if (oss2->str().size()>90) 
     616           { 
     617             oss<<oss2->str()<<"  &"<<iendl ; 
     618             delete oss2 ; 
     619             oss2=new ostringstream ; 
     620           } 
     621         } 
     622         *oss2<<" )" ; 
     623         oss<<oss2->str()<<iendl ; 
     624         oss<<iendl ; 
     625         delete oss2 ; 
     626         oss2=new ostringstream ; 
     627 
    614628         oss<<"IMPLICIT NONE"<<iendl++ ; 
    615629 
    616630         oss<<"TYPE(txios("<<className<<"))  :: "<<className<<"_hdl"<<iendl ; 
    617631         oss<<"CHARACTER(LEN=*), INTENT(IN) ::"<<className<<"_id"<<iendl ; 
    618           
     632 
    619633         for (it=begin; it != end; it++) 
    620634         { 
    621635           it->second->generateFortranInterfaceGetDeclaration(oss,className) ; 
    622636         } 
    623           
    624          oss<<iendl ; 
    625          oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ;  
     637 
     638         oss<<iendl ; 
     639         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ; 
    626640         oss<<"CALL xios(get_"<<className<<"_attr_hdl_)   &"<<iendl ; 
    627641         *oss2<<"( "<<className<<"_hdl"  ; 
    628          for ( it=begin ; it != end; it++)  
    629          { 
    630            *oss2<<", "<<it->second->getName() ; 
    631            if (oss2->str().size()>90)  
     642         for ( it=begin ; it != end; it++) 
     643         { 
     644           *oss2<<", "<<it->second->getName() ; 
     645           if (oss2->str().size()>90) 
    632646           { 
    633647             oss<<oss2->str()<<"  &"<<iendl ; 
     
    638652         *oss2<<" )" ; 
    639653         oss<<oss2->str() ; 
    640          delete oss2 ;  
    641           
     654         delete oss2 ; 
     655 
    642656         oss<<iendl--<<iendl-- ; 
    643657         oss<<"END SUBROUTINE xios(get_"<<className<<"_attr)"<<iendl ; 
    644           
    645       }       
    646        
     658 
     659      } 
     660 
    647661      void CAttributeMap::generateFortranInterfaceIsDefined_id(ostream& oss, const string& className) 
    648662      { 
     
    651665         SuperClassMap::const_iterator it ; 
    652666         SuperClassMap::const_iterator begin = SuperClassMap::begin(), end = SuperClassMap::end(); 
    653           
     667 
    654668         oss2=new ostringstream ; 
    655669         *oss2<<"( "<<className<<"_id"  ; 
    656          for ( it=begin ; it != end; it++)  
    657          { 
    658            *oss2<<", "<<it->second->getName() ; 
    659            if (oss2->str().size()>90)  
    660            { 
    661              oss<<oss2->str()<<"  &"<<iendl ; 
    662              delete oss2 ; 
    663              oss2=new ostringstream ; 
    664            } 
    665          } 
    666          *oss2<<" )" ; 
    667          oss<<oss2->str()<<iendl ; 
    668          oss<<iendl ; 
    669          delete oss2 ;  
    670          oss2=new ostringstream ; 
    671           
     670         for ( it=begin ; it != end; it++) 
     671         { 
     672           *oss2<<", "<<it->second->getName() ; 
     673           if (oss2->str().size()>90) 
     674           { 
     675             oss<<oss2->str()<<"  &"<<iendl ; 
     676             delete oss2 ; 
     677             oss2=new ostringstream ; 
     678           } 
     679         } 
     680         *oss2<<" )" ; 
     681         oss<<oss2->str()<<iendl ; 
     682         oss<<iendl ; 
     683         delete oss2 ; 
     684         oss2=new ostringstream ; 
     685 
    672686         oss<<"IMPLICIT NONE"<<iendl++ ; 
    673687 
    674688         oss<<"TYPE(txios("<<className<<"))  :: "<<className<<"_hdl"<<iendl ; 
    675689         oss<<"CHARACTER(LEN=*), INTENT(IN) ::"<<className<<"_id"<<iendl ; 
    676           
     690 
    677691         for (it=begin; it != end; it++) 
    678692         { 
    679693           it->second->generateFortranInterfaceIsDefinedDeclaration(oss,className) ; 
    680694         } 
    681           
    682          oss<<iendl ; 
    683          oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ;  
     695 
     696         oss<<iendl ; 
     697         oss<<"CALL xios(get_"<<className<<"_handle)("<<className<<"_id,"<<className<<"_hdl)"<<iendl ; 
    684698         oss<<"CALL xios(is_defined_"<<className<<"_attr_hdl_)   &"<<iendl ; 
    685699         *oss2<<"( "<<className<<"_hdl"  ; 
    686          for ( it=begin ; it != end; it++)  
    687          { 
    688            *oss2<<", "<<it->second->getName() ; 
    689            if (oss2->str().size()>90)  
     700         for ( it=begin ; it != end; it++) 
     701         { 
     702           *oss2<<", "<<it->second->getName() ; 
     703           if (oss2->str().size()>90) 
    690704           { 
    691705             oss<<oss2->str()<<"  &"<<iendl ; 
     
    696710         *oss2<<" )" ; 
    697711         oss<<oss2->str() ; 
    698          delete oss2 ;  
    699           
     712         delete oss2 ; 
     713 
    700714         oss<<iendl--<<iendl-- ; 
    701715         oss<<"END SUBROUTINE xios(is_defined_"<<className<<"_attr)"<<iendl ; 
    702           
    703       }       
     716 
     717      } 
    704718      ///-------------------------------------------------------------- 
    705    
     719 
    706720 
    707721} // namespace xmlioser 
Note: See TracChangeset for help on using the changeset viewer.