Elements  6.0.1
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SimpleProgramExample.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
28 #include "ElementsKernel/Unused.h"
29 
30 using std::map;
31 using std::string;
32 
33 namespace Elements {
34 namespace Examples {
35 
44 class SimpleProgramExample : public Program {
45 
46 public:
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 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Macro to silence unused variables warnings from the compiler.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, VariableValue > &args) override
The &quot;main&quot; method.
ELEMENTS_API void nanoSleep(std::int64_t nsec)
Small variation on the sleep function for nanoseconds sleep.
Definition: Sleep.cpp:39
Everything is OK.
T endl(T...args)
Abstract class for all Elements programs.
Definition: Program.h:52
STL class.
STL class.
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:113
#define ELEMENTS_UNUSED
Definition: Unused.h:39
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63