27 #ifndef GAPPLICATION_HPP
28 #define GAPPLICATION_HPP
62 const std::string& version,
65 const std::string& version,
82 const std::string&
name(
void)
const;
83 const std::string&
version(
void)
const;
86 double gCO2e(
const std::string& country)
const;
96 bool has_par(
const std::string& name)
const;
102 const std::string&
string,
103 const bool& linefeed =
true);
105 const std::string& name,
106 const std::string& value);
108 const std::string& name,
111 const std::string& name,
112 const double& value);
114 const std::string& header);
116 const std::string& header);
118 const std::string& header);
125 const std::vector<std::string>&
args(
void)
const;
142 static int m_running = 0;
180 return (
"GApplication");
GApplication(void)
Void constructor.
bool logTerse(void) const
Signal terse logging.
Application parameter container class definition.
void set_log_chatter(void)
Set chattiness of logger.
Application parameter container class.
void log_header3(const GChatter &chatter, const std::string &header)
Write header 3 in log file.
void log_value(const GChatter &chatter, const std::string &name, const std::string &value)
Write parameter value in log file.
void write_statistics(void)
Write application statistics.
~GApplication(void)
Destructor.
const std::string & name(void) const
Return application name.
void set_log_filename(void)
Set log filename from "logfile" parameter.
void copy_members(const GApplication &app)
Copy class members.
double m_celapse
Internal CPU seconds counter.
std::time_t m_tstart
Calendar start time of execution.
const bool & statistics(void) const
Signals if statistics will be written.
GApplication * clone(void) const
Clone application.
Abstract FITS extension base class.
const std::string & log_filename(void) const
Returns log filename.
bool has_par(const std::string &name) const
Signal if specified parameter exists.
void logFileClose(void)
Close log file.
double m_cstart
Clock start time of execution.
const std::string & par_filename(void) const
Returns parameter filename.
Definition of interface for all GammaLib classes.
void add_celapse(const double &celapse)
Add CPU seconds to internal counter.
void log_header2(const GChatter &chatter, const std::string &header)
Write header 2 in log file.
std::string m_logfile
Log filename.
void log_header(void)
Write application header in log file.
void log_string(const GChatter &chatter, const std::string &string, const bool &linefeed=true)
Write string in log file.
double celapse(void) const
Return application elapsed time in CPU seconds.
void stamp(GFitsHDU &hdu) const
Stamp FITS header with provenance information.
void log_trailer(void)
Write application trailer in log file.
GApplication & operator=(const GApplication &app)
Assignment operator.
bool logExplicit(void) const
Signal explicit logging.
void init_members(void)
Initialise class members.
void clear(void)
Clear application.
bool logNormal(void) const
Signal normal logging.
std::vector< std::string > m_args
Command line arguments.
Information logger interface definition.
void log_header1(const GChatter &chatter, const std::string &header)
Write header 1 in log file.
bool clobber(void) const
Return clobber.
std::string classname(void) const
Return class name.
Interface class for all GammaLib classes.
const bool & need_help(void) const
Signals if –help option has been specified.
double telapse(void) const
Return application elapsed time in calendar seconds.
void set_statistics(void)
Set statistics according to parent child status.
void free_members(void)
Delete class members.
bool m_pars_loaded
Application parameters loaded.
std::string m_version
Application version.
std::string print(const GChatter &chatter=NORMAL) const
Print application.
bool m_need_help
–help specified
const std::string & version(void) const
Return application version.
void logFileOpen(const bool &clobber=true)
Open log file.
void log_parameters(const GChatter &chatter)
Write application parameters in log file.
const GApplicationPars & pars(void) const
Return application parameters.
GLog log
Application logger.
GApplicationPars m_pars
Application parameters.
Information logger class definition.
bool logDebug(void) const
Signal debug logging.
Application parameter class.
bool logVerbose(void) const
Signal verbose logging.
GammaLib application interface definition.
GApplicationPar & operator[](const int &index)
Parameter access operator.
std::string m_name
Application name.
bool m_statistics
Enable writing of statistics.
const std::vector< std::string > & args(void) const
Return command line arguments.
double gCO2e(const std::string &country) const
Return application equivalent CO2 footprint (units: g CO2e)
std::string m_parfile
Parameter filename.
bool contains(const std::string &name) const
Check parameter exists.