Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ofstreamDestinationBase Class Referenceabstract

#include <G4ofstreamDestination.hh>

Inheritance diagram for G4ofstreamDestinationBase:
Collaboration diagram for G4ofstreamDestinationBase:

Public Member Functions

 G4ofstreamDestinationBase (const G4String &defaultName, G4bool append)
 
virtual ~G4ofstreamDestinationBase ()
 
virtual G4int ReceiveG4cout (const G4String &)=0
 
virtual G4int ReceiveG4cerr (const G4String &)=0
 
void SetFileName (const G4String &name, G4bool append=true)
 
void Close ()
 
void Open ()
 
- Public Member Functions inherited from G4coutDestination
 G4coutDestination ()
 
virtual ~G4coutDestination ()
 

Protected Attributes

std::ofstream g4file
 

Additional Inherited Members

- Static Protected Attributes inherited from G4coutDestination
static G4coutDestinationmasterG4coutDestination = 0
 

Detailed Description

Definition at line 57 of file G4ofstreamDestination.hh.

Constructor & Destructor Documentation

G4ofstreamDestinationBase::G4ofstreamDestinationBase ( const G4String defaultName,
G4bool  append 
)

Definition at line 42 of file G4ofstreamDestination.cc.

45  fileName(fn),
46  appendFlag(append)
47 {
48 }
G4ofstreamDestinationBase::~G4ofstreamDestinationBase ( )
virtual

Definition at line 50 of file G4ofstreamDestination.cc.

51 {
52  Close();
53 }

Here is the call graph for this function:

Member Function Documentation

void G4ofstreamDestinationBase::Close ( )

Definition at line 72 of file G4ofstreamDestination.cc.

73 {
74  if ( g4file.is_open() )
75  g4file.close();
76 }

Here is the caller graph for this function:

void G4ofstreamDestinationBase::Open ( )

Definition at line 61 of file G4ofstreamDestination.cc.

62 {
63  if ( ! g4file.is_open() )
64  {
65  std::ios::openmode mode = std::ios::out;
66  if ( appendFlag )
67  mode |= std::ios::app;
68  g4file.open(fileName,mode);
69  }
70 }

Here is the caller graph for this function:

virtual G4int G4ofstreamDestinationBase::ReceiveG4cerr ( const G4String )
pure virtual

Reimplemented from G4coutDestination.

Implemented in G4CerrToFile, and G4CoutToFile.

virtual G4int G4ofstreamDestinationBase::ReceiveG4cout ( const G4String )
pure virtual

Reimplemented from G4coutDestination.

Implemented in G4CerrToFile, and G4CoutToFile.

void G4ofstreamDestinationBase::SetFileName ( const G4String name,
G4bool  append = true 
)

Definition at line 55 of file G4ofstreamDestination.cc.

56 {
57  fileName = fn;
58  appendFlag = append;
59 }

Member Data Documentation

std::ofstream G4ofstreamDestinationBase::g4file
protected

Definition at line 73 of file G4ofstreamDestination.hh.


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