OTB  6.7.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
otb::Wrapper::CommandLineLauncher Class Reference

#include <otbWrapperCommandLineLauncher.h>

+ Inheritance diagram for otb::Wrapper::CommandLineLauncher:
+ Collaboration diagram for otb::Wrapper::CommandLineLauncher:

Public Types

typedef itk::MemberCommand< SelfAddProcessCommandType
typedef itk::SmartPointer
< const Self
enum  ParamResultType {
typedef itk::SmartPointer< SelfPointer
typedef CommandLineLauncher Self
typedef itk::Object Superclass
typedef std::vector
< StandardOneLineFilterWatcher<> * > 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef Object Self
typedef LightObject Superclass
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef LightObject Self

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 ()
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
unsigned long AddObserver (const EventObject &event, Command *) const
virtual void DebugOff () const
virtual void DebugOn () const
CommandGetCommand (unsigned long tag)
bool GetDebug () const
const MetaDataDictionaryGetMetaDataDictionary () const
MetaDataDictionaryGetMetaDataDictionary ()
virtual ModifiedTimeType GetMTime () const
virtual const std::string & GetObjectName () const
virtual const TimeStampGetTimeStamp () const
bool HasObserver (const EventObject &event) const
void InvokeEvent (const EventObject &)
void InvokeEvent (const EventObject &) const
virtual void Modified () const
virtual void Register () const override
void RemoveAllObservers ()
void RemoveObserver (unsigned long tag)
void SetDebug (bool debugFlag) const
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
virtual void SetObjectName (std::string _arg)
virtual void SetReferenceCount (int) override
virtual void UnRegister () const noexceptoverride
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
virtual int GetReferenceCount () const
 itkCloneMacro (Self)
void Print (std::ostream &os, Indent indent=0) const

Static Public Member Functions

static Pointer New ()
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
static void GlobalWarningDisplayOff ()
static void GlobalWarningDisplayOn ()
static Pointer New ()
static void SetGlobalWarningDisplay (bool flag)
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
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 &param, 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
- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
virtual void PrintSelf (std::ostream &os, Indent indent) const override
virtual void SetTimeStamp (const TimeStamp &time)
virtual ~Object ()
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 LightObject ()
virtual void PrintHeader (std::ostream &os, Indent indent) const
virtual void PrintTrailer (std::ostream &os, Indent indent) const
virtual ~LightObject ()

Private Member Functions

bool CheckMissingMandatoryParameter (const std::string &paramKey) const
bool CheckOutputPathsValidity (const std::string &paramKey) const
void CheckUnusedParameter (const std::string &paramKey) 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

Additional Inherited Members

- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount

Detailed Description

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.

Member Typedef Documentation

Command Member

Definition at line 82 of file otbWrapperCommandLineLauncher.h.

Definition at line 64 of file otbWrapperCommandLineLauncher.h.

Parse result enum

Definition at line 70 of file otbWrapperCommandLineLauncher.h.

Definition at line 63 of file otbWrapperCommandLineLauncher.h.

Standard class typedefs.

Definition at line 61 of file otbWrapperCommandLineLauncher.h.

Definition at line 62 of file otbWrapperCommandLineLauncher.h.

Filter watcher list type

Definition at line 79 of file otbWrapperCommandLineLauncher.h.

Member Enumeration Documentation


Definition at line 74 of file otbWrapperCommandLineLauncher.h.

Constructor & Destructor Documentation

otb::Wrapper::CommandLineLauncher::CommandLineLauncher ( )


otb::Wrapper::CommandLineLauncher::~CommandLineLauncher ( )


otb::Wrapper::CommandLineLauncher::CommandLineLauncher ( const CommandLineLauncher )

Member Function Documentation

bool otb::Wrapper::CommandLineLauncher::BeforeExecute ( )

Gather the code process to do before Execute and ExecuteAndWriteOutput Returns false if a problem occurs, true otherwise.

bool otb::Wrapper::CommandLineLauncher::CheckKeyValidity ( std::string &  key)

Check if each key is valid for the application.

bool otb::Wrapper::CommandLineLauncher::CheckMissingMandatoryParameter ( const std::string &  paramKey) const
false if paramKey is a missing mandatory parameter
bool otb::Wrapper::CommandLineLauncher::CheckOutputPathsValidity ( const std::string &  paramKey) const
false if paramKey is an OutputFilename parameter pointing to a path that does not exist
bool otb::Wrapper::CommandLineLauncher::CheckParametersPrefix ( )

Check if option contains at least one "-".

bool otb::Wrapper::CommandLineLauncher::CheckUnicity ( )

Check if each key is unique in the expression.

void otb::Wrapper::CommandLineLauncher::CheckUnusedParameter ( const std::string &  paramKey) const

Prints a warning to std::cerr if paramKey is an unused parameter

virtual::itk::LightObject::Pointer otb::Wrapper::CommandLineLauncher::CreateAnother ( void  ) const

Reimplemented from itk::Object.

void otb::Wrapper::CommandLineLauncher::DeleteWatcherList ( )

Clear watcher list, deleting its pointers.

void otb::Wrapper::CommandLineLauncher::DisplayHelp ( bool  longHelp = false)

Create and display the help of the application

void otb::Wrapper::CommandLineLauncher::DisplayOutputParameters ( )

Display the output parameter (Role == RoleOutput)

std::string otb::Wrapper::CommandLineLauncher::DisplayParameterHelp ( const Parameter::Pointer param,
const std::string  paramKey,
bool  longHelp = false 

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.

bool otb::Wrapper::CommandLineLauncher::ExecuteAndWriteOutputNoCatch ( )

Actually launch the process and write outputs, without catching exceptions.

unsigned int otb::Wrapper::CommandLineLauncher::GetMaxKeySize ( ) const

Returns the width of the longest key (in number of chars)

virtual const char* otb::Wrapper::CommandLineLauncher::GetNameOfClass ( ) const

RTTI support

Reimplemented from itk::Object.

void otb::Wrapper::CommandLineLauncher::LinkWatchers ( itk::Object caller,
const itk::EventObject event 

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.

bool otb::Wrapper::CommandLineLauncher::LoadApplication ( )

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.

CommandLineLauncher::ParamResultType otb::Wrapper::CommandLineLauncher::LoadParameters ( )

Parse the user expression, extract the key and the associated string and set it as value of each corresponding application parameter.

bool otb::Wrapper::CommandLineLauncher::LoadPath ( )

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 Pointer otb::Wrapper::CommandLineLauncher::New ( )

Defining ::New() static method

void otb::Wrapper::CommandLineLauncher::operator= ( const CommandLineLauncher )

Member Data Documentation

AddProcessCommandType::Pointer otb::Wrapper::CommandLineLauncher::m_AddProcessCommand

Definition at line 199 of file otbWrapperCommandLineLauncher.h.

Application::Pointer otb::Wrapper::CommandLineLauncher::m_Application

Definition at line 190 of file otbWrapperCommandLineLauncher.h.

itk::StdStreamLogOutput::Pointer otb::Wrapper::CommandLineLauncher::m_LogOutput

Definition at line 197 of file otbWrapperCommandLineLauncher.h.

CommandLineParser::Pointer otb::Wrapper::CommandLineLauncher::m_Parser

Definition at line 193 of file otbWrapperCommandLineLauncher.h.

std::string otb::Wrapper::CommandLineLauncher::m_Path

Definition at line 188 of file otbWrapperCommandLineLauncher.h.

bool otb::Wrapper::CommandLineLauncher::m_ReportProgress

Definition at line 200 of file otbWrapperCommandLineLauncher.h.

std::vector<std::string> otb::Wrapper::CommandLineLauncher::m_VExpression

Definition at line 192 of file otbWrapperCommandLineLauncher.h.

WatcherListType otb::Wrapper::CommandLineLauncher::m_WatcherList

Definition at line 195 of file otbWrapperCommandLineLauncher.h.

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