Elements  6.2
A C++ base framework for the Euclid Software.
AnotherSimpleProgram.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 
Elements::ExitCode::OK
@ OK
Everything is OK.
Elements::Examples::AnotherSimpleProgram::main
ExitCode main() override
The "main" method.
Definition: AnotherSimpleProgram.cpp:55
SimpleProgram.h
Exit.h
define a list of standard exit codes for executables
Elements::ExitCode
ExitCode
Strongly typed exit numbers.
Definition: Exit.h:97
Exception.h
defines the base Elements exception class
std::cout
Elements::Exception
Elements base exception class.
Definition: Exception.h:47
std::endl
T endl(T... args)
Elements::Examples::SimpleProgram
Example of an Elements program.
Definition: SimpleProgram.cpp:44
Elements::Examples::AnotherSimpleProgram
Example of an Elements program.
Definition: AnotherSimpleProgram.cpp:39
MAIN
#define MAIN(ELEMENTS_PROGRAM)
Definition: SimpleProgram.h:79
Elements::Examples::AnotherSimpleProgram::defineOptions
void defineOptions() override
Definition: AnotherSimpleProgram.cpp:42
Elements
Definition: callBackExample.h:35