Elements
6.2
A C++ base framework for the Euclid Software.
ElementsExamples
src
program
BackTrace.cpp
Go to the documentation of this file.
1
21
#include <map>
// for map
22
#include <stdexcept>
// for standard exceptions
23
#include <string>
// for string
24
25
#include "
ElementsExamples/crashingFunction.h
"
// for crashingFunction
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
auto
log
=
Logging::getLogger
(
"BackTraceExample"
);
37
38
void
secondLevelFunction
() {
39
log
.info() <<
"Entering Second Level Function"
;
40
crashingFunction
();
41
}
42
43
void
firstLevelFunction
() {
44
log
.info() <<
"Entering First Level Function"
;
45
secondLevelFunction
();
46
}
47
48
class
BackTrace
:
public
Program
{
49
50
public
:
51
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, VariableValue>
& args)
override
{
52
53
firstLevelFunction
();
54
55
log
.info() <<
"done with test program! "
;
56
57
return
ExitCode::OK
;
58
}
59
};
60
61
}
// namespace Examples
62
}
// namespace Elements
63
68
MAIN_FOR
(
Elements::Examples::BackTrace
)
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Examples::crashingFunction
ELEMENTS_API void crashingFunction()
Definition:
crashingFunction.cpp:31
Elements::Examples::BackTrace
Definition:
BackTrace.cpp:48
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:97
Elements::Examples::Program
Simple example of an Elements program.
Definition:
Program.cpp:79
crashingFunction.h
std::map
STL class.
ProgramHeaders.h
Elements::Examples::log
auto log
Definition:
BackTrace.cpp:36
Elements::Logging::getLogger
static Logging getLogger(const std::string &name="")
Definition:
Logging.cpp:63
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition:
Main.h:113
Elements::Examples::firstLevelFunction
void firstLevelFunction()
Definition:
BackTrace.cpp:43
Unused.h
Macro to silence unused variables warnings from the compiler.
Elements::Examples::secondLevelFunction
void secondLevelFunction()
Definition:
BackTrace.cpp:38
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements::Examples::BackTrace::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
Definition:
BackTrace.cpp:51
Elements
Definition:
callBackExample.h:35
Generated by
1.8.17