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