OTB  10.0.0
Orfeo Toolbox
otbWrapperOutputFilenameParameter.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 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 
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
This class represent a string parameter for the wrapper framework.
void FromString(const std::string &value) override
virtual void SetValue(const std::string value)
otbGetObjectMemberConstMacro(StringParam, Value, std::string)
OutputFilenameParameter(const OutputFilenameParameter &)=delete
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_OutputFilename
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.