Psi4
ParallelPrinter.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 #ifndef PARALLELPRINTER_H_
29 #define PARALLELPRINTER_H_
30 
31 #include "PsiOutStream.h"
32 #include "PsiFileImpl.h"
33 #include <fstream>
34 
35 namespace psi{
36 
37 
60 class OutFile: public PsiOutStream,private PsiFileImpl<std::ofstream>{
61  private:
63 
64  public:
83  OutFile(const std::string& filename="",const FileMode& mode=APPEND);
84 
87 
89  void Open(const std::string& filename,const FileMode& mode);
90 
92  void Close();
93 };
94 
95 }//End namespace psi
96 #endif /* PARALLELPRINTER_H_ */
PsiFileImpl< std::ofstream > FileBase
Definition: ParallelPrinter.h:62
~OutFile()
Calls Close to release memory.
Definition: ParallelPrinter.h:86
The machinery common to input and output files.
Definition: PsiFileImpl.h:44
The interface to the new Psi4 ASCII outfile writer.
Definition: ParallelPrinter.h:60
Definition: PsiFileImpl.h:39
FileMode
For each value the first name is preferred, but let&#39;s face it typing stinks.
Definition: PsiFileImpl.h:39
void Open(const std::string &filename, const FileMode &mode)
Opens &quot;filename&quot; in write mode &quot;mode&quot;.
Definition: ParallelPrinter.cc:46
Specialization of PsiStream to output streams.
Definition: PsiOutStream.h:36
void Close()
Closes file and frees Stream_ pointer.
Definition: ParallelPrinter.cc:41
OutFile(const std::string &filename="", const FileMode &mode=APPEND)
Constructor that opens a file with name &quot;filename&quot;.
Definition: ParallelPrinter.cc:36