Elements  5.10
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 
25 #include "ElementsKernel/Exit.h" // For ExitCode
26 #include "ElementsKernel/Exception.h" // For Exception
27 
28 namespace Elements {
29 namespace Examples {
30 
31 
41 
42 public:
43 
44  void defineOptions() override {
45 
46  }
47 
59  ExitCode main() override {
60 
61  std::cout << "Program name: " << getProgramName() << std::endl;
62  std::cout << "Program path: " << getProgramPath() << std::endl;
63 
64  throw Exception("This is an example exception.");
65 
66  return ExitCode::OK;
67 
68  }
69 
70 };
71 
72 } // namespace Examples
73 } // namespace Elements
74 
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:98
#define MAIN(ELEMENTS_PROGRAM)
Definition: SimpleProgram.h:87
Everything is OK.
T endl(T...args)
ExitCode main() override
The &quot;main&quot; method.
ELEMENTS_API const boost::filesystem::path & getProgramPath() const
define a list of standard exit codes for executables
Elements base exception class.
Definition: Exception.h:46
ELEMENTS_API const boost::filesystem::path & getProgramName() const
defines the base Elements exception class