![]() |
QMCPACK
|
Interface to output streams. More...
Public Member Functions | |
InfoStream (std::ostream *output_stream) | |
InfoStream (const InfoStream &in)=delete | |
InfoStream & | operator= (const InfoStream &in)=delete |
std::ostream & | getStream (const std::string &tag="") |
returns current stream More... | |
void | setStream (std::ostream *output_stream) |
void | flush () |
flush stream buffer More... | |
void | pause () |
Stop output (redirect to a null stream) More... | |
void | resume () |
Continue output on the stream used before pausing. More... | |
bool | isActive () const |
check if the stream is active More... | |
void | redirectToFile (const std::string &fname) |
Open a file and output to that file. More... | |
void | redirectToSameStream (InfoStream &info) |
Copy a stream. More... | |
void | shutOff () |
Permanently turn off the stream. More... | |
Private Member Functions | |
bool | checkCurr () const |
Private Attributes | |
std::ostream * | currStream |
std::ostream * | outputStream |
std::ostream | nullStream |
std::unique_ptr< std::ofstream > | fileStream |
Interface to output streams.
Can redirect output to stdout/stderr, a file, or a null stream.
Definition at line 28 of file InfoStream.h.
InfoStream | ( | std::ostream * | output_stream | ) |
|
delete |
|
inlineprivate |
Definition at line 64 of file InfoStream.h.
References currStream, nullStream, and outputStream.
Referenced by pause(), redirectToFile(), redirectToSameStream(), resume(), setStream(), and shutOff().
void flush | ( | ) |
flush stream buffer
Definition at line 39 of file InfoStream.cpp.
References outputStream.
Referenced by QMCDriverFactory::createQMCDriver(), QMCMain::execute(), QMCDriverNew::finalize(), QMCDriver::finalize(), ReportEngine::flush(), QMCDriver::process(), QMCDriverFactory::readSection(), ReportEngine::ReportEngine(), QMCMain::runQMC(), TEST_CASE(), and ReportEngine::~ReportEngine().
|
inline |
returns current stream
Definition at line 37 of file InfoStream.h.
References currStream.
Referenced by qmcplusplus::app_debug_stream(), qmcplusplus::app_error(), qmcplusplus::app_log(), qmcplusplus::app_summary(), qmcplusplus::app_warning(), operator<<(), and TEST_CASE().
|
inline |
check if the stream is active
Definition at line 51 of file InfoStream.h.
References currStream, and nullStream.
Referenced by TEST_CASE().
|
delete |
void pause | ( | ) |
Stop output (redirect to a null stream)
Definition at line 41 of file InfoStream.cpp.
References checkCurr(), currStream, and nullStream.
Referenced by OutputManagerClass::pause(), OutputManagerClass::setVerbosity(), and TEST_CASE().
void redirectToFile | ( | const std::string & | fname | ) |
Open a file and output to that file.
Definition at line 60 of file InfoStream.cpp.
References checkCurr(), currStream, fileStream, nullStream, and outputStream.
Referenced by main(), and TEST_CASE().
void redirectToSameStream | ( | InfoStream & | info | ) |
Copy a stream.
Definition at line 70 of file InfoStream.cpp.
References checkCurr(), currStream, fileStream, nullStream, and outputStream.
Referenced by main(), and TEST_CASE().
void resume | ( | ) |
Continue output on the stream used before pausing.
Definition at line 47 of file InfoStream.cpp.
References checkCurr(), currStream, and outputStream.
Referenced by CloneManager::makeClones(), OutputManagerClass::resume(), OutputManagerClass::setVerbosity(), and TEST_CASE().
void setStream | ( | std::ostream * | output_stream | ) |
Definition at line 24 of file InfoStream.cpp.
References checkCurr(), currStream, fileStream, nullStream, and outputStream.
Referenced by qmcplusplus::init_string_output().
void shutOff | ( | ) |
Permanently turn off the stream.
Definition at line 53 of file InfoStream.cpp.
References checkCurr(), currStream, fileStream, nullStream, and outputStream.
Referenced by OutputManagerClass::shutOff(), and TEST_CASE().
|
private |
Definition at line 67 of file InfoStream.h.
Referenced by checkCurr(), getStream(), InfoStream(), isActive(), pause(), redirectToFile(), redirectToSameStream(), resume(), setStream(), and shutOff().
|
private |
Definition at line 76 of file InfoStream.h.
Referenced by redirectToFile(), redirectToSameStream(), setStream(), and shutOff().
|
private |
Definition at line 73 of file InfoStream.h.
Referenced by checkCurr(), InfoStream(), isActive(), pause(), redirectToFile(), redirectToSameStream(), setStream(), and shutOff().
|
private |
Definition at line 70 of file InfoStream.h.
Referenced by checkCurr(), flush(), InfoStream(), redirectToFile(), redirectToSameStream(), resume(), setStream(), and shutOff().