thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::CurrentGenerator::Redirect Class Reference

Class used to temporarily redirect a given ostream to the misc() stream of the current EventGenerator. More...

#include <CurrentGenerator.h>

Public Member Functions

 Redirect (ostream &os, bool internal=false)
 Constructor taking the stream to be redirected as input.
 
 ~Redirect ()
 The destructor which restores the original destination of the stream.
 
string str () const
 If output is stored internally, acces what has been written so far.
 

Public Attributes

ostream * theStream
 The stream which is redirected.
 
std::streambuf * theBuffer
 The original buffer of the redirected stream.
 
ostringstream intStream
 An internal buffer, the content of which will be discarded when the this object is destructed.
 

Detailed Description

Class used to temporarily redirect a given ostream to the misc() stream of the current EventGenerator.

Definition at line 201 of file CurrentGenerator.h.

Constructor & Destructor Documentation

◆ Redirect()

ThePEG::CurrentGenerator::Redirect::Redirect ( ostream &  os,
bool  internal = false 
)
inline

Constructor taking the stream to be redirected as input.

If the internal flag false the output will be stored in the Event Generator and written to the log file in the end of the run. If

Definition at line 213 of file CurrentGenerator.h.

References ThePEG::CurrentGenerator::current(), intStream, and theStream.

◆ ~Redirect()

ThePEG::CurrentGenerator::Redirect::~Redirect ( )
inline

The destructor which restores the original destination of the stream.

Definition at line 224 of file CurrentGenerator.h.

References theBuffer, and theStream.

Member Function Documentation

◆ str()

string ThePEG::CurrentGenerator::Redirect::str ( ) const
inline

If output is stored internally, acces what has been written so far.

Definition at line 232 of file CurrentGenerator.h.

References intStream.

Member Data Documentation

◆ intStream

ostringstream ThePEG::CurrentGenerator::Redirect::intStream

An internal buffer, the content of which will be discarded when the this object is destructed.

Definition at line 250 of file CurrentGenerator.h.

Referenced by Redirect(), and str().

◆ theBuffer

std::streambuf* ThePEG::CurrentGenerator::Redirect::theBuffer

The original buffer of the redirected stream.

Definition at line 244 of file CurrentGenerator.h.

Referenced by ~Redirect().

◆ theStream

ostream* ThePEG::CurrentGenerator::Redirect::theStream

The stream which is redirected.

Definition at line 239 of file CurrentGenerator.h.

Referenced by Redirect(), and ~Redirect().


The documentation for this class was generated from the following file: