GammaLib  2.1.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GApplication Class Reference

GammaLib application interface definition. More...

#include <GApplication.hpp>

Inheritance diagram for GApplication:
GBase

Public Member Functions

 GApplication (void)
 Void constructor. More...
 
 GApplication (const std::string &name, const std::string &version)
 Application constructor. More...
 
 GApplication (const std::string &name, const std::string &version, const GApplicationPars &pars)
 Application constructor. More...
 
 GApplication (const std::string &name, const std::string &version, int argc, char *argv[])
 Application constructor. More...
 
 GApplication (const GApplication &app)
 Copy constructor. More...
 
 ~GApplication (void)
 Destructor. More...
 
GApplicationoperator= (const GApplication &app)
 Assignment operator. More...
 
GApplicationParoperator[] (const int &index)
 Parameter access operator. More...
 
const GApplicationParoperator[] (const int &index) const
 Parameter access operator (const version) More...
 
GApplicationParoperator[] (const std::string &name)
 Parameter access operator. More...
 
const GApplicationParoperator[] (const std::string &name) const
 Parameter access operator (const version) More...
 
void clear (void)
 Clear application. More...
 
GApplicationclone (void) const
 Clone application. More...
 
std::string classname (void) const
 Return class name. More...
 
const std::string & name (void) const
 Return application name. More...
 
const std::string & version (void) const
 Return application version. More...
 
double telapse (void) const
 Return application elapsed time in calendar seconds. More...
 
double celapse (void) const
 Return application elapsed time in CPU seconds. More...
 
double gCO2e (const std::string &country) const
 Return application equivalent CO2 footprint (units: g CO2e) More...
 
void add_celapse (const double &celapse)
 Add CPU seconds to internal counter. More...
 
void logFileOpen (const bool &clobber=true)
 Open log file. More...
 
void logFileClose (void)
 Close log file. More...
 
bool logTerse (void) const
 Signal terse logging. More...
 
bool logNormal (void) const
 Signal normal logging. More...
 
bool logExplicit (void) const
 Signal explicit logging. More...
 
bool logVerbose (void) const
 Signal verbose logging. More...
 
bool logDebug (void) const
 Signal debug logging. More...
 
bool clobber (void) const
 Return clobber. More...
 
bool has_par (const std::string &name) const
 Signal if specified parameter exists. More...
 
const std::string & par_filename (void) const
 Returns parameter filename. More...
 
const std::string & log_filename (void) const
 Returns log filename. More...
 
void log_header (void)
 Write application header in log file. More...
 
void log_trailer (void)
 Write application trailer in log file. More...
 
void log_string (const GChatter &chatter, const std::string &string, const bool &linefeed=true)
 Write string in log file. More...
 
void log_value (const GChatter &chatter, const std::string &name, const std::string &value, const std::string &unit="")
 Write parameter value in log file. More...
 
void log_value (const GChatter &chatter, const std::string &name, const int &value, const std::string &unit="")
 Write parameter value in log file. More...
 
void log_value (const GChatter &chatter, const std::string &name, const double &value, const std::string &unit="")
 Write parameter value in log file. More...
 
void log_header1 (const GChatter &chatter, const std::string &header)
 Write header 1 in log file. More...
 
void log_header2 (const GChatter &chatter, const std::string &header)
 Write header 2 in log file. More...
 
void log_header3 (const GChatter &chatter, const std::string &header)
 Write header 3 in log file. More...
 
void log_parameters (const GChatter &chatter)
 Write application parameters in log file. More...
 
const bool & need_help (void) const
 Signals if –help option has been specified. More...
 
void statistics (const bool &statistics)
 Set if statistics will be written. More...
 
const bool & statistics (void) const
 Signals if statistics will be written. More...
 
const GApplicationParspars (void) const
 Return application parameters. More...
 
void pars (const GApplicationPars &pars)
 Set application parameters. More...
 
const std::vector< std::string > & args (void) const
 Return command line arguments. More...
 
void stamp (GFitsHDU &hdu) const
 Stamp FITS header with provenance information. More...
 
void stamp (GFits &fits) const
 Stamp all headers in FITS object with provenance information. More...
 
void stamp (const GFilename &filename) const
 Stamp all headers in FITS file with provenance information. More...
 
std::string print (const GChatter &chatter=NORMAL) const
 Print application. More...
 
- Public Member Functions inherited from GBase
virtual ~GBase (void)
 Destructor. More...
 

Public Attributes

GLog log
 Application logger. More...
 

Protected Member Functions

void init_members (void)
 Initialise class members. More...
 
void copy_members (const GApplication &app)
 Copy class members. More...
 
void free_members (void)
 Delete class members. More...
 
void set_statistics (void)
 Set statistics according to parent child status. More...
 
void set_log_chatter (void)
 Set chattiness of logger. More...
 
void set_log_filename (void)
 Set log filename from "logfile" parameter. More...
 
void write_statistics (void)
 Write application statistics. More...
 

Static Protected Member Functions

static int & running ()
 

Protected Attributes

std::string m_name
 Application name. More...
 
std::string m_version
 Application version. More...
 
std::string m_parfile
 Parameter filename. More...
 
std::string m_logfile
 Log filename. More...
 
std::vector< std::string > m_args
 Command line arguments. More...
 
std::time_t m_tstart
 Calendar start time of execution. More...
 
double m_cstart
 Clock start time of execution. More...
 
double m_celapse
 Internal CPU seconds counter. More...
 
GApplicationPars m_pars
 Application parameters. More...
 
bool m_pars_loaded
 Application parameters loaded. More...
 
bool m_need_help
 –help specified More...
 
bool m_statistics
 Enable writing of statistics. More...
 

Detailed Description

GammaLib application interface definition.

This class provides the base class for ftools-like executables based on GammaLib. The ftools-like executables will be implemented as derived classes, and automatically have access to task parameters and the application logger.

Definition at line 54 of file GApplication.hpp.

Constructor & Destructor Documentation

GApplication::GApplication ( void  )

Void constructor.

Constructs an empty application.

Definition at line 72 of file GApplication.cpp.

References init_members(), and set_statistics().

Referenced by clone().

GApplication::GApplication ( const std::string &  name,
const std::string &  version 
)

Application constructor.

Parameters
[in]nameApplication name.
[in]versionApplication version.

Constructs an application from an application name and version. The constructor will set the parameter filename to "<name>.par" and the log filename to "<name>".log. The parameters will be loaded from the parameter file.

No log file will be opened. To open the log file an explicit call to the logFileOpen() method is required.

This constructor should be used for Python scripts.

Definition at line 101 of file GApplication.cpp.

References init_members(), GApplicationPars::load(), m_logfile, m_name, m_parfile, m_pars, m_pars_loaded, m_version, name(), par_filename(), set_log_chatter(), set_log_filename(), set_statistics(), and version().

GApplication::GApplication ( const std::string &  name,
const std::string &  version,
const GApplicationPars pars 
)

Application constructor.

Parameters
[in]nameApplication name.
[in]versionApplication version.
[in]parsApplication parameters.

Constructs an application from an application name and version. The constructor will set the parameter filename to "<name>.par" and the log filename to "<name>".log. The parameters will be loaded from the parameter file.

No log file will be opened. To open the log file an explicit call to the logFileOpen() method is required.

This constructor should be used for Python scripts.

Definition at line 149 of file GApplication.cpp.

References init_members(), m_logfile, m_name, m_parfile, m_pars, m_pars_loaded, m_version, name(), pars(), set_log_chatter(), set_log_filename(), set_statistics(), and version().

GApplication::GApplication ( const std::string &  name,
const std::string &  version,
int  argc,
char *  argv[] 
)

Application constructor.

Parameters
[in]nameApplication name.
[in]versionApplication version.
[in]argcNumber of command line arguments
[in]argvCommand line arguments

Constructs an application from an application name, version and a number argc of command line arguments argv.

This constructor should be used for C++ applications.

Definition at line 195 of file GApplication.cpp.

References init_members(), GApplicationPars::load(), m_args, m_logfile, m_name, m_need_help, m_parfile, m_pars, m_pars_loaded, m_version, name(), par_filename(), set_log_chatter(), set_log_filename(), set_statistics(), gammalib::strip_whitespace(), and version().

GApplication::GApplication ( const GApplication app)

Copy constructor.

Parameters
[in]appApplication.

Definition at line 257 of file GApplication.cpp.

References copy_members(), init_members(), and set_statistics().

GApplication::~GApplication ( void  )

Destructor.

Definition at line 276 of file GApplication.cpp.

References free_members().

Member Function Documentation

void GApplication::add_celapse ( const double &  celapse)
inline

Add CPU seconds to internal counter.

Parameters
[in]celapseCPU seconds.

Adds the celapse CPU seconds to the internal CPU seconds counter.

Definition at line 282 of file GApplication.hpp.

References celapse(), and m_celapse.

const std::vector< std::string > & GApplication::args ( void  ) const
inline

Return command line arguments.

Returns
Command line arguments.

Definition at line 401 of file GApplication.hpp.

References m_args.

double GApplication::celapse ( void  ) const

Return application elapsed time in CPU seconds.

Returns
Application elapsed time in CPU seconds.

Returns the CPU seconds that were consumed by the application. The content of m_celapse is added to the measurement which allows tracking of additional CPU seconds from child processes that are not properly tracked otherwise.

Definition at line 408 of file GApplication.cpp.

References m_celapse, and m_cstart.

Referenced by add_celapse(), gCO2e(), log_trailer(), and write_statistics().

std::string GApplication::classname ( void  ) const
inlinevirtual

Return class name.

Returns
String containing the class name ("GApplication").

Implements GBase.

Definition at line 181 of file GApplication.hpp.

void GApplication::clear ( void  )
virtual
bool GApplication::clobber ( void  ) const

Return clobber.

Returns
True if the clobber parameter is true.

The clobber indicates if existing files should be overwritten.

Definition at line 777 of file GApplication.cpp.

References m_pars.

GApplication * GApplication::clone ( void  ) const
virtual

Clone application.

Returns
Pointer to deep copy of application.

Implements GBase.

Definition at line 372 of file GApplication.cpp.

References GApplication().

void GApplication::copy_members ( const GApplication app)
protected

Copy class members.

Parameters
[in]appApplication.

Copies all class members.

Definition at line 1271 of file GApplication.cpp.

References log, m_args, m_celapse, m_cstart, m_logfile, m_name, m_need_help, m_parfile, m_pars, m_pars_loaded, m_statistics, m_tstart, and m_version.

Referenced by GApplication(), and operator=().

void GApplication::free_members ( void  )
protected

Delete class members.

Definition at line 1298 of file GApplication.cpp.

References logFileClose(), m_pars, m_pars_loaded, par_filename(), GApplicationPars::save(), and write_statistics().

Referenced by clear(), operator=(), and ~GApplication().

double GApplication::gCO2e ( const std::string &  country) const

Return application equivalent CO2 footprint (units: g CO2e)

Parameters
[in]countryCountry where computation is performed.
Returns
Application equivalent CO2 footprint (g CO2e).

The method returns the equivalent CO2 footprint in grams after the currently elpased CPU time, as returned by celapse(). The method assumes an emission factor of 4.68 g CO2e / CPU hour as estimated by Berthoud et al. (2020) (https://hal.archives-ouvertes.fr/hal-02549565v4/document), where 2.43 g CO2e / CPU hour are due to electricity use and 2.25 g CO2e / CPU hour are due to fabrication and personnel. Specifically the footprint estimated includes

  • server fabrication
  • server environment
  • server usage (electricity)
  • travelling of personnel in the context of their work
  • travelling of personnel from home to office
  • personnel equipment
  • personnel energy

The emission factors are based on an estimate done for the DAHU cluster of the UMS GRICAD in 2019. Note that the electricity footprint a carbon intensity of 108 g eCO2 / kWh was assumed.

The method tries to determine the appropriate carbon intensity from the two-digit country code and then computes the applicable emission factor \(EF\) in units of g CO2e / CPU hour using

\[ EF = 2.25 + 2.43 \frac{CI}{108} \]

where \(CI\) is the country specific carbon intensity of electricity generation, given in units of g eCO2 / kWh.

The equivalent CO2 footprint is then computed by multiplying \(EF\) by the number of CPU hours.

Country specific carbon intensities are specified by the file share/refdata/emission-factors.fits.

Definition at line 468 of file GApplication.cpp.

References celapse(), GFilename::is_fits(), GFitsTable::nrows(), GFitsTableCol::real(), GFitsTableCol::string(), and GFits::table().

Referenced by log_trailer(), and write_statistics().

bool GApplication::has_par ( const std::string &  name) const
inline

Signal if specified parameter exists.

Parameters
[in]nameParameter name.
Returns
True if an application parameter with the specified name exists.

Definition at line 296 of file GApplication.hpp.

References GApplicationPars::contains(), and m_pars.

Referenced by logFileOpen().

void GApplication::init_members ( void  )
protected
const std::string & GApplication::log_filename ( void  ) const
inline

Returns log filename.

Returns
Log filename.

Definition at line 321 of file GApplication.hpp.

References m_logfile, and set_log_filename().

Referenced by logFileOpen().

void GApplication::log_header ( void  )

Write application header in log file.

Dump the application header into the log file. The header is composed of a fixed width block delimined by "*" characters that contains information about the application name and version.

Definition at line 794 of file GApplication.cpp.

References gammalib::centre(), gammalib::fill(), GLog::indent(), gammalib::left(), log, m_name, and m_version.

Referenced by logFileOpen().

void GApplication::log_header1 ( const GChatter chatter,
const std::string &  header 
)

Write header 1 in log file.

Parameters
[in]chatterMinimum required chattiness
[in]headerHeader string

Writes a header of level 1 into the log file if chattiness is at least chatter.

Definition at line 996 of file GApplication.cpp.

References GLog::header1(), log, and m_pars.

void GApplication::log_header2 ( const GChatter chatter,
const std::string &  header 
)

Write header 2 in log file.

Parameters
[in]chatterMinimum required chattiness
[in]headerHeader string

Writes a header of level 2 into the log file if chattiness is at least chatter.

Definition at line 1023 of file GApplication.cpp.

References GLog::header2(), log, and m_pars.

void GApplication::log_header3 ( const GChatter chatter,
const std::string &  header 
)

Write header 3 in log file.

Parameters
[in]chatterMinimum required chattiness
[in]headerHeader string

Writes a header of level 3 into the log file if chattiness is at least chatter.

Definition at line 1049 of file GApplication.cpp.

References GLog::header3(), log, and m_pars.

void GApplication::log_parameters ( const GChatter chatter)

Write application parameters in log file.

Parameters
[in]chatterMinimum required chattiness

Writes all application parameters in the log file. For parameters that have not yet been queried the method does not write the current value but signals [not queried].

Definition at line 1075 of file GApplication.cpp.

References gammalib::fill(), GLog::header1(), log, GApplicationPars::m_pars, m_pars, name(), and GApplicationPars::size().

void GApplication::log_string ( const GChatter chatter,
const std::string &  string,
const bool &  linefeed = true 
)

Write string in log file.

Parameters
[in]chatterMinimum required chattiness
[in]stringString
[in]linefeedTerminate string with linefeed?

Writes a string into the log file if chattiness is at least chatter. If linefeed is true the string is terminated with a linefeed.

Definition at line 861 of file GApplication.cpp.

References log, and m_pars.

void GApplication::log_trailer ( void  )

Write application trailer in log file.

The application trailer gives the total number of elapsed calendar and CPU seconds, as well as the carbon footprint of the application execution.

Definition at line 820 of file GApplication.cpp.

References celapse(), gCO2e(), gammalib::host_country(), GLog::indent(), log, m_name, and telapse().

Referenced by logFileClose().

void GApplication::log_value ( const GChatter chatter,
const std::string &  name,
const std::string &  value,
const std::string &  unit = "" 
)

Write parameter value in log file.

Parameters
[in]chatterMinimum required chattiness
[in]nameParameter name string
[in]valueValue string
[in]unitValue unit string

Writes a parameter value into the log file if chattiness is at least chatter.

Definition at line 893 of file GApplication.cpp.

References log, m_pars, and gammalib::parformat().

void GApplication::log_value ( const GChatter chatter,
const std::string &  name,
const int &  value,
const std::string &  unit = "" 
)

Write parameter value in log file.

Parameters
[in]chatterMinimum required chattiness
[in]nameParameter name string
[in]valueInteger value
[in]unitValue unit string

Writes a parameter value into the log file if chattiness is at least chatter.

Definition at line 928 of file GApplication.cpp.

References log, m_pars, and gammalib::parformat().

void GApplication::log_value ( const GChatter chatter,
const std::string &  name,
const double &  value,
const std::string &  unit = "" 
)

Write parameter value in log file.

Parameters
[in]chatterMinimum required chattiness
[in]nameParameter name string
[in]valueFloating point value
[in]unitValue unit string

Writes a parameter value into the log file if chattiness is at least chatter.

Definition at line 963 of file GApplication.cpp.

References log, m_pars, and gammalib::parformat().

bool GApplication::logDebug ( void  ) const

Signal debug logging.

Returns
True if the debugging mode has been selected.

The debug level is used for application debugging.

Definition at line 760 of file GApplication.cpp.

References m_pars.

Referenced by logFileOpen().

bool GApplication::logExplicit ( void  ) const

Signal explicit logging.

Returns
True if at least explicit logging is requested.

The explicit level is used for detailed application information that should be logged in detailed studies (chatter >= 3).

Definition at line 726 of file GApplication.cpp.

References m_pars.

void GApplication::logFileClose ( void  )

Close log file.

Close the log file. In case that some characters have been written through the logger a trailer will be appended to the logger before closing the log file. The trailer informs about the computation time used by the application.

Definition at line 659 of file GApplication.cpp.

References GLog::close(), GLog::is_open(), log, log_trailer(), and GLog::written_size().

Referenced by free_members().

void GApplication::logFileOpen ( const bool &  clobber = true)

Open log file.

Parameters
[in]clobberOverwrite (true) or append (false) to existing file (defaults to true)

Opens application log file and sets the logger chattiness dependent on the chatter parameter of the application.

Definition at line 622 of file GApplication.cpp.

References GLog::cout(), has_par(), log, log_filename(), log_header(), logDebug(), GLog::open(), and set_log_chatter().

bool GApplication::logNormal ( void  ) const

Signal normal logging.

Returns
True if at least normal logging is requested.

The normal level is used for standard application information that should be logged in normal operations (chatter >= 2).

Definition at line 708 of file GApplication.cpp.

References m_pars.

bool GApplication::logTerse ( void  ) const

Signal terse logging.

Returns
True if at least terse logging is requested.

The terse level is used for the most crucial application information that should be logged in all cases (chatter >= 1).

Definition at line 690 of file GApplication.cpp.

References m_pars.

bool GApplication::logVerbose ( void  ) const

Signal verbose logging.

Returns
True if verbose logging is requested.

The verbose level is used for full application information (chatter >= 4).

Definition at line 743 of file GApplication.cpp.

References m_pars.

const std::string & GApplication::name ( void  ) const
inline

Return application name.

Returns
Application name.

Definition at line 256 of file GApplication.hpp.

References m_name.

Referenced by clear(), GApplication(), log_parameters(), print(), stamp(), and write_statistics().

const bool & GApplication::need_help ( void  ) const
inline

Signals if –help option has been specified.

Returns
True if –help option has been specified.

Definition at line 337 of file GApplication.hpp.

References m_need_help.

GApplication & GApplication::operator= ( const GApplication app)

Assignment operator.

Parameters
[in]appApplication.
Returns
Application.

Definition at line 298 of file GApplication.cpp.

References copy_members(), free_members(), init_members(), and set_statistics().

GApplicationPar & GApplication::operator[] ( const int &  index)
inline

Parameter access operator.

Parameters
[in]indexParameter index [0,...,pars().size()-1].
Returns
Reference to application parameter

Returns a reference to the application parameter with the given index. No range checking is performed for the index.

Definition at line 228 of file GApplication.hpp.

References m_pars.

const GApplicationPar & GApplication::operator[] ( const int &  index) const
inline

Parameter access operator (const version)

Parameters
[in]indexParameter index [0,...,pars().size()-1].
Returns
Constant reference to application parameter

Returns a const reference to the application parameter with the given index. No range checking is performed for the index.

Definition at line 244 of file GApplication.hpp.

References m_pars.

GApplicationPar & GApplication::operator[] ( const std::string &  name)
inline

Parameter access operator.

Parameters
[in]nameParameter name.
Returns
Reference to application parameter.

Returns a reference to the application parameter with the given name.

Definition at line 196 of file GApplication.hpp.

References m_pars.

const GApplicationPar & GApplication::operator[] ( const std::string &  name) const
inline

Parameter access operator (const version)

Parameters
[in]nameParameter name.
Returns
Constant reference to application parameter

Returns a const reference to the application parameter with the given name.

Definition at line 212 of file GApplication.hpp.

References m_pars.

const std::string & GApplication::par_filename ( void  ) const
inline

Returns parameter filename.

Returns
Parameter filename.

Definition at line 308 of file GApplication.hpp.

References m_parfile.

Referenced by clear(), free_members(), and GApplication().

const GApplicationPars & GApplication::pars ( void  ) const
inline

Return application parameters.

Returns
Application parameters.

Definition at line 376 of file GApplication.hpp.

References m_pars.

Referenced by GApplication(), and pars().

void GApplication::pars ( const GApplicationPars pars)
inline

Set application parameters.

Parameters
[in]parsApplication parameters.

Definition at line 388 of file GApplication.hpp.

References m_pars, and pars().

std::string GApplication::print ( const GChatter chatter = NORMAL) const
virtual

Print application.

Parameters
[in]chatterChattiness.
Returns
String containing application information.

Implements GBase.

Definition at line 1180 of file GApplication.cpp.

References m_args, GApplicationPars::m_pars, m_pars, name(), gammalib::parformat(), running(), SILENT, GApplicationPars::size(), gammalib::str(), and version().

static int& GApplication::running ( )
inlinestaticprotected

Definition at line 144 of file GApplication.hpp.

Referenced by print(), and set_statistics().

void GApplication::set_log_chatter ( void  )
protected

Set chattiness of logger.

Definition at line 1340 of file GApplication.cpp.

References GLog::chatter(), log, and m_pars.

Referenced by clear(), GApplication(), and logFileOpen().

void GApplication::set_log_filename ( void  )
protected

Set log filename from "logfile" parameter.

If the application parameters contain a "logfile" parameter then set the file name of the log file from this parameter.

In case that the file name is not valid, the file name will be set to an empty string, which will prevent opening a log file.

Definition at line 1370 of file GApplication.cpp.

References GApplicationPars::contains(), m_logfile, and m_pars.

Referenced by clear(), GApplication(), and log_filename().

void GApplication::set_statistics ( void  )
protected

Set statistics according to parent child status.

Makes sure that application statistics are only written for the parent which is the first running instances. If this instance signals that an instance is already running, this instance is a child process that was started by another running instance.

Definition at line 1324 of file GApplication.cpp.

References running(), and statistics().

Referenced by GApplication(), and operator=().

void GApplication::stamp ( GFitsHDU hdu) const

Stamp FITS header with provenance information.

Parameters
[in]hduFITS header.

Write provenance information into a FITS header.

Definition at line 1119 of file GApplication.cpp.

References GFitsHDU::card(), name(), and version().

Referenced by stamp().

void GApplication::stamp ( GFits fits) const

Stamp all headers in FITS object with provenance information.

Parameters
[in]fitsFITS object.

Write provenance information into all headers of FITS object.

Definition at line 1139 of file GApplication.cpp.

References GFits::size(), and stamp().

void GApplication::stamp ( const GFilename filename) const

Stamp all headers in FITS file with provenance information.

Parameters
[in]filenameFITS file name.

Write provenance information into all headers of FITS file.

Definition at line 1158 of file GApplication.cpp.

References GFits::save(), and stamp().

void GApplication::statistics ( const bool &  statistics)
inline

Set if statistics will be written.

Parameters
[in]statisticsWrite statistics?

Definition at line 350 of file GApplication.hpp.

References m_statistics, and statistics().

const bool & GApplication::statistics ( void  ) const
inline

Signals if statistics will be written.

Returns
True if statistics will be written.

Definition at line 363 of file GApplication.hpp.

References m_statistics.

Referenced by set_statistics(), and statistics().

double GApplication::telapse ( void  ) const

Return application elapsed time in calendar seconds.

Returns
Application elapsed time in calendar seconds.

Definition at line 384 of file GApplication.cpp.

References m_tstart.

Referenced by log_trailer(), and write_statistics().

const std::string & GApplication::version ( void  ) const
inline

Return application version.

Returns
Application version.

Definition at line 268 of file GApplication.hpp.

References m_version.

Referenced by clear(), GApplication(), print(), stamp(), and write_statistics().

void GApplication::write_statistics ( void  )
protected

Write application statistics.

Write application statistics in a global ASCII file.

Definition at line 1395 of file GApplication.cpp.

References celapse(), gammalib::gamma_filename(), gCO2e(), gammalib::host_country(), m_statistics, name(), gammalib::strdate(), telapse(), GFilename::url(), and version().

Referenced by free_members().

Member Data Documentation

std::vector<std::string> GApplication::m_args
protected

Command line arguments.

Definition at line 164 of file GApplication.hpp.

Referenced by args(), copy_members(), GApplication(), init_members(), and print().

double GApplication::m_celapse
protected

Internal CPU seconds counter.

Definition at line 167 of file GApplication.hpp.

Referenced by add_celapse(), celapse(), copy_members(), and init_members().

double GApplication::m_cstart
protected

Clock start time of execution.

Definition at line 166 of file GApplication.hpp.

Referenced by celapse(), copy_members(), and init_members().

std::string GApplication::m_logfile
protected

Log filename.

Definition at line 163 of file GApplication.hpp.

Referenced by clear(), copy_members(), GApplication(), init_members(), log_filename(), and set_log_filename().

std::string GApplication::m_name
protected

Application name.

Definition at line 160 of file GApplication.hpp.

Referenced by clear(), copy_members(), GApplication(), init_members(), log_header(), log_trailer(), and name().

bool GApplication::m_need_help
protected

–help specified

Definition at line 170 of file GApplication.hpp.

Referenced by copy_members(), GApplication(), init_members(), and need_help().

std::string GApplication::m_parfile
protected

Parameter filename.

Definition at line 162 of file GApplication.hpp.

Referenced by clear(), copy_members(), GApplication(), init_members(), and par_filename().

bool GApplication::m_pars_loaded
protected

Application parameters loaded.

Definition at line 169 of file GApplication.hpp.

Referenced by clear(), copy_members(), free_members(), GApplication(), and init_members().

bool GApplication::m_statistics
protected

Enable writing of statistics.

Definition at line 171 of file GApplication.hpp.

Referenced by copy_members(), init_members(), statistics(), and write_statistics().

std::time_t GApplication::m_tstart
protected

Calendar start time of execution.

Definition at line 165 of file GApplication.hpp.

Referenced by copy_members(), init_members(), and telapse().

std::string GApplication::m_version
protected

Application version.

Definition at line 161 of file GApplication.hpp.

Referenced by clear(), copy_members(), GApplication(), init_members(), log_header(), and version().


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