Class containing the log stream. More...
#include <Log.h>
Public Member Functions | |
OFile & | link (OFile &) |
Allows linking this OFile to another one. 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... | |
void | setBackupString (const std::string &) |
Set the string name to be used for automatic backup. More... | |
void | backupFile (const std::string &bstring, const std::string &fname) |
Backup a file by giving it a different name. More... | |
void | backupAllFiles (const std::string &str) |
This backs up all the files that would have been created with the name str. More... | |
OFile & | open (const std::string &name) |
Opens the file using automatic append/backup. More... | |
FileBase & | open (const std::string &name, const std::string &mode) |
Opens the file (without auto-backup) More... | |
OFile & | setLinePrefix (const std::string &) |
Set the prefix for output. 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... | |
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 & | addConstantField (const std::string &) |
OFile & | setupPrintValue (Value *val) |
Used to setup printing of values. More... | |
OFile & | clearFields () |
Resets the list of fields. More... | |
int | printf (const char *fmt,...) |
Formatted output with explicit format - a la printf. More... | |
OFile & | rewind () |
Rewind a file. More... | |
FileBase & | flush () |
Flushes the file to disk. More... | |
void | close () |
Closes the file Should be used only for explicitely opened files. More... | |
operator bool () const | |
Check for error/eof. More... | |
void | setHeavyFlush () |
Set heavyFlush flag. More... | |
bool | FileExist (const std::string &path) |
Check if the file exists. More... | |
bool | isOpen () |
Check if a file is open. More... | |
Static Public Member Functions | |
static void | test () |
Runs a small testcase. More... | |
Protected Attributes | |
FILE * | fp |
file pointer More... | |
Communicator * | comm |
communicator. NULL if not set More... | |
PlumedMain * | plumed |
pointer to main plumed object. NULL if not linked More... | |
Action * | action |
pointer to corresponding action. NULL if not linked More... | |
bool | cloned |
Control closing on destructor. More... | |
bool | eof |
Set to true when end of file is encountered. More... | |
bool | err |
Set to true when error is encountered. More... | |
std::string | path |
path of the opened file More... | |
bool | heavyFlush |
Set to true if you want flush to be heavy (close/reopen) 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 |
|
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 |
|
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.
Definition at line 140 of file FileBase.cpp.
|
inherited |
Check if the file exists.
Definition at line 118 of file FileBase.cpp.
|
inherited |
Flushes the file to disk.
Definition at line 70 of file FileBase.cpp.
|
inherited |
|
inherited |
|
inherited |
Check if a file is open.
Definition at line 134 of file FileBase.cpp.
|
inherited |
Link to an already open filed.
Definition at line 64 of file FileBase.cpp.
|
inherited |
Link to a PlumedMain object Automatically links also the corresponding Communicator.
Definition at line 85 of file FileBase.cpp.
|
inherited |
Link to a Communicator object.
Definition at line 79 of file FileBase.cpp.
Link to an Action object.
Automatically links also the corresponding PlumedMain and Communicator.
Definition at line 92 of file FileBase.cpp.
|
inherited |
Opens the file (without auto-backup)
Definition at line 99 of file FileBase.cpp.
|
inherited |
|
inherited |
Check for error/eof.
Definition at line 166 of file FileBase.cpp.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
Set heavyFlush flag.
Definition at line 101 of file FileBase.h.
|
inherited |
|
staticinherited |
Runs a small testcase.
Definition at line 37 of file FileBase.cpp.
|
protectedinherited |
pointer to corresponding action. NULL if not linked
Definition at line 63 of file FileBase.h.
|
protectedinherited |
Control closing on destructor.
If true, file will not be closed in destructor
Definition at line 66 of file FileBase.h.
|
protectedinherited |
communicator. NULL if not set
Definition at line 59 of file FileBase.h.
|
protectedinherited |
Set to true when end of file is encountered.
Definition at line 71 of file FileBase.h.
|
protectedinherited |
Set to true when error is encountered.
Definition at line 73 of file FileBase.h.
|
protectedinherited |
file pointer
Definition at line 57 of file FileBase.h.
|
protectedinherited |
Set to true if you want flush to be heavy (close/reopen)
Definition at line 77 of file FileBase.h.
|
protectedinherited |
path of the opened file
Definition at line 75 of file FileBase.h.
|
protectedinherited |
pointer to main plumed object. NULL if not linked
Definition at line 61 of file FileBase.h.
Hosted by GitHub
![]() |
![]() |