Elements
6.0.1
A C++ base framework for the Euclid Software.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
ElementsExamples
src
program
GnuAstroExample.cpp
Go to the documentation of this file.
1
21
#include <map>
// for map
22
#include <string>
// for string
23
24
#include <gnuastro/cosmology.h>
25
#include <gnuastro/fits.h>
// header file to test
26
27
#include "
ElementsKernel/ProgramHeaders.h
"
// for including all Program/related headers
28
#include "
ElementsKernel/Unused.h
"
// for ELEMENTS_UNUSED
29
30
using
std::map
;
31
using
std::string
;
32
33
namespace
Elements {
34
namespace
Examples {
35
36
class
GnuAstroExample
:
public
Program
{
37
38
public
:
39
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, VariableValue>
& args)
override
{
40
41
auto
log
=
Logging::getLogger
(
"GnuAstroExample"
);
42
43
string
test_upper_string{
"THATSTRING"
};
44
log
.info() <<
"This is the test upper string: "
<< test_upper_string;
45
46
double
z{2.5};
47
double
H0{67.66};
48
49
auto
age = gal_cosmology_age(z, H0, 0.0, 0.0, 0.0);
50
51
log
.info() <<
"Age of the Universe @ z = "
<< z <<
" : "
<< age <<
" GA"
;
52
53
return
ExitCode::OK
;
54
}
55
};
56
57
}
// namespace Examples
58
}
// namespace Elements
59
64
MAIN_FOR
(
Elements::Examples::GnuAstroExample
)
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:97
Unused.h
Macro to silence unused variables warnings from the compiler.
Elements::ExitCode::OK
Everything is OK.
Elements::Examples::log
auto log
Definition:
BackTraceExample.cpp:36
Elements::Program
Abstract class for all Elements programs.
Definition:
Program.h:52
std::map
STL class.
std::string
STL class.
Elements::Examples::GnuAstroExample
Definition:
GnuAstroExample.cpp:36
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition:
Main.h:113
Elements::Examples::GnuAstroExample::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition:
GnuAstroExample.cpp:39
ProgramHeaders.h
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition:
Logging.cpp:63
Generated by
1.8.5