Elements  6.2
A C++ base framework for the Euclid Software.
Public Types | Public Member Functions | List of all members
Elements::Program Class Referenceabstract

Abstract class for all Elements programs. More...

#include <Program.h>

Inheritance diagram for Elements::Program:
Inheritance graph
[legend]

Public Types

using options_description = boost::program_options::options_description
 
using positional_options_description = boost::program_options::positional_options_description
 
using variable_value = boost::program_options::variable_value
 
using variables_map = boost::program_options::variables_map
 
using OptionsDescription = options_description
 
using PositionalOptionsDescription = positional_options_description
 
using VariableValue = variable_value
 
using VariablesMap = variables_map
 
using ExitCode = Elements::ExitCode
 
using Logging = Elements::Logging
 

Public Member Functions

 Program ()=default
 Constructor. More...
 
virtual ~Program ()
 Destructor. More...
 
virtual OptionsDescription defineSpecificProgramOptions ()
 This methods must be used to define specific program options. More...
 
virtual std::pair< OptionsDescription, PositionalOptionsDescriptiondefineProgramArguments ()
 This methods must be used to the program arguments. More...
 
virtual ExitCode mainMethod (std::map< std::string, VariableValue > &args)=0
 This is the "main" method of all Elements programs. More...
 

Detailed Description

Abstract class for all Elements programs.

This abstract class defines the three interfaces that should be implemented by all Elements programs.

Examples
ElementsExamples/src/program/Program.cpp, and ElementsExamples/src/program/SimpleProgram.cpp.

Definition at line 52 of file Program.h.

Member Typedef Documentation

◆ ExitCode

◆ Logging

Definition at line 68 of file Program.h.

◆ options_description

using Elements::Program::options_description = boost::program_options::options_description

Definition at line 56 of file Program.h.

◆ OptionsDescription

◆ positional_options_description

using Elements::Program::positional_options_description = boost::program_options::positional_options_description

Definition at line 57 of file Program.h.

◆ PositionalOptionsDescription

Definition at line 63 of file Program.h.

◆ variable_value

using Elements::Program::variable_value = boost::program_options::variable_value

Definition at line 58 of file Program.h.

◆ variables_map

using Elements::Program::variables_map = boost::program_options::variables_map

Definition at line 59 of file Program.h.

◆ VariablesMap

Definition at line 65 of file Program.h.

◆ VariableValue

Definition at line 64 of file Program.h.

Constructor & Destructor Documentation

◆ Program()

Elements::Program::Program ( )
default

Constructor.

◆ ~Program()

Elements::Program::~Program ( )
virtualdefault

Destructor.

Member Function Documentation

◆ defineProgramArguments()

std::pair< OptionsDescription, PositionalOptionsDescription > Elements::Program::defineProgramArguments ( )
virtual

This methods must be used to the program arguments.

This is the second method that must be implemented by all Elements programs

Returns
a pair of BOOST options description and positional_options_description

Reimplemented in Elements::Examples::ProgramWithArguments.

Definition at line 36 of file Program.cpp.

References std::make_pair().

Here is the call graph for this function:

◆ defineSpecificProgramOptions()

OptionsDescription Elements::Program::defineSpecificProgramOptions ( )
virtual

This methods must be used to define specific program options.

This is the first method that must be implemented by all Elements programs

Returns
A BOOST options description

Reimplemented in Elements::Examples::Program, and ExtProgram.

Definition at line 31 of file Program.cpp.

◆ mainMethod()

virtual ExitCode Elements::Program::mainMethod ( std::map< std::string, VariableValue > &  args)
pure virtual

This is the "main" method of all Elements programs.

This is the second method that must be implemented by all Elements programs. It represents the entry point.

Parameters
argsA map containing the values given by the user for the program options defined by the defineSpecificProgramOptions() method
Returns
The exit code which should be returned when the program exits

Implemented in Elements::Examples::Program, ExtProgram, and Elements::Examples::OpenMP.


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