Geant4  10.02
G4MTcoutDestination Class Reference

#include <G4MTcoutDestination.hh>

+ Inheritance diagram for G4MTcoutDestination:
+ Collaboration diagram for G4MTcoutDestination:

Public Member Functions

 G4MTcoutDestination (const G4int &threadId, std::ostream &co=std::cout, std::ostream &ce=std::cerr)
 
virtual ~G4MTcoutDestination ()
 
virtual G4int ReceiveG4cout (const G4String &)
 
virtual G4int ReceiveG4cerr (const G4String &)
 
void SetCoutFileName (const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
 
void SetCerrFileName (const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
 
void EnableBuffering (G4bool flag=true)
 
void SetPrefixString (const G4String &wd="G4WT")
 
void SetIgnoreCout (G4int tid=0)
 
void SetIgnoreInit (G4bool val=true)
 
G4String GetPrefixString () const
 
G4String GetFullPrefixString () const
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()
 
virtual ~G4coutDestination ()
 

Private Member Functions

void CloseCoutFile ()
 
void CloseCerrFile ()
 
void DumpBuffer ()
 

Private Attributes

std::ostream & finalcout
 
std::ostream & finalcerr
 
const G4int id
 
G4bool useBuffer
 
G4bool threadCoutToFile
 
G4bool threadCerrToFile
 
G4bool ignoreCout
 
G4bool ignoreInit
 
std::ostringstream cout_buffer
 
std::ostringstream cerr_buffer
 
std::ofstream coutFile
 
std::ofstream cerrFile
 
G4String prefix
 

Additional Inherited Members

- Static Protected Attributes inherited from G4coutDestination
static G4coutDestinationmasterG4coutDestination = 0
 

Detailed Description

Definition at line 45 of file G4MTcoutDestination.hh.

Constructor & Destructor Documentation

G4MTcoutDestination::G4MTcoutDestination ( const G4int threadId,
std::ostream &  co = std::cout,
std::ostream &  ce = std::cerr 
)

Definition at line 38 of file G4MTcoutDestination.cc.

References G4cerrbuf, G4coutbuf, and G4strstreambuf::SetDestination().

+ Here is the call graph for this function:

G4MTcoutDestination::~G4MTcoutDestination ( )
virtual

Definition at line 49 of file G4MTcoutDestination.cc.

References CloseCerrFile(), CloseCoutFile(), DumpBuffer(), threadCerrToFile, threadCoutToFile, and useBuffer.

+ Here is the call graph for this function:

Member Function Documentation

void G4MTcoutDestination::CloseCerrFile ( )
private

Definition at line 165 of file G4MTcoutDestination.cc.

References cerrFile, and threadCerrToFile.

Referenced by SetCerrFileName(), and ~G4MTcoutDestination().

+ Here is the caller graph for this function:

void G4MTcoutDestination::CloseCoutFile ( )
private

Definition at line 159 of file G4MTcoutDestination.cc.

References coutFile, and threadCoutToFile.

Referenced by SetCoutFileName(), and ~G4MTcoutDestination().

+ Here is the caller graph for this function:

void G4MTcoutDestination::DumpBuffer ( )
private

Definition at line 171 of file G4MTcoutDestination.cc.

References cerr_buffer, cout_buffer, finalcerr, and finalcout.

Referenced by EnableBuffering(), and ~G4MTcoutDestination().

+ Here is the caller graph for this function:

void G4MTcoutDestination::EnableBuffering ( G4bool  flag = true)

Definition at line 142 of file G4MTcoutDestination.cc.

References DumpBuffer(), and useBuffer.

Referenced by G4UImanager::SetThreadUseBuffer().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4String G4MTcoutDestination::GetFullPrefixString ( ) const
inline

Definition at line 63 of file G4MTcoutDestination.hh.

References id.

G4String G4MTcoutDestination::GetPrefixString ( ) const
inline

Definition at line 62 of file G4MTcoutDestination.hh.

References prefix.

G4int G4MTcoutDestination::ReceiveG4cerr ( const G4String msg)
virtual

Reimplemented from G4coutDestination.

Definition at line 90 of file G4MTcoutDestination.cc.

References cerr_buffer, cerrFile, finalcerr, G4State_Idle, G4Threading::GENERICTHREAD_ID, G4StateManager::GetStateManager(), id, ignoreCout, ignoreInit, G4coutDestination::masterG4coutDestination, prefix, G4coutDestination::ReceiveG4cerr(), threadCerrToFile, and useBuffer.

+ Here is the call graph for this function:

G4int G4MTcoutDestination::ReceiveG4cout ( const G4String msg)
virtual

Reimplemented from G4coutDestination.

Definition at line 59 of file G4MTcoutDestination.cc.

References cout_buffer, coutFile, finalcout, G4State_Idle, G4Threading::GENERICTHREAD_ID, G4StateManager::GetStateManager(), id, ignoreCout, ignoreInit, G4coutDestination::masterG4coutDestination, prefix, G4coutDestination::ReceiveG4cout(), threadCoutToFile, and useBuffer.

+ Here is the call graph for this function:

void G4MTcoutDestination::SetCerrFileName ( const G4String fileN = "G4cerr.txt",
G4bool  ifAppend = true 
)

Definition at line 129 of file G4MTcoutDestination.cc.

References cerrFile, CloseCerrFile(), and threadCerrToFile.

Referenced by G4UImanager::SetCerrFileName().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4MTcoutDestination::SetCoutFileName ( const G4String fileN = "G4cout.txt",
G4bool  ifAppend = true 
)

Definition at line 116 of file G4MTcoutDestination.cc.

References CloseCoutFile(), coutFile, and threadCoutToFile.

Referenced by G4UImanager::SetCoutFileName().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4MTcoutDestination::SetIgnoreCout ( G4int  tid = 0)

Definition at line 151 of file G4MTcoutDestination.cc.

References id, and ignoreCout.

Referenced by G4UImanager::SetThreadIgnore(), G4UImanager::SetUpForAThread(), and G4UImanager::SetUpForSpecialThread().

+ Here is the caller graph for this function:

void G4MTcoutDestination::SetIgnoreInit ( G4bool  val = true)
inline

Definition at line 61 of file G4MTcoutDestination.hh.

References ignoreInit.

Referenced by G4UImanager::SetThreadIgnoreInit().

+ Here is the caller graph for this function:

void G4MTcoutDestination::SetPrefixString ( const G4String wd = "G4WT")

Definition at line 148 of file G4MTcoutDestination.cc.

Referenced by G4UImanager::SetThreadPrefixString(), and G4UImanager::SetUpForSpecialThread().

+ Here is the caller graph for this function:

Member Data Documentation

std::ostringstream G4MTcoutDestination::cerr_buffer
private

Definition at line 87 of file G4MTcoutDestination.hh.

Referenced by DumpBuffer(), and ReceiveG4cerr().

std::ofstream G4MTcoutDestination::cerrFile
private

Definition at line 89 of file G4MTcoutDestination.hh.

Referenced by CloseCerrFile(), ReceiveG4cerr(), and SetCerrFileName().

std::ostringstream G4MTcoutDestination::cout_buffer
private

Definition at line 86 of file G4MTcoutDestination.hh.

Referenced by DumpBuffer(), and ReceiveG4cout().

std::ofstream G4MTcoutDestination::coutFile
private

Definition at line 88 of file G4MTcoutDestination.hh.

Referenced by CloseCoutFile(), ReceiveG4cout(), and SetCoutFileName().

std::ostream& G4MTcoutDestination::finalcerr
private

Definition at line 78 of file G4MTcoutDestination.hh.

Referenced by DumpBuffer(), and ReceiveG4cerr().

std::ostream& G4MTcoutDestination::finalcout
private

Definition at line 77 of file G4MTcoutDestination.hh.

Referenced by DumpBuffer(), and ReceiveG4cout().

const G4int G4MTcoutDestination::id
private
G4bool G4MTcoutDestination::ignoreCout
private

Definition at line 83 of file G4MTcoutDestination.hh.

Referenced by ReceiveG4cerr(), ReceiveG4cout(), and SetIgnoreCout().

G4bool G4MTcoutDestination::ignoreInit
private

Definition at line 84 of file G4MTcoutDestination.hh.

Referenced by ReceiveG4cerr(), ReceiveG4cout(), and SetIgnoreInit().

G4String G4MTcoutDestination::prefix
private

Definition at line 90 of file G4MTcoutDestination.hh.

Referenced by GetPrefixString(), ReceiveG4cerr(), and ReceiveG4cout().

G4bool G4MTcoutDestination::threadCerrToFile
private
G4bool G4MTcoutDestination::threadCoutToFile
private
G4bool G4MTcoutDestination::useBuffer
private

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