OTB  9.0.0
Orfeo Toolbox
otbWrapperOutputFilenameParameter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
3  *
4  * This file is part of Orfeo Toolbox
5  *
6  * https://www.orfeo-toolbox.org/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  */
20 
21 #ifndef otbWrapperOutputFilenameParameter_h
22 #define otbWrapperOutputFilenameParameter_h
23 
24 #include <string>
26 
27 namespace otb
28 {
29 namespace Wrapper
30 {
31 
37 class OTBApplicationEngine_EXPORT OutputFilenameParameter : public Parameter
38 {
39 public:
43  typedef itk::SmartPointer<Self> Pointer;
44  typedef itk::SmartPointer<const Self> ConstPointer;
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(OutputFilenameParameter, Parameter);
51 
52 
53  bool HasValue() const override
54  {
55  return m_StringParam->HasValue();
56  }
57 
58  // Get Value
59  otbGetObjectMemberConstMacro(StringParam, Value, std::string);
60 
61  // Set Value
62  virtual void SetValue(const std::string value)
63  {
64  itkDebugMacro("setting member m_StringParam to " << value);
65  this->m_StringParam->SetValue(value);
66  SetActive(true);
67  this->Modified();
68  }
69 
70  // Clear Value
71  void ClearValue() override
72  {
73  m_StringParam->ClearValue();
74  }
75 
76  ParameterType GetType() const override
77  {
79  }
80 
81  std::string ToString() const override
82  {
83  return GetValue();
84  }
85 
86  void FromString(const std::string& value) override
87  {
88  SetValue(value);
89  }
90 
91 protected:
94  {
95  // Initialize the String Parameter
96  m_StringParam = StringParameter::New();
97  }
98 
101  {
102  }
103 
104 private:
106  void operator =(const OutputFilenameParameter&); // purposely not
107  // implemented
108 
110 
111 }; // End class Parameter
112 
113 } // End namespace Wrapper
114 } // End namespace otb
115 
116 #endif
otb::Wrapper::StringParameter::New
static Pointer New()
otb::Wrapper::StringParameter
This class represent a string parameter for the wrapper framework.
Definition: otbWrapperStringParameter.h:37
otb::Wrapper::OutputFilenameParameter
This class represent a string parameter for the wrapper framework.
Definition: otbWrapperOutputFilenameParameter.h:37
otb::Wrapper::OutputFilenameParameter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWrapperOutputFilenameParameter.h:44
otb::Wrapper::Parameter
This class represent a parameter for the wrapper framework This class is a high level class represent...
Definition: otbWrapperParameter.h:49
otb::Wrapper::OutputFilenameParameter::m_StringParam
StringParameter::Pointer m_StringParam
Definition: otbWrapperOutputFilenameParameter.h:109
otb::Wrapper::OutputFilenameParameter::OutputFilenameParameter
OutputFilenameParameter()
Definition: otbWrapperOutputFilenameParameter.h:93
otb::Wrapper::OutputFilenameParameter::ClearValue
void ClearValue() override
Definition: otbWrapperOutputFilenameParameter.h:71
otb::Wrapper::OutputFilenameParameter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperOutputFilenameParameter.h:43
otb::Wrapper::ParameterType_OutputFilename
@ ParameterType_OutputFilename
Definition: otbWrapperTypes.h:45
otb::Wrapper::OutputFilenameParameter::ToString
std::string ToString() const override
Definition: otbWrapperOutputFilenameParameter.h:81
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::OutputFilenameParameter::Self
OutputFilenameParameter Self
Definition: otbWrapperOutputFilenameParameter.h:41
otb::Wrapper::StringParameter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperStringParameter.h:43
otb::Wrapper::OutputFilenameParameter::HasValue
bool HasValue() const override
Definition: otbWrapperOutputFilenameParameter.h:53
otb::Wrapper::OutputFilenameParameter::GetType
ParameterType GetType() const override
Definition: otbWrapperOutputFilenameParameter.h:76
otb::Wrapper::OutputFilenameParameter::SetValue
virtual void SetValue(const std::string value)
Definition: otbWrapperOutputFilenameParameter.h:62
otbWrapperStringParameter.h
otb::Wrapper::OutputFilenameParameter::~OutputFilenameParameter
~OutputFilenameParameter() override
Definition: otbWrapperOutputFilenameParameter.h:100
otb::Wrapper::OutputFilenameParameter::FromString
void FromString(const std::string &value) override
Definition: otbWrapperOutputFilenameParameter.h:86
otbGetObjectMemberConstMacro
#define otbGetObjectMemberConstMacro(object, name, type)
Definition: otbMacro.h:100
otb::Wrapper::OutputFilenameParameter::Superclass
StringParameter Superclass
Definition: otbWrapperOutputFilenameParameter.h:42
otb::Wrapper::ParameterType
ParameterType
Definition: otbWrapperTypes.h:37