Psi4
ParallelScanner.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 program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 #ifndef PARALLELSCANNER_H_
28 #define PARALLELSCANNER_H_
29 
30 #include "PsiInStream.h"
31 #include "PsiFileImpl.h"
32 
33 namespace psi{
34 
58 class InFile: public PsiInStream,private PsiFileImpl<std::ifstream>{
59  private:
62 
63  public:
82  InFile(const std::string& filename="",const FileMode& mode=NOFILEMODE);
83 
85  ~InFile(){Close();}
86 
93  void Open(const std::string& filename,const FileMode& mode);
94 
97 };
98 
99 }
100 
101 
102 
103 #endif /* PARALLELSCANNER_H_ */
void Open(const std::string &filename, const FileMode &mode)
Opens &quot;filename&quot; in write mode &quot;mode&quot;.
Definition: ParallelScanner.cc:37
PsiFileImpl< std::ifstream > FileBase
Convient typedef of the FileBase.
Definition: ParallelScanner.h:61
~InFile()
Calls Close to release memory.
Definition: ParallelScanner.h:85
Specialization of PsiStream to input streams (I doubt this class will ever be used by itself...
Definition: PsiInStream.h:40
std::shared_ptr< std::istream > Stream_
The actual stream.
Definition: StreamBase.h:74
The machinery common to input and output files.
Definition: PsiFileImpl.h:43
void Close(std::shared_ptr< T2 > &FileStream)
We cheat to avoid the upcast.
Definition: PsiFileImpl.h:76
FileMode
For each value the first name is preferred, but let&#39;s face it typing stinks.
Definition: PsiFileImpl.h:38
void Close()
Closes file and frees Stream_ pointer.
Definition: ParallelScanner.h:96
InFile(const std::string &filename="", const FileMode &mode=NOFILEMODE)
Constructor that opens a file with name &quot;filename&quot;.
Definition: ParallelScanner.cc:32
Definition: PsiFileImpl.h:38
The parallel (pun intended) of OutFile, except it reads files in.
Definition: ParallelScanner.h:58