Elements  5.10
A C++ base framework for the Euclid Software.
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 
26 #include "ElementsKernel/Sleep.h" // for nanoSleep
28 #include "ElementsKernel/Unused.h"
29 
30 namespace po = boost::program_options;
31 
32 using std::map;
33 using std::string;
34 
35 using boost::program_options::variable_value;
36 
37 namespace Elements {
38 namespace Examples {
39 
40 
50 
51 public:
52 
65 
66  // Get logger and log the entry into the mainMethod
67  auto log = Logging::getLogger();
68 
69  log.info("This Works");
70 
72 
73  std::cout << "This Works too!" << std::endl;
74 
75  return ExitCode::OK;
76 
77  }
78 
79 };
80 
81 } // namespace Examples
82 } // namespace Elements
83 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:98
Macro to silence unused variables warnings from the compiler.
ELEMENTS_API void nanoSleep(std::int64_t nsec)
Small variation on the sleep function for nanoseconds sleep.
Definition: Sleep.cpp:40
Everything is OK.
T endl(T... args)
Abstract class for all Elements programs.
Definition: Program.h:51
STL class.
STL class.
ExitCode mainMethod(ELEMENTS_UNUSED map< string, variable_value > &args) override
The "main" method.
#define MAIN_FOR(ELEMENTS_PROGRAM_NAME)
Definition: Main.h:117
#define ELEMENTS_UNUSED
Definition: Unused.h:39
static Logging getLogger(const std::string &name="")
Definition: Logging.cpp:63