Ignore:
Timestamp:
11/04/15 15:50:19 (8 years ago)
Author:
rlacroix
Message:

Fix the generation of the Fortran interface to support private attributes.

File:
1 edited

Legend:

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

    r649 r778  
    226226         for (; it != end; it++) 
    227227         { 
    228            oss << std::endl << iendl; 
    229            it->second->generateCInterface(oss, className); 
    230            oss << iendl; 
    231            it->second->generateCInterfaceIsDefined(oss, className); 
     228           if (it->second->isPublic()) 
     229           { 
     230             oss << std::endl << iendl; 
     231             it->second->generateCInterface(oss, className); 
     232             oss << iendl; 
     233             it->second->generateCInterfaceIsDefined(oss, className); 
     234           } 
    232235         } 
    233236      } 
     
    238241         for (; it != end; it++) 
    239242         { 
    240            oss << std::endl << iendl; 
    241            it->second->generateFortran2003Interface(oss, className); 
    242            oss << iendl; 
    243            it->second->generateFortran2003InterfaceIsDefined(oss, className); 
     243           if (it->second->isPublic()) 
     244           { 
     245             oss << std::endl << iendl; 
     246             it->second->generateFortran2003Interface(oss, className); 
     247             oss << iendl; 
     248             it->second->generateFortran2003InterfaceIsDefined(oss, className); 
     249           } 
    244250         } 
    245251      } 
     
    258264         for (it = begin; it != end; it++) 
    259265         { 
    260            oss << ", " << it->second->getName() << "_"; 
    261            if (oss.tellp() - startPos > 90) 
    262            { 
    263              oss << "  &" << iendl; 
    264              startPos = oss.tellp(); 
     266           if (it->second->isPublic()) 
     267           { 
     268             oss << ", " << it->second->getName() << "_"; 
     269             if (oss.tellp() - startPos > 90) 
     270             { 
     271               oss << "  &" << iendl; 
     272               startPos = oss.tellp(); 
     273             } 
    265274           } 
    266275         } 
     
    274283         for (it = begin; it != end; it++) 
    275284         { 
    276            oss << iendl; 
    277            it->second->generateFortranInterfaceDeclaration_(oss, className); 
    278          } 
    279  
    280          for (it = begin; it != end; it++) 
    281          { 
    282            oss << std::endl << iendl; 
    283            it->second->generateFortranInterfaceBody_(oss, className); 
     285           if (it->second->isPublic()) 
     286           { 
     287             oss << iendl; 
     288             it->second->generateFortranInterfaceDeclaration_(oss, className); 
     289           } 
     290         } 
     291 
     292         for (it = begin; it != end; it++) 
     293         { 
     294           if (it->second->isPublic()) 
     295           { 
     296             oss << std::endl << iendl; 
     297             it->second->generateFortranInterfaceBody_(oss, className); 
     298           } 
    284299         } 
    285300 
     
    299314         for (it = begin; it != end; it++) 
    300315         { 
    301            oss << ", " << it->second->getName() << "_"; 
    302            if (oss.tellp() - startPos > 90) 
    303            { 
    304              oss << "  &" << iendl; 
    305              startPos = oss.tellp(); 
     316           if (it->second->isPublic()) 
     317           { 
     318             oss << ", " << it->second->getName() << "_"; 
     319             if (oss.tellp() - startPos > 90) 
     320             { 
     321               oss << "  &" << iendl; 
     322               startPos = oss.tellp(); 
     323             } 
    306324           } 
    307325         } 
     
    315333         for (it = begin; it != end; it++) 
    316334         { 
    317            oss << iendl; 
    318            it->second->generateFortranInterfaceGetDeclaration_(oss, className); 
    319          } 
    320  
    321          for (it = begin; it != end; it++) 
    322          { 
    323            oss << std::endl << iendl; 
    324            it->second->generateFortranInterfaceGetBody_(oss, className); 
     335           if (it->second->isPublic()) 
     336           { 
     337             oss << iendl; 
     338             it->second->generateFortranInterfaceGetDeclaration_(oss, className); 
     339           } 
     340         } 
     341 
     342         for (it = begin; it != end; it++) 
     343         { 
     344           if (it->second->isPublic()) 
     345           { 
     346             oss << std::endl << iendl; 
     347             it->second->generateFortranInterfaceGetBody_(oss, className); 
     348           } 
    325349         } 
    326350 
     
    340364         for (it = begin; it != end; it++) 
    341365         { 
    342            oss << ", " << it->second->getName() << "_"; 
    343            if (oss.tellp() - startPos > 90) 
    344            { 
    345              oss << "  &" << iendl; 
    346              startPos = oss.tellp(); 
     366           if (it->second->isPublic()) 
     367           { 
     368             oss << ", " << it->second->getName() << "_"; 
     369             if (oss.tellp() - startPos > 90) 
     370             { 
     371               oss << "  &" << iendl; 
     372               startPos = oss.tellp(); 
     373             } 
    347374           } 
    348375         } 
     
    356383         for (it = begin; it != end; it++) 
    357384         { 
    358            oss << iendl; 
    359            it->second->generateFortranInterfaceIsDefinedDeclaration_(oss, className); 
    360          } 
    361  
    362          for (it = begin; it != end; it++) 
    363          { 
    364            oss << std::endl << iendl; 
    365            it->second->generateFortranInterfaceIsDefinedBody_(oss, className); 
     385           if (it->second->isPublic()) 
     386           { 
     387             oss << iendl; 
     388             it->second->generateFortranInterfaceIsDefinedDeclaration_(oss, className); 
     389           } 
     390         } 
     391 
     392         for (it = begin; it != end; it++) 
     393         { 
     394           if (it->second->isPublic()) 
     395           { 
     396             oss << std::endl << iendl; 
     397             it->second->generateFortranInterfaceIsDefinedBody_(oss, className); 
     398           } 
    366399         } 
    367400 
     
    381414         for (it = begin; it != end; it++) 
    382415         { 
    383            oss << ", " << it->second->getName(); 
    384            if (oss.tellp() - startPos > 90) 
    385            { 
    386              oss << "  &" << iendl; 
    387              startPos = oss.tellp(); 
     416           if (it->second->isPublic()) 
     417           { 
     418             oss << ", " << it->second->getName(); 
     419             if (oss.tellp() - startPos > 90) 
     420             { 
     421               oss << "  &" << iendl; 
     422               startPos = oss.tellp(); 
     423             } 
    388424           } 
    389425         } 
     
    397433         for (it = begin; it != end; it++) 
    398434         { 
    399            oss << iendl; 
    400            it->second->generateFortranInterfaceDeclaration(oss, className); 
     435           if (it->second->isPublic()) 
     436           { 
     437             oss << iendl; 
     438             it->second->generateFortranInterfaceDeclaration(oss, className); 
     439           } 
    401440         } 
    402441 
     
    410449         for (it = begin; it != end; it++) 
    411450         { 
    412            oss << ", " << it->second->getName(); 
    413            if (oss.tellp() - startPos > 90) 
    414            { 
    415              oss << "  &" << iendl; 
    416              startPos = oss.tellp(); 
     451           if (it->second->isPublic()) 
     452           { 
     453             oss << ", " << it->second->getName(); 
     454             if (oss.tellp() - startPos > 90) 
     455             { 
     456               oss << "  &" << iendl; 
     457               startPos = oss.tellp(); 
     458             } 
    417459           } 
    418460         } 
     
    434476         for (it = begin; it != end; it++) 
    435477         { 
    436            oss << ", " << it->second->getName(); 
    437            if (oss.tellp() - startPos > 90) 
    438            { 
    439              oss << "  &" << iendl; 
    440              startPos = oss.tellp(); 
     478           if (it->second->isPublic()) 
     479           { 
     480             oss << ", " << it->second->getName(); 
     481             if (oss.tellp() - startPos > 90) 
     482             { 
     483               oss << "  &" << iendl; 
     484               startPos = oss.tellp(); 
     485             } 
    441486           } 
    442487         } 
     
    450495         for (it = begin; it != end; it++) 
    451496         { 
    452            oss << iendl; 
    453            it->second->generateFortranInterfaceGetDeclaration(oss, className); 
     497           if (it->second->isPublic()) 
     498           { 
     499             oss << iendl; 
     500             it->second->generateFortranInterfaceGetDeclaration(oss, className); 
     501           } 
    454502         } 
    455503 
     
    463511         for (it = begin; it != end; it++) 
    464512         { 
    465            oss << ", " << it->second->getName(); 
    466            if (oss.tellp() - startPos > 90) 
    467            { 
    468              oss << "  &" << iendl; 
    469              startPos = oss.tellp(); 
     513           if (it->second->isPublic()) 
     514           { 
     515             oss << ", " << it->second->getName(); 
     516             if (oss.tellp() - startPos > 90) 
     517             { 
     518               oss << "  &" << iendl; 
     519               startPos = oss.tellp(); 
     520             } 
    470521           } 
    471522         } 
     
    487538         for (it = begin; it != end; it++) 
    488539         { 
    489            oss << ", " << it->second->getName(); 
    490            if (oss.tellp() - startPos > 90) 
    491            { 
    492              oss << "  &" << iendl; 
    493              startPos = oss.tellp(); 
     540           if (it->second->isPublic()) 
     541           { 
     542             oss << ", " << it->second->getName(); 
     543             if (oss.tellp() - startPos > 90) 
     544             { 
     545               oss << "  &" << iendl; 
     546               startPos = oss.tellp(); 
     547             } 
    494548           } 
    495549         } 
     
    503557         for (it = begin; it != end; it++) 
    504558         { 
    505            oss << iendl; 
    506            it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 
     559           if (it->second->isPublic()) 
     560           { 
     561             oss << iendl; 
     562             it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 
     563           } 
    507564         } 
    508565 
     
    516573         for (it = begin; it != end; it++) 
    517574         { 
    518            oss << ", " << it->second->getName(); 
    519            if (oss.tellp() - startPos > 90) 
    520            { 
    521              oss << "  &" << iendl; 
    522              startPos = oss.tellp(); 
     575           if (it->second->isPublic()) 
     576           { 
     577             oss << ", " << it->second->getName(); 
     578             if (oss.tellp() - startPos > 90) 
     579             { 
     580               oss << "  &" << iendl; 
     581               startPos = oss.tellp(); 
     582             } 
    523583           } 
    524584         } 
     
    540600         for (it = begin; it != end; it++) 
    541601         { 
    542            oss << ", " << it->second->getName(); 
    543            if (oss.tellp() - startPos > 90) 
    544            { 
    545              oss << "  &" << iendl; 
    546              startPos = oss.tellp(); 
     602           if (it->second->isPublic()) 
     603           { 
     604             oss << ", " << it->second->getName(); 
     605             if (oss.tellp() - startPos > 90) 
     606             { 
     607               oss << "  &" << iendl; 
     608               startPos = oss.tellp(); 
     609             } 
    547610           } 
    548611         } 
     
    558621         for (it = begin; it != end; it++) 
    559622         { 
    560            oss << iendl; 
    561            it->second->generateFortranInterfaceDeclaration(oss, className); 
     623           if (it->second->isPublic()) 
     624           { 
     625             oss << iendl; 
     626             it->second->generateFortranInterfaceDeclaration(oss, className); 
     627           } 
    562628         } 
    563629 
     
    571637         for (it = begin; it != end; it++) 
    572638         { 
    573            oss << ", " << it->second->getName(); 
    574            if (oss.tellp() - startPos > 90) 
    575            { 
    576              oss << "  &" << iendl; 
    577              startPos = oss.tellp(); 
     639           if (it->second->isPublic()) 
     640           { 
     641             oss << ", " << it->second->getName(); 
     642             if (oss.tellp() - startPos > 90) 
     643             { 
     644               oss << "  &" << iendl; 
     645               startPos = oss.tellp(); 
     646             } 
    578647           } 
    579648         } 
     
    595664         for (it = begin; it != end; it++) 
    596665         { 
    597            oss << ", " << it->second->getName(); 
    598            if (oss.tellp() - startPos > 90) 
    599            { 
    600              oss << "  &" << iendl; 
    601              startPos = oss.tellp(); 
     666           if (it->second->isPublic()) 
     667           { 
     668             oss << ", " << it->second->getName(); 
     669             if (oss.tellp() - startPos > 90) 
     670             { 
     671               oss << "  &" << iendl; 
     672               startPos = oss.tellp(); 
     673             } 
    602674           } 
    603675         } 
     
    613685         for (it = begin; it != end; it++) 
    614686         { 
    615            oss << iendl; 
    616            it->second->generateFortranInterfaceGetDeclaration(oss, className); 
     687           if (it->second->isPublic()) 
     688           { 
     689             oss << iendl; 
     690             it->second->generateFortranInterfaceGetDeclaration(oss, className); 
     691           } 
    617692         } 
    618693 
     
    626701         for (it = begin; it != end; it++) 
    627702         { 
    628            oss << ", " << it->second->getName(); 
    629            if (oss.tellp() - startPos > 90) 
    630            { 
    631              oss << "  &" << iendl; 
    632              startPos = oss.tellp(); 
     703           if (it->second->isPublic()) 
     704           { 
     705             oss << ", " << it->second->getName(); 
     706             if (oss.tellp() - startPos > 90) 
     707             { 
     708               oss << "  &" << iendl; 
     709               startPos = oss.tellp(); 
     710             } 
    633711           } 
    634712         } 
     
    650728         for (it = begin; it != end; it++) 
    651729         { 
    652            oss << ", " << it->second->getName(); 
    653            if (oss.tellp() - startPos > 90) 
    654            { 
    655              oss << "  &" << iendl; 
    656              startPos = oss.tellp(); 
     730           if (it->second->isPublic()) 
     731           { 
     732             oss << ", " << it->second->getName(); 
     733             if (oss.tellp() - startPos > 90) 
     734             { 
     735               oss << "  &" << iendl; 
     736               startPos = oss.tellp(); 
     737             } 
    657738           } 
    658739         } 
     
    668749         for (it = begin; it != end; it++) 
    669750         { 
    670            oss << iendl; 
    671            it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 
     751           if (it->second->isPublic()) 
     752           { 
     753             oss << iendl; 
     754             it->second->generateFortranInterfaceIsDefinedDeclaration(oss, className); 
     755           } 
    672756         } 
    673757 
     
    681765         for (it = begin; it != end; it++) 
    682766         { 
    683            oss << ", " << it->second->getName(); 
    684            if (oss.tellp() - startPos > 90) 
    685            { 
    686              oss << "  &" << iendl; 
    687              startPos = oss.tellp(); 
     767           if (it->second->isPublic()) 
     768           { 
     769             oss << ", " << it->second->getName(); 
     770             if (oss.tellp() - startPos > 90) 
     771             { 
     772               oss << "  &" << iendl; 
     773               startPos = oss.tellp(); 
     774             } 
    688775           } 
    689776         } 
Note: See TracChangeset for help on using the changeset viewer.