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 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 PARALLELSCANNER_H_
29 #define PARALLELSCANNER_H_
30 
31 #include "PsiInStream.h"
32 #include "PsiFileImpl.h"
33 
34 namespace psi{
35 
59 class InFile: public PsiInStream,private PsiFileImpl<std::ifstream>{
60  private:
63 
64  public:
83  InFile(const std::string& filename="",const FileMode& mode=NOFILEMODE);
84 
86  ~InFile(){Close();}
87 
94  void Open(const std::string& filename,const FileMode& mode);
95 
98 };
99 
100 }
101 
102 
103 
104 #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:38
PsiFileImpl< std::ifstream > FileBase
Convient typedef of the FileBase.
Definition: ParallelScanner.h:62
~InFile()
Calls Close to release memory.
Definition: ParallelScanner.h:86
Specialization of PsiStream to input streams (I doubt this class will ever be used by itself...
Definition: PsiInStream.h:41
std::shared_ptr< std::istream > Stream_
The actual stream.
Definition: StreamBase.h:75
The machinery common to input and output files.
Definition: PsiFileImpl.h:44
void Close(std::shared_ptr< T2 > &FileStream)
We cheat to avoid the upcast.
Definition: PsiFileImpl.h:77
FileMode
For each value the first name is preferred, but let&#39;s face it typing stinks.
Definition: PsiFileImpl.h:39
void Close()
Closes file and frees Stream_ pointer.
Definition: ParallelScanner.h:97
InFile(const std::string &filename="", const FileMode &mode=NOFILEMODE)
Constructor that opens a file with name &quot;filename&quot;.
Definition: ParallelScanner.cc:33
Definition: PsiFileImpl.h:39
The parallel (pun intended) of OutFile, except it reads files in.
Definition: ParallelScanner.h:59