Elements  5.10
A C++ base framework for the Euclid Software.
Public Member Functions | List of all members
Elements::Examples::ProgramExample Class Reference

Simple example of an Elements program. More...

Inheritance diagram for Elements::Examples::ProgramExample:
[legend]
Collaboration diagram for Elements::Examples::ProgramExample:
[legend]

Public Member Functions

options_description defineSpecificProgramOptions () override
 Allows to define the (command line and configuration file) options specific to this program. More...
 
ExitCode mainMethod (map< string, variable_value > &args) override
 The "main" method. More...
 
- Public Member Functions inherited from Elements::Program
 Program ()=default
 Constructor. More...
 
virtual ~Program ()
 Destructor. More...
 
virtual std::pair< boost::program_options::options_description, boost::program_options::positional_options_description > defineProgramArguments ()
 This methods must be used to the program arguments. More...
 
virtual ExitCode mainMethod (std::map< std::string, boost::program_options::variable_value > &args)=0
 This is the "main" method of all Elements programs. More...
 

Detailed Description

Simple example of an Elements program.

All C++ executable must extend the Elements::Program base class

Examples:
ElementsExamples/src/program/ProgramExample.cpp, and ElementsExamples/src/program/SimpleProgramExample.cpp.

Definition at line 76 of file ProgramExample.cpp.

Member Function Documentation

◆ defineSpecificProgramOptions()

options_description Elements::Examples::ProgramExample::defineSpecificProgramOptions ( )
inlineoverridevirtual

Allows to define the (command line and configuration file) options specific to this program.

See the ElementsProgram documentation for more details.

Returns
A BOOST program options_description

Reimplemented from Elements::Program.

Examples:
ElementsExamples/src/program/ProgramExample.cpp, and ElementsExamples/src/program/SimpleProgramExample.cpp.

Definition at line 89 of file ProgramExample.cpp.

◆ mainMethod()

ExitCode Elements::Examples::ProgramExample::mainMethod ( map< string, variable_value > &  args)
inlineoverride

The "main" method.

This method is the entry point to the program. In this sense, it is similar to a main (and it is why it is called mainMethod()). The code below contains the calls to the different classes created for the first developer's workshop

See the ElementsProgram documentation for more details.

Examples:
ElementsExamples/src/program/ProgramExample.cpp, and ElementsExamples/src/program/SimpleProgramExample.cpp.

Definition at line 139 of file ProgramExample.cpp.

References Elements::Examples::ClassExample::divideNumbers(), Elements::Units::e, Elements::Examples::ClassExample::factoryMethod(), Elements::Examples::functionExample(), Elements::Examples::ClassExample::fundamentalTypeMethod(), Elements::Logging::getLogger(), Elements::System::getThisExecutableInfo(), Elements::Examples::log, std::move(), Elements::Examples::myLocalLogTestFunc(), Elements::System::ModuleInfo::name(), Elements::OK, Elements::Examples::ClassExample::passingObjectInGeneral(), Elements::Examples::ClassExample::passingUniquePointer(), and Elements::Units::second.

Here is the call graph for this function:

The documentation for this class was generated from the following file: