|
EpetraExt Development
|
00001 #ifndef EPETRAEXT_XMLWRITER_H 00002 #define EPETRAEXT_XMLWRITER_H 00003 00004 #include "EpetraExt_ConfigDefs.h" 00005 #include "Teuchos_RefCountPtr.hpp" 00006 #include <fstream> 00007 00008 class Epetra_Map; 00009 class Epetra_Comm; 00010 class Epetra_Map; 00011 class Epetra_MultiVector; 00012 class Epetra_CrsGraph; 00013 class Epetra_RowMatrix; 00014 namespace Teuchos { 00015 class FileXML; 00016 class XMLObject; 00017 class ParameterList; 00018 } 00019 00020 namespace EpetraExt 00021 { 00124 class XMLWriter 00125 { 00126 public: 00127 // @{ \name Constructor and destructor. 00129 XMLWriter(const Epetra_Comm& Comm, const std::string& FileName); 00130 00132 ~XMLWriter() {} 00133 00135 void Create(const std::string& Label); 00136 00138 void Close(); 00139 00140 // @} 00141 // @{ \name Read operations 00142 00144 void Write(const std::string& Label, const Epetra_Map& Map); 00145 00147 void Write(const std::string& Label, const Epetra_RowMatrix& Matrix); 00148 00150 void Write(const std::string& Label, const Epetra_MultiVector& MultiVector); 00151 00153 void Write(const std::string& Label, const std::vector<std::string>& Content); 00154 00156 void Write(const std::string& Label, const std::string& Text) 00157 { 00158 std::vector<std::string> Content; 00159 Content.push_back(Text); 00160 Write(Label, Content); 00161 } 00162 00164 void Write(const std::string& Label, Teuchos::ParameterList& List); 00165 00166 // @} 00167 private: 00169 const Epetra_Comm& Comm_; 00171 std::string FileName_; 00173 bool IsOpen_; 00174 }; 00175 00176 } // namespace EpetraExt 00177 00178 #endif
1.7.4