EvolvingObjects
eoFileMonitor Class Reference

Prints statistics to file. More...

#include <eoFileMonitor.h>

Inheritance diagram for eoFileMonitor:
eoMonitor eoF< eoMonitor & > eoFunctorBase eoGnuplot1DMonitor

List of all members.

Public Member Functions

 eoFileMonitor (std::string _filename, std::string _delim=" ", bool _keep_existing=false, bool _header=false, bool _overwrite=false)
virtual eoMonitoroperator() (void)
 Called first, try to open the file in append mode and write the header if asked.
virtual eoMonitoroperator() (std::ostream &os)
void printHeader (void)
 Try to open the file, and then call printHeader(file)
virtual void printHeader (std::ostream &os)
 Print long names of the registered items, separated by delim.
virtual std::string getFileName ()

Private Attributes

std::string filename
 complete filename to write to
std::string delim
 delimiter to use between each write
bool keep
 should we append or create a new file
bool header
 printing header at begin of file?
bool firstcall
 flag to avoid calling twice operator()(void)
bool overwrite
 erase the entire file prior to writing in it (mode eos_base::

Detailed Description

Prints statistics to file.

Modified the default behavior, so that it erases existing files. Can be modified in the ctor.

Version:
MS 25/11/00

Definition at line 46 of file eoFileMonitor.h.


Constructor & Destructor Documentation

eoFileMonitor::eoFileMonitor ( std::string  _filename,
std::string  _delim = " ",
bool  _keep_existing = false,
bool  _header = false,
bool  _overwrite = false 
) [inline]

Constructor

Try to create the file in writing mode, erasing it if asked.

Parameters:
_filenamecomplete filename to write to
_delimdelimiter string to use between each item of the registered vector (e.g. of eoStats)
_keep_existingif true, overwrite any existing file with the same name prior to any output
_headerprint the header (with the descriptions of registered eoStats) at the beginning of the file (WARNING: true will discards header printing)
_overwriteif true, overwrite the existing file

Definition at line 60 of file eoFileMonitor.h.

References filename.


Member Function Documentation

eoMonitor & eoFileMonitor::operator() ( std::ostream &  os) [virtual]

Main call, normally called at each generation. Write the content of the registered vector into the file, each item being separated by delim

Definition at line 74 of file eoFileMonitor.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends