Elements
6.2
A C++ base framework for the Euclid Software.
ElementsExamples
src
program
SimpleProgram.cpp
Go to the documentation of this file.
1
22
#include <iostream>
// for cout, endl
23
#include <map>
// for map
24
#include <string>
// for string
25
26
#include "
ElementsKernel/ProgramHeaders.h
"
27
#include "
ElementsKernel/Sleep.h
"
// for nanoSleep
28
#include "
ElementsKernel/Unused.h
"
29
30
using
std::map
;
31
using
std::string
;
32
33
namespace
Elements
{
34
namespace
Examples {
35
44
class
SimpleProgram
:
public
Program
{
45
46
public
:
58
ExitCode
mainMethod
(
ELEMENTS_UNUSED
map<string, VariableValue>
& args)
override
{
59
60
// Get logger and log the entry into the mainMethod
61
auto
log
=
Logging::getLogger
();
62
63
log
.info(
"This Works"
);
64
65
Elements::nanoSleep
(4);
66
67
std::cout
<<
"This Works too!"
<<
std::endl
;
68
69
return
ExitCode::OK
;
70
}
71
};
72
73
}
// namespace Examples
74
}
// namespace Elements
75
76
MAIN_FOR
(
Elements::Examples::SimpleProgram
)
Sleep.h
Elements::ExitCode::OK
@ OK
Everything is OK.
std::string
STL class.
Elements::Examples::SimpleProgram::mainMethod
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
The "main" method.
Definition:
SimpleProgram.cpp:58
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition:
Exit.h:97
Elements::Examples::Program
Simple example of an Elements program.
Definition:
Program.cpp:79
std::cout
Elements::nanoSleep
ELEMENTS_API void nanoSleep(std::int64_t nsec)
Small variation on the sleep function for nanoseconds sleep.
Definition:
Sleep.cpp:39
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
std::endl
T endl(T... args)
MAIN_FOR
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition:
Main.h:113
Unused.h
Macro to silence unused variables warnings from the compiler.
Elements::Examples::SimpleProgram
Example of an Elements program.
Definition:
SimpleProgram.cpp:44
ELEMENTS_UNUSED
#define ELEMENTS_UNUSED
Definition:
Unused.h:39
Elements
Definition:
callBackExample.h:35
Generated by
1.8.17