Elements
5.10
A C++ base framework for the Euclid Software.
ElementsExamples
src
program
GslExample.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
#include <boost/format.hpp>
// for format
25
26
#include <gsl/gsl_version.h>
27
#include <gsl/gsl_sf_bessel.h>
// for gsl_sf_bessel_J0
28
29
#include "
ElementsKernel/ProgramHeaders.h
"
// for including all Program/related headers
30
#include "
ElementsKernel/Unused.h
"
// for ELEMENTS_UNUSED
31
32
using
std::map
;
33
using
std::string
;
34
using
boost::program_options::variable_value;
35
36
namespace
Elements
{
37
namespace
Examples {
38
39
class
GslExample
:
public
Program
{
40
41
public
:
42
43
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, variable_value>
& args)
override
{
44
45
auto
log
=
Logging::getLogger
(
"GslExample"
);
46
47
log
.info() <<
"GSL version: "
<< gsl_version;
48
49
double
x = 5.0;
50
double
y = gsl_sf_bessel_J0(x);
51
52
log
.info() << boost::format(
"J0(%g) = %.18e\n"
) % x % y;
53
54
return
ExitCode::OK
;
55
56
}
57
58
};
59
60
}
// namespace Examples
61
}
// namespace Elements
62
63
68
MAIN_FOR
(
Elements::Examples::GslExample
)
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Examples::GslExample::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
Definition:
GslExample.cpp:43
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:98
std::map
STL class.
ProgramHeaders.h
Elements::Examples::GslExample
Definition:
GslExample.cpp:39
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
Unused.h
Macro to silence unused variables warnings from the compiler.
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements
Definition:
ClassExample.h:38
Generated by
1.8.18