Changeset 778


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.

Location:
XIOS/trunk/src
Files:
1 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/attribute.hpp

    r591 r778  
    5252//            virtual void toBinary  (StdOStream & os) const = 0; 
    5353//            virtual void fromBinary(StdIStream & is) = 0; 
     54 
     55            //! Returns true if and only if the attribute should be publicly exposed in the API 
     56            virtual bool isPublic() const { return true; } 
    5457 
    5558            virtual void generateCInterface(ostream& oss, const string& className) = 0 ; 
  • XIOS/trunk/src/attribute_array.hpp

    r775 r778  
    1515      /// ////////////////////// Déclarations ////////////////////// /// 
    1616      template <typename T_numtype, int N_rank> 
    17          class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank>, public PublicAttributes 
     17         class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> 
    1818      { 
    1919        public : 
  • XIOS/trunk/src/attribute_array_impl.hpp

    r775 r778  
    133133      void CAttributeArray<T_numtype, N_rank>::generateCInterface(ostream& oss,const string& className) 
    134134      { 
    135         if (this->isAttributePublic()) 
    136           CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 
     135        CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 
    137136      } 
    138137 
     
    140139      void CAttributeArray<T_numtype, N_rank>::generateFortran2003Interface(ostream& oss,const string& className) 
    141140      { 
    142         if (this->isAttributePublic()) 
    143           CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 
     141        CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 
    144142      } 
    145143 
     
    147145      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className) 
    148146      { 
    149         if (this->isAttributePublic()) 
    150           CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 
     147        CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName() + "_"); 
    151148      } 
    152149 
     
    154151      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceBody_(ostream& oss,const string& className) 
    155152      { 
    156         if (this->isAttributePublic()) 
    157           CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 
     153        CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 
    158154      } 
    159155 
     
    161157      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration(ostream& oss,const string& className) 
    162158      { 
    163         if (this->isAttributePublic()) 
    164           CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 
     159        CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 
    165160      } 
    166161 
     
    168163      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) 
    169164      { 
    170         if (this->isAttributePublic()) 
    171           CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ; 
     165        CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName() + "_"); 
    172166      } 
    173167 
     
    175169      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetBody_(ostream& oss,const string& className) 
    176170      { 
    177         if (this->isAttributePublic()) 
    178           CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 
     171        CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 
    179172      } 
    180173 
     
    182175      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) 
    183176      { 
    184         if (this->isAttributePublic()) 
    185           CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ; 
     177        CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()); 
    186178      } 
    187179} // namespace xios 
  • 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         } 
  • XIOS/trunk/src/attribute_template.hpp

    r775 r778  
    1818      /// ////////////////////// Déclarations ////////////////////// /// 
    1919      template <class T> 
    20          class CAttributeTemplate : public CAttribute, public CType<T>, public PublicAttributes 
     20         class CAttributeTemplate : public CAttribute, public CType<T> 
    2121      { 
    2222            typedef CAttribute SuperClass; 
  • XIOS/trunk/src/attribute_template_impl.hpp

    r775 r778  
    245245      void CAttributeTemplate<T>::generateCInterface(ostream& oss,const string& className) 
    246246      { 
    247         if (this->isAttributePublic()) 
    248           CInterface::AttributeCInterface<T>(oss, className, this->getName()) ; 
    249 //        CInterface::AttributeIsDefinedCInterface(oss, className, this->getName()) ; 
     247        CInterface::AttributeCInterface<T>(oss, className, this->getName()); 
    250248      } 
    251249 
     
    253251      void CAttributeTemplate<T>::generateFortran2003Interface(ostream& oss,const string& className) 
    254252      { 
    255         if (this->isAttributePublic()) 
    256           CInterface::AttributeFortran2003Interface<T>(oss, className, this->getName()) ; 
    257 //        CInterface::AttributeIsDefinedFortran2003Interface(oss, className, this->getName()) ; 
     253        CInterface::AttributeFortran2003Interface<T>(oss, className, this->getName()); 
    258254      } 
    259255 
     
    261257      void CAttributeTemplate<T>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className) 
    262258      { 
    263         if (this->isAttributePublic()) 
    264           CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()+"_") ; 
     259        CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName() + "_"); 
    265260      } 
    266261 
     
    268263      void CAttributeTemplate<T>::generateFortranInterfaceBody_(ostream& oss,const string& className) 
    269264      { 
    270         if (this->isAttributePublic()) 
    271           CInterface::AttributeFortranInterfaceBody<T>(oss, className, this->getName()) ; 
     265        CInterface::AttributeFortranInterfaceBody<T>(oss, className, this->getName()); 
    272266      } 
    273267 
     
    275269      void CAttributeTemplate<T>::generateFortranInterfaceDeclaration(ostream& oss,const string& className) 
    276270      { 
    277         if (this->isAttributePublic()) 
    278           CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()) ; 
     271        CInterface::AttributeFortranInterfaceDeclaration<T>(oss, className, this->getName()); 
    279272      } 
    280273 
     
    282275      void CAttributeTemplate<T>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) 
    283276      { 
    284         if (this->isAttributePublic()) 
    285           CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()+"_") ; 
     277        CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName() + "_"); 
    286278      } 
    287279 
     
    290282      void CAttributeTemplate<T>::generateFortranInterfaceGetBody_(ostream& oss,const string& className) 
    291283      { 
    292         if (this->isAttributePublic()) 
    293           CInterface::AttributeFortranInterfaceGetBody<T>(oss, className, this->getName()) ; 
     284        CInterface::AttributeFortranInterfaceGetBody<T>(oss, className, this->getName()); 
    294285      } 
    295286 
     
    297288      void CAttributeTemplate<T>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) 
    298289      { 
    299         if (this->isAttributePublic()) 
    300           CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()) ; 
     290        CInterface::AttributeFortranInterfaceGetDeclaration<T>(oss, className, this->getName()); 
    301291      } 
    302292 
  • XIOS/trunk/src/declare_attribute.hpp

    r775 r778  
    2727         type operator=(const type & value)                       \ 
    2828         { return (CAttributeTemplate<type>::operator=(value)); } \ 
    29          virtual bool isAttributePublic()                         \ 
     29         virtual bool isPublic() const                            \ 
    3030         { return false; }                                        \ 
    3131         virtual ~name##_attr(void)                               \ 
     
    4848         using CAttributeArray<T_num, T_rank>::operator = ;       \ 
    4949         name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \ 
    50          virtual bool isAttributePublic()                         \ 
     50         virtual bool isPublic() const                            \ 
    5151         { return false; }                                        \ 
    5252         virtual ~name##_attr(void) {}                            \ 
Note: See TracChangeset for help on using the changeset viewer.