Elements
5.10
A C++ base framework for the Euclid Software.
ElementsExamples
src
program
GnuAstroExample.cpp
Go to the documentation of this file.
1
21
#include <map>
// for map
22
#include <string>
// for string
23
#include <boost/program_options.hpp>
// for program options from configuration file of command line arguments
24
25
#include <gnuastro/fits.h>
// header file to test
26
#include <gnuastro/cosmology.h>
27
28
#include "
ElementsKernel/ProgramHeaders.h
"
// for including all Program/related headers
29
#include "
ElementsKernel/Unused.h
"
// for ELEMENTS_UNUSED
30
#include "
ElementsKernel/Auxiliary.h
"
31
32
using
std::string
;
33
using
std::map
;
34
using
boost::program_options::variable_value;
35
36
namespace
Elements
{
37
namespace
Examples {
38
39
class
GnuAstroExample
:
public
Program
{
40
41
public
:
42
43
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, variable_value>
& args)
override
{
44
45
auto
log
=
Logging::getLogger
(
"GnuAstroExample"
);
46
47
string
test_upper_string {
"THATSTRING"
};
48
log
.info() <<
"This is the test upper string: "
<< test_upper_string;
49
50
double
z {2.5};
51
double
H0 {67.66};
52
53
auto
age = gal_cosmology_age(z, H0, 0.0, 0.0, 0.0);
54
55
log
.info() <<
"Age of the Universe @ z = "
<< z <<
" : "
<< age <<
" GA"
;
56
57
58
return
ExitCode::OK
;
59
60
}
61
62
};
63
64
}
// namespace Examples
65
}
// namespace Elements
66
71
MAIN_FOR
(
Elements::Examples::GnuAstroExample
)
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Examples::GnuAstroExample
Definition:
GnuAstroExample.cpp:39
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:98
std::map
STL class.
ProgramHeaders.h
Elements::Examples::log
auto log
Definition:
BackTraceExample.cpp:38
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition:
Logging.cpp:63
Elements::Program
Abstract class for all Elements programs.
Definition:
Program.h:51
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition:
Main.h:117
Auxiliary.h
provide functions to retrieve auxiliary files
Unused.h
Macro to silence unused variables warnings from the compiler.
Elements::Examples::GnuAstroExample::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
Definition:
GnuAstroExample.cpp:43
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements
Definition:
ClassExample.h:38
Generated by
1.8.18