![]() |
OTB
9.1.1
Orfeo Toolbox
|
#include <otbWrapperCommandLineLauncher.h>
Inheritance diagram for otb::Wrapper::CommandLineLauncher:
Collaboration diagram for otb::Wrapper::CommandLineLauncher:Public Types | |
| typedef itk::MemberCommand< Self > | AddProcessCommandType |
| typedef itk::SmartPointer< const Self > | ConstPointer |
| enum | ParamResultType { OKPARAM, MISSINGMANDATORYPARAMETER, MISSINGPARAMETERVALUE, WRONGPARAMETERVALUE, INVALIDNUMBEROFVALUE, DEFAULT } |
| typedef CommandLineParser::ParseResultType | ParseResultType |
| typedef itk::SmartPointer< Self > | Pointer |
| typedef CommandLineLauncher | Self |
| typedef itk::Object | Superclass |
| typedef std::vector< StandardOneLineFilterWatcher<> * > | WatcherListType |
Public Member Functions | |
| bool | BeforeExecute () |
| virtual ::itk::LightObject::Pointer | CreateAnother (void) const |
| void | DisplayHelp (bool longHelp=false) |
| bool | Execute () |
| bool | ExecuteAndWriteOutput () |
| virtual const char * | GetNameOfClass () const |
| bool | Load () |
| bool | Load (const std::vector< std::string > &vexp) |
| void | LoadTestEnv () |
Static Public Member Functions | |
| static Pointer | New () |
Protected Member Functions | |
| bool | CheckKeyValidity (std::string &key) |
| bool | CheckParametersPrefix () |
| bool | CheckUnicity () |
| CommandLineLauncher () | |
| void | DeleteWatcherList () |
| void | DisplayOutputParameters () |
| std::string | DisplayParameterHelp (const Parameter::Pointer ¶m, const std::string paramKey, bool longHelp=false) |
| unsigned int | GetMaxKeySize () const |
| void | LinkWatchers (itk::Object *caller, const itk::EventObject &event) |
| bool | LoadApplication () |
| CommandLineLauncher::ParamResultType | LoadParameters () |
| bool | LoadPath () |
| ~CommandLineLauncher () override | |
Private Member Functions | |
| bool | CheckMissingMandatoryParameter (const std::string ¶mKey) const |
| bool | CheckOutputPathsValidity (const std::string ¶mKey) const |
| void | CheckUnusedParameter (const std::string ¶mKey) const |
| CommandLineLauncher (const CommandLineLauncher &)=delete | |
| bool | ExecuteAndWriteOutputNoCatch () |
| void | operator= (const CommandLineLauncher &)=delete |
Private Attributes | |
| AddProcessCommandType::Pointer | m_AddProcessCommand |
| Application::Pointer | m_Application |
| itk::StdStreamLogOutput::Pointer | m_LogOutput |
| CommandLineParser::Pointer | m_Parser |
| std::string | m_Path |
| bool | m_ReportProgress |
| std::vector< std::string > | m_VExpression |
| WatcherListType | m_WatcherList |
This class check the validity of a command line application.
To be valid, the expression must be as follow: ModuleName (ModulePath) –attribut1_Key attribut1_Value –attribut2_Key attribut2_Value After the attribute key, if the user give several values (expression without "--" separated by space), it will automatically be interpreted as a list.
Definition at line 57 of file otbWrapperCommandLineLauncher.h.
| typedef itk::MemberCommand<Self> otb::Wrapper::CommandLineLauncher::AddProcessCommandType |
Command Member
Definition at line 80 of file otbWrapperCommandLineLauncher.h.
| typedef itk::SmartPointer<const Self> otb::Wrapper::CommandLineLauncher::ConstPointer |
Definition at line 64 of file otbWrapperCommandLineLauncher.h.
Parse result enum
Definition at line 70 of file otbWrapperCommandLineLauncher.h.
| typedef itk::SmartPointer<Self> otb::Wrapper::CommandLineLauncher::Pointer |
Definition at line 63 of file otbWrapperCommandLineLauncher.h.
Standard class typedefs.
Definition at line 61 of file otbWrapperCommandLineLauncher.h.
| typedef itk::Object otb::Wrapper::CommandLineLauncher::Superclass |
Definition at line 62 of file otbWrapperCommandLineLauncher.h.
| typedef std::vector<StandardOneLineFilterWatcher<>*> otb::Wrapper::CommandLineLauncher::WatcherListType |
Filter watcher list type
Definition at line 77 of file otbWrapperCommandLineLauncher.h.
| Enumerator | |
|---|---|
| OKPARAM | |
| MISSINGMANDATORYPARAMETER | |
| MISSINGPARAMETERVALUE | |
| WRONGPARAMETERVALUE | |
| INVALIDNUMBEROFVALUE | |
| DEFAULT | |
Definition at line 74 of file otbWrapperCommandLineLauncher.h.
|
protected |
Constructor
|
overrideprotected |
Destructor
|
privatedelete |
| bool otb::Wrapper::CommandLineLauncher::BeforeExecute | ( | ) |
Gather the code process to do before Execute and ExecuteAndWriteOutput Returns false if a problem occurs, true otherwise.
|
protected |
Check if each key is valid for the application.
|
private |
|
private |
|
protected |
Check if option contains at least one "-".
|
protected |
Check if each key is unique in the expression.
|
private |
Prints a warning to std::cerr if paramKey is an unused parameter
| virtual::itk::LightObject::Pointer otb::Wrapper::CommandLineLauncher::CreateAnother | ( | void | ) | const |
|
protected |
Clear watcher list, deleting its pointers.
| void otb::Wrapper::CommandLineLauncher::DisplayHelp | ( | bool | longHelp = false | ) |
Create and display the help of the application
|
protected |
Display the output parameter (Role == RoleOutput)
|
protected |
Create and display the help of the application
| bool otb::Wrapper::CommandLineLauncher::Execute | ( | ) |
Launch the process, using the Execute application method The method will check if the user asked for help (looking at –help key) before loading parameter and launching process.
| bool otb::Wrapper::CommandLineLauncher::ExecuteAndWriteOutput | ( | ) |
Launch the process, using the ExecuteAndWriteOutput application method The method will check if the user asked for help (looking at –help key) before loading parameter and launching process.
|
private |
Actually launch the process and write outputs, without catching exceptions.
|
protected |
Returns the width of the longest key (in number of chars)
|
virtual |
RTTI support
|
protected |
Load the watchers for internal progress and writing progress report.
| bool otb::Wrapper::CommandLineLauncher::Load | ( | ) |
Load the application in several steps :
| bool otb::Wrapper::CommandLineLauncher::Load | ( | const std::vector< std::string > & | vexp | ) |
same as Load method but set the expression before.
|
protected |
Load the application calling the CreateApplication method of the ApplicationRegistry classes. Pay attention, the executable paths have to be loaded or set in the environment before calling the function.
|
protected |
Parse the user expression, extract the key and the associated string and set it as value of each corresponding application parameter.
|
protected |
Load the executable path. It looks for the key –modulePath, extract and interpret as path the following strings.
| void otb::Wrapper::CommandLineLauncher::LoadTestEnv | ( | ) |
Performs specific action for testing environment
|
static |
Defining ::New() static method
|
privatedelete |
|
private |
Definition at line 196 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 187 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 194 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 190 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 185 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 197 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 189 of file otbWrapperCommandLineLauncher.h.
|
private |
Definition at line 192 of file otbWrapperCommandLineLauncher.h.
1.8.17