Class containing the log stream. More...
#include <Log.h>
Public Member Functions | |
OFile & | addConstantField (const std::string &) |
void | backupAllFiles (const std::string &str) |
This backs up all the files that would have been created with the name str. More... | |
void | backupFile (const std::string &bstring, const std::string &fname) |
Backup a file by giving it a different name. More... | |
OFile & | clearFields () |
Resets the list of fields. More... | |
void | close () |
Closes the file Should be used only for explicitely opened files. More... | |
OFile & | enforceBackup () |
Enforce backup, even if the attached plumed object is restarting. More... | |
OFile & | enforceRestart () |
Enforce restart, also if the attached plumed object is not restarting. More... | |
FileBase & | enforceSuffix (const std::string &suffix) |
Enforce suffix. More... | |
bool | FileExist (const std::string &path) |
Check if the file exists. More... | |
FileBase & | flush () override |
Flush a file. More... | |
OFile & | fmtField (const std::string &) |
Set the format for writing double precision fields. More... | |
OFile & | fmtField () |
Reset the format for writing double precision fields to its default. More... | |
FILE * | getFILE () const |
Get the underlying file pointer. More... | |
std::string | getMode () const |
Retrieve the mode. More... | |
std::string | getPath () const |
Retrieve the path. More... | |
std::string | getSuffix () const |
Get the file suffix. More... | |
bool | isOpen () |
Check if a file is open. More... | |
FileBase & | link (FILE *) |
Link to an already open filed. More... | |
FileBase & | link (PlumedMain &) |
Link to a PlumedMain object Automatically links also the corresponding Communicator. More... | |
FileBase & | link (Communicator &) |
Link to a Communicator object. More... | |
FileBase & | link (Action &) |
Link to an Action object. More... | |
FileBase & | link (Communicator &) |
Allows overloading of link. More... | |
FileBase & | link (Action &) |
Allows overloading of link. More... | |
FileBase & | link (PlumedMain &) |
Allows overloading of link. More... | |
FileBase & | link (FILE *) |
Allows overloading of link. More... | |
OFile & | link (OFile &) |
Allows linking this OFile to another one. More... | |
virtual FileBase & | open (const std::string &name)=0 |
Allows overloading of open. More... | |
OFile & | open (const std::string &name) override |
Opens the file using automatic append/backup. More... | |
operator bool () const | |
Check for error/eof. More... | |
int | printf (const char *fmt,...) |
Formatted output with explicit format - a la printf. More... | |
OFile & | printField (const std::string &, double) |
Set the value of a double precision field. More... | |
OFile & | printField (const std::string &, int) |
Set the value of a int field. More... | |
OFile & | printField (const std::string &, const std::string &) |
Set the value of a string field. More... | |
OFile & | printField (Value *val, const double &v) |
Print a value. More... | |
OFile & | printField () |
Close a line. More... | |
OFile & | rewind () |
Rewind a file. More... | |
void | setBackupString (const std::string &) |
Set the string name to be used for automatic backup. More... | |
void | setHeavyFlush () |
Set heavyFlush flag. More... | |
OFile & | setLinePrefix (const std::string &) |
Set the prefix for output. More... | |
OFile & | setupPrintValue (Value *val) |
Used to setup printing of values. More... | |
Static Public Member Functions | |
static std::string | appendSuffix (const std::string &path, const std::string &suffix) |
Append suffix. More... | |
Protected Attributes | |
Action * | action |
pointer to corresponding action. NULL if not linked More... | |
bool | cloned |
Control closing on destructor. More... | |
Communicator * | comm |
communicator. NULL if not set More... | |
bool | eof |
Set to true when end of file is encountered. More... | |
bool | err |
Set to true when error is encountered. More... | |
FILE * | fp |
file pointer More... | |
void * | gzfp |
zip file pointer. More... | |
bool | heavyFlush |
Set to true if you want flush to be heavy (close/reopen) More... | |
std::string | mode |
mode of the opened file More... | |
std::string | path |
path of the opened file More... | |
PlumedMain * | plumed |
pointer to main plumed object. NULL if not linked More... | |
Class containing the log stream.
It is similar to a FILE stream. It allows a printf() function, and also to write with a << operator. Moreover, it can prefix lines with the "PLUMED:" prefix, useful to grep out plumed log from output
|
inherited |
|
staticinherited |
Append suffix.
It appends the desired suffix to the string. Notice that it conserves some suffix (e.g. gz/xtc/trr).
|
inherited |
This backs up all the files that would have been created with the name str.
It is used in analysis when you are not restarting. Analysis output files at different times, which are names analysis.0.<filename>, analysis.1.<filename> and <filename>, are backed up to bck.0.analysis.0.<filename>, bck.0.analysis.1.<filename> and bck.0.<filename>
|
inherited |
Backup a file by giving it a different name.
|
inherited |
Resets the list of fields.
As it is only possible to add new constant fields (addConstantField()), this method can be used to clean the field list.
|
inherited |
Closes the file Should be used only for explicitely opened files.
|
inherited |
Enforce backup, even if the attached plumed object is restarting.
|
inherited |
Enforce restart, also if the attached plumed object is not restarting.
Useful for tests
|
inherited |
Enforce suffix.
Overrides the one set in PlumedMain&
|
inherited |
Check if the file exists.
|
overridevirtualinherited |
Flush a file.
Reimplemented from PLMD::FileBase.
|
inherited |
Set the format for writing double precision fields.
|
inherited |
Reset the format for writing double precision fields to its default.
|
inlineinherited |
Get the underlying file pointer.
It might be null even if the file is open, e.g. when the file was open as a gzipped file.
|
inlineinherited |
Retrieve the mode.
|
inlineinherited |
Retrieve the path.
|
inherited |
Get the file suffix.
|
inherited |
Check if a file is open.
|
inherited |
Link to an already open filed.
|
inherited |
Link to a PlumedMain object Automatically links also the corresponding Communicator.
|
inherited |
Link to a Communicator object.
Link to an Action object.
Automatically links also the corresponding PlumedMain and Communicator.
|
inherited |
Allows overloading of link.
|
inherited |
Allows overloading of link.
|
inherited |
Allows overloading of link.
|
inherited |
Allows overloading of link.
|
inherited |
Allows overloading of open.
|
overridevirtualinherited |
Opens the file using automatic append/backup.
Implements PLMD::FileBase.
|
inherited |
Check for error/eof.
|
inherited |
Formatted output with explicit format - a la printf.
|
inherited |
Set the value of a double precision field.
|
inherited |
Set the value of a int field.
|
inherited |
Set the value of a string field.
|
inherited |
Close a line.
Typically used as
of.printField("a",a).printField("b",b).printField();
|
inherited |
Rewind a file.
|
inherited |
Set the string name to be used for automatic backup.
|
inlineinherited |
Set heavyFlush flag.
|
inherited |
Set the prefix for output.
Typically "PLUMED: ". Notice that lines with a prefix cannot be parsed using fields in a IFile.
|
protectedinherited |
pointer to corresponding action. NULL if not linked
|
protectedinherited |
Control closing on destructor.
If true, file will not be closed in destructor
|
protectedinherited |
communicator. NULL if not set
|
protectedinherited |
Set to true when end of file is encountered.
|
protectedinherited |
Set to true when error is encountered.
|
protectedinherited |
file pointer
|
protectedinherited |
zip file pointer.
|
protectedinherited |
Set to true if you want flush to be heavy (close/reopen)
|
protectedinherited |
mode of the opened file
|
protectedinherited |
path of the opened file
|
protectedinherited |
pointer to main plumed object. NULL if not linked
Hosted by GitHub | 1.8.14 |