|
EvolvingObjects
|
Prints statistics to file. More...
#include <eoFileMonitor.h>
Public Member Functions | |
| eoFileMonitor (std::string _filename, std::string _delim=" ", bool _keep_existing=false, bool _header=false, bool _overwrite=false) | |
| virtual eoMonitor & | operator() (void) |
| Called first, try to open the file in append mode and write the header if asked. | |
| virtual eoMonitor & | operator() (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:: | |
Prints statistics to file.
Modified the default behavior, so that it erases existing files. Can be modified in the ctor.
Definition at line 46 of file eoFileMonitor.h.
| 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.
| _filename | complete filename to write to |
| _delim | delimiter string to use between each item of the registered vector (e.g. of eoStats) |
| _keep_existing | if true, overwrite any existing file with the same name prior to any output |
| _header | print the header (with the descriptions of registered eoStats) at the beginning of the file (WARNING: true will discards header printing) |
| _overwrite | if true, overwrite the existing file |
Definition at line 60 of file eoFileMonitor.h.
References filename.
| 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.