Elements  6.0.1
A C++ base framework for the Euclid Software.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AnotherSimpleProgramExample.cpp
Go to the documentation of this file.
1 
22 #include <iostream>
23 
24 #include "ElementsKernel/Exception.h" // For Exception
25 #include "ElementsKernel/Exit.h" // For ExitCode
27 
28 namespace Elements {
29 namespace Examples {
30 
40 
41 public:
42  void defineOptions() override {}
43 
55  ExitCode main() override {
56 
57  std::cout << "Program name: " << getProgramName() << std::endl;
58  std::cout << "Program path: " << getProgramPath() << std::endl;
59 
60  throw Exception("This is an example exception.");
61 
62  return ExitCode::OK;
63  }
64 };
65 
66 } // namespace Examples
67 } // namespace Elements
68 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
#define MAIN(ELEMENTS_PROGRAM)
Definition: SimpleProgram.h:79
Everything is OK.
ELEMENTS_API const Path::Item & getProgramPath() const
T endl(T...args)
ExitCode main() override
The &quot;main&quot; method.
ELEMENTS_API const Path::Item & getProgramName() const
define a list of standard exit codes for executables
Elements base exception class.
Definition: Exception.h:47
defines the base Elements exception class