OTB  10.0.0
Orfeo Toolbox
otbWrapperInputFilenameParameter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2024 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 otbWrapperInputFilenameParameter_h
22 #define otbWrapperInputFilenameParameter_h
23 
24 #include <string>
26 
27 namespace otb
28 {
29 namespace Wrapper
30 {
31 
37 class OTBApplicationEngine_EXPORT InputFilenameParameter : public Parameter
38 {
39 public:
43  typedef itk::SmartPointer<Self> Pointer;
44  typedef itk::SmartPointer<const Self> ConstPointer;
45 
47  itkNewMacro(Self);
48 
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  virtual 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 InputFilenameParameter&) = delete;
107 
109 
110 }; // End class Parameter
111 
112 } // End namespace Wrapper
113 } // End namespace otb
114 
115 #endif
This class represent a string parameter for the wrapper framework.
InputFilenameParameter(const InputFilenameParameter &)=delete
void operator=(const InputFilenameParameter &)=delete
virtual ParameterType GetType() const override
otbGetObjectMemberConstMacro(StringParam, Value, std::string)
virtual void SetValue(const std::string value)
void FromString(const std::string &value) override
This class represent a parameter for the wrapper framework This class is a high level class represent...
This class represent a string parameter for the wrapper framework.
@ ParameterType_InputFilename
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.