OTB  5.5.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
otb::CommandLineArgumentParser Class Reference

#include <otbCommandLineArgumentParser.h>

+ Inheritance diagram for otb::CommandLineArgumentParser:
+ Collaboration diagram for otb::CommandLineArgumentParser:


struct  OptionType

Public Types

typedef itk::SmartPointer
< const Self
typedef itk::SmartPointer< SelfPointer
typedef CommandLineArgumentParser Self
typedef itk::ProcessObject Superclass
- Public Types inherited from itk::ProcessObject
typedef SmartPointer< const SelfConstPointer
typedef DataObject::Pointer DataObjectPointer
typedef std::vector
< DataObjectPointer
typedef std::vector
< DataObjectIdentifierType
typedef SmartPointer< SelfPointer
typedef ProcessObject Self
typedef Object Superclass
- 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

void AddInputImage (bool obligatory=true)
void AddOption (const std::string &name, const std::string &comment, const std::string &synonym=NULL, int nParameters=1, bool obligatory=true)
void AddOptionNParams (const std::string &name, const std::string &comment, const std::string &synonym=NULL, bool obligatory=true)
void AddOutputImage (bool obligatory=true)
virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual const char * GetNameOfClass () const
virtual const char * GetProgramDescription () const
void ParseCommandLine (int argc, char *argv[], CommandLineArgumentParseResult *outResult, bool failOnUnknownTrailingParameters=true)
virtual void SetProgramDescription (const char *_arg)
- Public Member Functions inherited from itk::ProcessObject
virtual void AbortGenerateDataOff ()
virtual void AbortGenerateDataOn ()
virtual void EnlargeOutputRequestedRegion (DataObject *)
virtual const bool & GetAbortGenerateData () const
DataObjectPointerArray GetIndexedInputs ()
DataObjectPointerArray GetIndexedOutputs ()
NameArray GetInputNames () const
DataObjectPointerArray GetInputs ()
MultiThreader * GetMultiThreader () const
DataObjectPointerArraySizeType GetNumberOfIndexedInputs () const
DataObjectPointerArraySizeType GetNumberOfIndexedOutputs () const
DataObjectPointerArraySizeType GetNumberOfInputs () const
DataObjectPointerArraySizeType GetNumberOfOutputs () const
virtual const ThreadIdTypeGetNumberOfThreads () const
GetNumberOfValidRequiredInputs () const
NameArray GetOutputNames () const
DataObjectPointerArray GetOutputs ()
virtual const float & GetProgress () const
virtual const bool & GetReleaseDataBeforeUpdateFlag () const
virtual bool GetReleaseDataFlag () const
NameArray GetRequiredInputNames () const
bool HasInput (const DataObjectIdentifierType &key) const
bool HasOutput (const DataObjectIdentifierType &key) const
virtual DataObjectPointer MakeOutput (const DataObjectIdentifierType &)
virtual DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx)
virtual void PrepareOutputs ()
virtual void PropagateRequestedRegion (DataObject *output)
virtual void ReleaseDataBeforeUpdateFlagOff ()
virtual void ReleaseDataBeforeUpdateFlagOn ()
void ReleaseDataFlagOff ()
void ReleaseDataFlagOn ()
virtual void ResetPipeline ()
virtual void SetAbortGenerateData (bool _arg)
virtual void SetNumberOfThreads (ThreadIdType _arg)
void SetProgress (float progress)
virtual void SetReleaseDataBeforeUpdateFlag (bool _arg)
virtual void SetReleaseDataFlag (bool flag)
virtual void Update ()
virtual void UpdateLargestPossibleRegion ()
virtual void UpdateOutputData (DataObject *output)
virtual void UpdateOutputInformation ()
void UpdateProgress (float progress)
- 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

 CommandLineArgumentParser ()
virtual ~CommandLineArgumentParser ()
- Protected Member Functions inherited from itk::ProcessObject
virtual void AddInput (DataObject *input)
virtual void AddOutput (DataObject *output)
bool AddRequiredInputName (const DataObjectIdentifierType &, DataObjectPointerArraySizeType idx)
bool AddRequiredInputName (const DataObjectIdentifierType &)
virtual void CacheInputReleaseDataFlags ()
virtual void GenerateData ()
virtual void GenerateInputRequestedRegion ()
virtual void GenerateOutputInformation ()
virtual void GenerateOutputRequestedRegion (DataObject *output)
const DataObjectGetInput (const DataObjectIdentifierType &key) const
DataObjectGetInput (DataObjectPointerArraySizeType idx)
const DataObjectGetInput (DataObjectPointerArraySizeType idx) const
DataObjectGetInput (const DataObjectIdentifierType &key)
virtual const
GetNumberOfRequiredInputs () const
virtual const
GetNumberOfRequiredOutputs () const
DataObjectGetOutput (const DataObjectIdentifierType &key)
const DataObjectGetOutput (const DataObjectIdentifierType &key) const
DataObjectGetOutput (DataObjectPointerArraySizeType idx)
const DataObjectGetOutput (DataObjectPointerArraySizeType idx) const
DataObjectGetPrimaryInput ()
const DataObjectGetPrimaryInput () const
virtual const char * GetPrimaryInputName (void) const
DataObjectGetPrimaryOutput ()
const DataObjectGetPrimaryOutput () const
virtual const char * GetPrimaryOutputName (void) const
bool IsIndexedInputName (const DataObjectIdentifierType &) const
bool IsIndexedOutputName (const DataObjectIdentifierType &) const
bool IsRequiredInputName (const DataObjectIdentifierType &) const
 itkLegacyMacro (virtual void RemoveInput(DataObject *input))
 itkLegacyMacro (void SetNumberOfInputs(DataObjectPointerArraySizeType num))
 itkLegacyMacro (virtual void RemoveOutput(DataObject *output))
 itkLegacyMacro (void SetNumberOfOutputs(DataObjectPointerArraySizeType num))
DataObjectPointerArraySizeType MakeIndexFromInputName (const DataObjectIdentifierType &name) const
DataObjectPointerArraySizeType MakeIndexFromOutputName (const DataObjectIdentifierType &name) const
DataObjectIdentifierType MakeNameFromInputIndex (DataObjectPointerArraySizeType idx) const
DataObjectIdentifierType MakeNameFromOutputIndex (DataObjectPointerArraySizeType idx) const
virtual void PopBackInput ()
virtual void PopFrontInput ()
virtual void PrintSelf (std::ostream &os, Indent indent) const override
 ProcessObject ()
virtual void PropagateResetPipeline ()
virtual void PushBackInput (const DataObject *input)
virtual void PushFrontInput (const DataObject *input)
virtual void ReleaseInputs ()
virtual void RemoveInput (const DataObjectIdentifierType &key)
virtual void RemoveInput (DataObjectPointerArraySizeType)
virtual void RemoveOutput (const DataObjectIdentifierType &key)
virtual void RemoveOutput (DataObjectPointerArraySizeType idx)
bool RemoveRequiredInputName (const DataObjectIdentifierType &)
virtual void RestoreInputReleaseDataFlags ()
virtual void SetInput (const DataObjectIdentifierType &key, DataObject *input)
virtual void SetNthInput (DataObjectPointerArraySizeType num, DataObject *input)
virtual void SetNthOutput (DataObjectPointerArraySizeType num, DataObject *output)
void SetNumberOfIndexedInputs (DataObjectPointerArraySizeType num)
void SetNumberOfIndexedOutputs (DataObjectPointerArraySizeType num)
virtual void SetNumberOfRequiredInputs (DataObjectPointerArraySizeType)
virtual void SetNumberOfRequiredOutputs (DataObjectPointerArraySizeType _arg)
virtual void SetOutput (const DataObjectIdentifierType &key, DataObject *output)
virtual void SetPrimaryInput (DataObject *input)
virtual void SetPrimaryInputName (const DataObjectIdentifierType &key)
virtual void SetPrimaryOutput (DataObject *output)
virtual void SetPrimaryOutputName (const DataObjectIdentifierType &key)
void SetRequiredInputNames (const NameArray &)
virtual void VerifyInputInformation ()
virtual void VerifyPreconditions ()
 ~ProcessObject ()
- Protected Member Functions inherited from itk::Object
 Object ()
bool PrintObservers (std::ostream &os, Indent indent) const
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 Types

typedef std::vector< OptionTypeListOptionType

Private Member Functions

bool FindOption (const std::string &, int &index)
bool IsNumber (const std::string &text)
void PrintUsage (std::ostream &os) const
void PrintVersion (std::ostream &os) const
bool TryParseCommandLine (int argc, char *argv[], CommandLineArgumentParseResult *outResult, bool reportFailedMsg, bool failOnUnknownTrailingParameters)

Private Attributes

ListOptionType m_OptionList
std::string m_ProgramDescription
std::string m_ProgramName

Additional Inherited Members

- Protected Attributes inherited from itk::ProcessObject
TimeStamp m_OutputInformationMTime
bool m_Updating
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount

Detailed Description

Utility to Parse command line argument.


Definition at line 222 of file otbCommandLineArgumentParser.h.

Member Typedef Documentation

Definition at line 228 of file otbCommandLineArgumentParser.h.

Definition at line 289 of file otbCommandLineArgumentParser.h.

Definition at line 227 of file otbCommandLineArgumentParser.h.

Definition at line 225 of file otbCommandLineArgumentParser.h.

Definition at line 226 of file otbCommandLineArgumentParser.h.

Constructor & Destructor Documentation

otb::CommandLineArgumentParser::CommandLineArgumentParser ( )
virtual otb::CommandLineArgumentParser::~CommandLineArgumentParser ( )

Member Function Documentation

void otb::CommandLineArgumentParser::AddInputImage ( bool  obligatory = true)

Add an input image option

void otb::CommandLineArgumentParser::AddOption ( const std::string &  name,
const std::string &  comment,
const std::string &  synonym = NULL,
int  nParameters = 1,
bool  obligatory = true 

Add a new option with fixed number of parameters

void otb::CommandLineArgumentParser::AddOptionNParams ( const std::string &  name,
const std::string &  comment,
const std::string &  synonym = NULL,
bool  obligatory = true 

Add a new option with unknown number of parameters

void otb::CommandLineArgumentParser::AddOutputImage ( bool  obligatory = true)

Add an output image option

virtual::itk::LightObject::Pointer otb::CommandLineArgumentParser::CreateAnother ( void  ) const

Reimplemented from itk::Object.

bool otb::CommandLineArgumentParser::FindOption ( const std::string &  ,
int &  index 
virtual const char* otb::CommandLineArgumentParser::GetNameOfClass ( ) const

Reimplemented from itk::ProcessObject.

virtual const char* otb::CommandLineArgumentParser::GetProgramDescription ( ) const

Get the program name

bool otb::CommandLineArgumentParser::IsNumber ( const std::string &  text)
static Pointer otb::CommandLineArgumentParser::New ( )
void otb::CommandLineArgumentParser::ParseCommandLine ( int  argc,
char *  argv[],
CommandLineArgumentParseResult outResult,
bool  failOnUnknownTrailingParameters = true 

Interpret options from the command line

void otb::CommandLineArgumentParser::PrintUsage ( std::ostream &  os) const
void otb::CommandLineArgumentParser::PrintVersion ( std::ostream &  os) const
virtual void otb::CommandLineArgumentParser::SetProgramDescription ( const char *  _arg)

Set the program name

bool otb::CommandLineArgumentParser::TryParseCommandLine ( int  argc,
char *  argv[],
CommandLineArgumentParseResult outResult,
bool  reportFailedMsg,
bool  failOnUnknownTrailingParameters 

Try processing a command line. Returns false if something breaks

Member Data Documentation

ListOptionType otb::CommandLineArgumentParser::m_OptionList

Definition at line 291 of file otbCommandLineArgumentParser.h.

std::string otb::CommandLineArgumentParser::m_ProgramDescription

Definition at line 294 of file otbCommandLineArgumentParser.h.

std::string otb::CommandLineArgumentParser::m_ProgramName

Definition at line 293 of file otbCommandLineArgumentParser.h.

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