CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
Management of run options.
The idea is to have one global instance of this class named flags, available everywhere so that we can use macros CEPS_SAYS(...) CEPS_WARNS(...)
Options are -v Verbose mode, prints stuff on screen. -w Display warnings -p Profiling mode. Prints profiling info on screen or in a logfile. -h Print help and quit
Definition at line 53 of file CepsFlags.hpp.
#include <CepsFlags.hpp>
Public Member Functions | |
Flags ()=delete | |
Flags (int argc, CepsChar **argv) | |
Initializes run options from command line. More... | |
Flags (Flags &that)=delete | |
Copy construction. Deleted. Flags should not be copied. More... | |
~Flags () | |
If needed closes the logs with current time. More... | |
Flags & | operator= (Flags &that)=delete |
Assignment operator. Deleted, flags should not be copied. More... | |
void | setVerbose (CepsBool v) |
Enable/disable verbosity. More... | |
void | enableDebug () |
Activates profiling, opens debug log stream. More... | |
void | enableProfiling () |
Activates profiling, opens profiling log stream. More... | |
void | enableTesting () |
Enables testing (CepsException for errors do not cause abort) More... | |
void | disableTesting () |
Disables testing (CepsException for errors now cause abort) More... | |
void | enableWarnings () |
Enables warning messages. More... | |
void | disableWarnings () |
Disables warning messages. More... | |
CepsBool | profiling () const |
True if option -p was set in command line. More... | |
CepsBool | testing () const |
Tells if currently running in a test suite (switched in CepsGlobalFixture.hpp) More... | |
CepsBool | verbose () const |
True if option -d was set in command line. More... | |
CepsBool | warnings () const |
True if option -w was set in command line. More... | |
void | printHelp (CepsChar **argv) |
Display info on how to type in command line. More... | |
CepsString | getDebugLogName () const |
Name has the form debug_PID.log (PID of master node) More... | |
CepsString | getProfilingLogName () const |
Name has the form profiling_PID.log (PID of master node) More... | |
std::ofstream & | getDebugLog () |
the Log stream More... | |
std::ofstream & | getProfilingLog () |
The Profiling stream. More... | |
Public Member Functions inherited from CepsObject | |
CepsObject ()=default | |
default constructor More... | |
CepsObject (const CepsObject &)=default | |
Copy constructor. More... | |
virtual | ~CepsObject ()=default |
Destructor. More... | |
CepsObject & | operator= (const CepsObject &)=default |
Assignment operator. More... | |
CepsObject * | toBaseObject () |
Returns a pointer to CepsObject class. More... | |
const CepsObject * | toBaseObject () const |
Returns a pointer to CepsObject class, const version. More... | |
Profiler * | getProfiler () const |
Access to profiler. More... | |
Private Attributes | |
CepsBool | m_profiling |
Profiling option. More... | |
CepsBool | m_verbose |
Blah blah if true. More... | |
CepsBool | m_warnings |
More blah blah if true. More... | |
CepsBool | m_testing |
Used for unit tests. More... | |
CepsString | m_debugLogName |
Debug file name. More... | |
std::ofstream | m_debugLog |
Debug file stream (opened in init, closed at finalize) More... | |
CepsString | m_profilingLogName |
Profiling file name. More... | |
std::ofstream | m_profilingLog |
Profiling file stream (opened in init, closed at finalize) More... | |
Additional Inherited Members | |
Static Protected Attributes inherited from CepsObject | |
static Profiler | m_profiler |
The same profiler for each big object. More... | |
|
delete |
Flags::Flags | ( | int | argc, |
CepsChar ** | argv | ||
) |
Initializes run options from command line.
Definition at line 39 of file CepsFlags.cpp.
Flags::~Flags | ( | ) |
If needed closes the logs with current time.
Definition at line 155 of file CepsFlags.cpp.
void Flags::disableTesting | ( | ) |
Disables testing (CepsException for errors now cause abort)
Definition at line 138 of file CepsFlags.cpp.
void Flags::disableWarnings | ( | ) |
Disables warning messages.
Definition at line 150 of file CepsFlags.cpp.
void Flags::enableDebug | ( | ) |
Activates profiling, opens debug log stream.
Definition at line 85 of file CepsFlags.cpp.
void Flags::enableProfiling | ( | ) |
Activates profiling, opens profiling log stream.
Definition at line 108 of file CepsFlags.cpp.
void Flags::enableTesting | ( | ) |
Enables testing (CepsException for errors do not cause abort)
Definition at line 132 of file CepsFlags.cpp.
void Flags::enableWarnings | ( | ) |
Enables warning messages.
Definition at line 144 of file CepsFlags.cpp.
std::ofstream & Flags::getDebugLog | ( | ) |
the Log stream
Definition at line 233 of file CepsFlags.cpp.
CepsString Flags::getDebugLogName | ( | ) | const |
Name has the form debug_PID.log (PID of master node)
Definition at line 221 of file CepsFlags.cpp.
std::ofstream & Flags::getProfilingLog | ( | ) |
The Profiling stream.
Definition at line 239 of file CepsFlags.cpp.
CepsString Flags::getProfilingLogName | ( | ) | const |
Name has the form profiling_PID.log (PID of master node)
Definition at line 227 of file CepsFlags.cpp.
Assignment operator. Deleted, flags should not be copied.
void Flags::printHelp | ( | CepsChar ** | argv | ) |
Display info on how to type in command line.
Definition at line 207 of file CepsFlags.cpp.
CepsBool Flags::profiling | ( | ) | const |
True if option -p was set in command line.
Definition at line 183 of file CepsFlags.cpp.
void Flags::setVerbose | ( | CepsBool | v | ) |
Enable/disable verbosity.
Definition at line 79 of file CepsFlags.cpp.
CepsBool Flags::testing | ( | ) | const |
Tells if currently running in a test suite (switched in CepsGlobalFixture.hpp)
Definition at line 189 of file CepsFlags.cpp.
CepsBool Flags::verbose | ( | ) | const |
True if option -d was set in command line.
Definition at line 195 of file CepsFlags.cpp.
CepsBool Flags::warnings | ( | ) | const |
True if option -w was set in command line.
Definition at line 201 of file CepsFlags.cpp.
|
private |
Debug file stream (opened in init, closed at finalize)
Definition at line 146 of file CepsFlags.hpp.
|
private |
Debug file name.
Definition at line 145 of file CepsFlags.hpp.
|
private |
Profiling option.
Definition at line 140 of file CepsFlags.hpp.
|
private |
Profiling file stream (opened in init, closed at finalize)
Definition at line 148 of file CepsFlags.hpp.
|
private |
Profiling file name.
Definition at line 147 of file CepsFlags.hpp.
|
private |
Used for unit tests.
Definition at line 143 of file CepsFlags.hpp.
|
private |
Blah blah if true.
Definition at line 141 of file CepsFlags.hpp.
|
private |
More blah blah if true.
Definition at line 142 of file CepsFlags.hpp.