CEPS  24.01
Cardiac ElectroPhysiology Simulator
Flags Class Reference

Detailed Description

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>

Inheritance diagram for Flags:
[legend]

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...
 
Flagsoperator= (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...
 
CepsObjectoperator= (const CepsObject &)=default
 Assignment operator. More...
 
CepsObjecttoBaseObject ()
 Returns a pointer to CepsObject class. More...
 
const CepsObjecttoBaseObject () const
 Returns a pointer to CepsObject class, const version. More...
 
ProfilergetProfiler () 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...
 

Constructor & Destructor Documentation

◆ Flags() [1/3]

Flags::Flags ( )
delete

◆ Flags() [2/3]

Flags::Flags ( int  argc,
CepsChar **  argv 
)

Initializes run options from command line.

Definition at line 39 of file CepsFlags.cpp.

◆ Flags() [3/3]

Flags::Flags ( Flags that)
delete

Copy construction. Deleted. Flags should not be copied.

◆ ~Flags()

Flags::~Flags ( )

If needed closes the logs with current time.

Definition at line 155 of file CepsFlags.cpp.

Member Function Documentation

◆ disableTesting()

void Flags::disableTesting ( )

Disables testing (CepsException for errors now cause abort)

Definition at line 138 of file CepsFlags.cpp.

◆ disableWarnings()

void Flags::disableWarnings ( )

Disables warning messages.

Definition at line 150 of file CepsFlags.cpp.

◆ enableDebug()

void Flags::enableDebug ( )

Activates profiling, opens debug log stream.

Definition at line 85 of file CepsFlags.cpp.

◆ enableProfiling()

void Flags::enableProfiling ( )

Activates profiling, opens profiling log stream.

Definition at line 108 of file CepsFlags.cpp.

◆ enableTesting()

void Flags::enableTesting ( )

Enables testing (CepsException for errors do not cause abort)

Definition at line 132 of file CepsFlags.cpp.

◆ enableWarnings()

void Flags::enableWarnings ( )

Enables warning messages.

Definition at line 144 of file CepsFlags.cpp.

◆ getDebugLog()

std::ofstream & Flags::getDebugLog ( )

the Log stream

Definition at line 233 of file CepsFlags.cpp.

◆ getDebugLogName()

CepsString Flags::getDebugLogName ( ) const

Name has the form debug_PID.log (PID of master node)

Definition at line 221 of file CepsFlags.cpp.

◆ getProfilingLog()

std::ofstream & Flags::getProfilingLog ( )

The Profiling stream.

Definition at line 239 of file CepsFlags.cpp.

◆ getProfilingLogName()

CepsString Flags::getProfilingLogName ( ) const

Name has the form profiling_PID.log (PID of master node)

Definition at line 227 of file CepsFlags.cpp.

◆ operator=()

Flags& Flags::operator= ( Flags that)
delete

Assignment operator. Deleted, flags should not be copied.

◆ printHelp()

void Flags::printHelp ( CepsChar **  argv)

Display info on how to type in command line.

Definition at line 207 of file CepsFlags.cpp.

◆ profiling()

CepsBool Flags::profiling ( ) const

True if option -p was set in command line.

Definition at line 183 of file CepsFlags.cpp.

◆ setVerbose()

void Flags::setVerbose ( CepsBool  v)

Enable/disable verbosity.

Definition at line 79 of file CepsFlags.cpp.

◆ testing()

CepsBool Flags::testing ( ) const

Tells if currently running in a test suite (switched in CepsGlobalFixture.hpp)

Definition at line 189 of file CepsFlags.cpp.

◆ verbose()

CepsBool Flags::verbose ( ) const

True if option -d was set in command line.

Definition at line 195 of file CepsFlags.cpp.

◆ warnings()

CepsBool Flags::warnings ( ) const

True if option -w was set in command line.

Definition at line 201 of file CepsFlags.cpp.

Field Documentation

◆ m_debugLog

std::ofstream Flags::m_debugLog
private

Debug file stream (opened in init, closed at finalize)

Definition at line 146 of file CepsFlags.hpp.

◆ m_debugLogName

CepsString Flags::m_debugLogName
private

Debug file name.

Definition at line 145 of file CepsFlags.hpp.

◆ m_profiling

CepsBool Flags::m_profiling
private

Profiling option.

Definition at line 140 of file CepsFlags.hpp.

◆ m_profilingLog

std::ofstream Flags::m_profilingLog
private

Profiling file stream (opened in init, closed at finalize)

Definition at line 148 of file CepsFlags.hpp.

◆ m_profilingLogName

CepsString Flags::m_profilingLogName
private

Profiling file name.

Definition at line 147 of file CepsFlags.hpp.

◆ m_testing

CepsBool Flags::m_testing
private

Used for unit tests.

Definition at line 143 of file CepsFlags.hpp.

◆ m_verbose

CepsBool Flags::m_verbose
private

Blah blah if true.

Definition at line 141 of file CepsFlags.hpp.

◆ m_warnings

CepsBool Flags::m_warnings
private

More blah blah if true.

Definition at line 142 of file CepsFlags.hpp.


The documentation for this class was generated from the following files: