From d9eb0ab23283153dc14f8c5fbf093e0614fbacd6 Mon Sep 17 00:00:00 2001 From: Thomas Feuvrier <thomas.feuvrier@c-s.fr> Date: Fri, 28 Jul 2006 07:35:13 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20sur=20le=20CommandLineArgument=20:?= =?UTF-8?q?=20modification=20de=20la=20m=C3=A9thode=20de=20lecture=20des?= =?UTF-8?q?=20parametres=20:=20suppression=20de=20l=20am=C3=A9thode=20temp?= =?UTF-8?q?late,=20donc=20suppression=20du=20fichier=20.txx.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Common/otbCommandLineArgumentParser.cxx | 60 +------------------- Code/Common/otbCommandLineArgumentParser.h | 28 ++++----- Code/Common/otbCommandLineArgumentParser.txx | 44 -------------- 3 files changed, 12 insertions(+), 120 deletions(-) delete mode 100755 Code/Common/otbCommandLineArgumentParser.txx diff --git a/Code/Common/otbCommandLineArgumentParser.cxx b/Code/Common/otbCommandLineArgumentParser.cxx index 6b18bc24f1..e2973d4b9c 100755 --- a/Code/Common/otbCommandLineArgumentParser.cxx +++ b/Code/Common/otbCommandLineArgumentParser.cxx @@ -20,7 +20,7 @@ #include <assert.h> #include <iostream> -#include "otbConfigure.h" // Pour OTB_VERSION_MAJOR, OTB_VERSION_MINOR et OTB_VERSION_PATCH genere dans le ccmake +#include "otbConfigure.h" // Pour OTB_VERSION_STRING genere par le ccmake namespace otb { @@ -32,7 +32,6 @@ CommandLineArgumentParseResult ::PrintSelf(std::ostream& os/*, itk::Indent indent*/)const { - } @@ -43,63 +42,6 @@ CommandLineArgumentParseResult return (m_OptionMap.find(std::string(option)) != m_OptionMap.end()); } - -/* -unsigned int -CommandLineArgumentParseResult -::GetParameterUInt(const char *option, unsigned int number) const -{ - return GetParameter<unsigned int>(option,number); -} - -int -CommandLineArgumentParseResult -::GetParameterInt(const char *option, unsigned int number) const -{ - return GetParameter<int>(option,number); -} -unsigned short -CommandLineArgumentParseResult -::GetParameterUShort(const char *option, unsigned int number) const -{ - return GetParameter<unsigned short>(option,number); -} - -short -CommandLineArgumentParseResult -::GetParameterShort(const char *option, unsigned int number) const -{ - return GetParameter<short>(option,number); -} -unsigned long -CommandLineArgumentParseResult -::GetParameterULong(const char *option, unsigned int number) const -{ - return GetParameter<unsigned long>(option,number); -} - -long -CommandLineArgumentParseResult -::GetParameterLong(const char *option, unsigned int number) const -{ - return GetParameter<long>(option,number); -} - -float -CommandLineArgumentParseResult -::GetParameterFloat(const char *option, unsigned int number) const -{ - return GetParameter<float>(option,number); -} -double -CommandLineArgumentParseResult -::GetParameterDouble(const char *option, unsigned int number) const -{ - return GetParameter<double>(option,number); -} -*/ - - std::string CommandLineArgumentParseResult ::GetParameterString(const char *option, unsigned int number)const diff --git a/Code/Common/otbCommandLineArgumentParser.h b/Code/Common/otbCommandLineArgumentParser.h index 067d669793..c57bde8456 100755 --- a/Code/Common/otbCommandLineArgumentParser.h +++ b/Code/Common/otbCommandLineArgumentParser.h @@ -30,6 +30,7 @@ //#include "itkIndent.h" #include "itkProcessObject.h" +#include "otbMacro.h" namespace otb { @@ -62,11 +63,17 @@ public: void PrintSelf(std::ostream& os/*, itk::Indent indent*/) const; -#define otbGetParameterMacro(name,type) \ - virtual type GetParameter##name (const char *option, unsigned int number=0) const \ - { \ - return GetParameter<type>(option,number); \ +#define otbGetParameterMacro(name,type) \ + virtual type GetParameter##name (const char *option, unsigned int number=0) const \ + { \ + std::string parameter = this->GetParameterString(option, number); \ + type lValeur; \ + ::otb::StringStream flux; \ + flux << parameter; \ + flux >> lValeur; \ + return lValeur; \ } + otbGetParameterMacro(Short,short); otbGetParameterMacro(UShort,unsigned short); otbGetParameterMacro(Int,int); @@ -192,19 +199,6 @@ private: std::string m_ProgramName; }; - -// Not defined in class CommandArgumentParser to avoid known bug on VC++ 6.0 -// (explicit template instanciation on class methods are forbidden in this compiler) -/*template< typename TypeValeur > -TypeValeur GetParameter(CommandLineArgumentParseResult* parser, - const char *option, unsigned int number=0);*/ - - } -#ifndef OTB_MANUAL_INSTANTIATION -#include "otbCommandLineArgumentParser.txx" -#endif - - #endif // __otbCommandLineArgumentParser_h_ diff --git a/Code/Common/otbCommandLineArgumentParser.txx b/Code/Common/otbCommandLineArgumentParser.txx deleted file mode 100755 index 1cd22611c1..0000000000 --- a/Code/Common/otbCommandLineArgumentParser.txx +++ /dev/null @@ -1,44 +0,0 @@ -/*========================================================================= - - Program: ORFEO Toolbox - Language: C++ - Date: $Date$ - Version: $Revision$ - - - Copyright (c) Centre National d'Etudes Spatiales. All rights reserved. - See OTBCopyright.txt for details. - - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ -#ifndef _otbCommandLineArgumentParser_txx -#define _otbCommandLineArgumentParser_txx - -#include "otbCommandLineArgumentParser.h" - -#include "otbMacro.h" - -namespace otb -{ - - -template<typename TypeValeur > -TypeValeur -CommandLineArgumentParseResult -::GetParameter(const char *option, unsigned int number)const -{ - std::string parameter = this->GetParameterString(option, number); - TypeValeur lValeur; - ::otb::StringStream flux; - flux << parameter; - flux >> lValeur; - return lValeur; -} - -} // end namespace otb - -#endif -- GitLab