OTB  6.7.0
Orfeo Toolbox
otbWrapperInputFilenameParameter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2019 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
38  : public Parameter
39 {
40 public:
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(InputFilenameParameter, Parameter);
52 
53 
54  bool HasValue() const override
55  {
56  return m_StringParam->HasValue();
57  }
58 
59  // Get Value
60  otbGetObjectMemberConstMacro(StringParam, Value, std::string);
61 
62  // Set Value
63  virtual void SetValue(const std::string value)
64  {
65  itkDebugMacro("setting member m_StringParam to " << value);
66  this->m_StringParam->SetValue(value);
67  SetActive(true);
68  this->Modified();
69  }
70 
71  // Clear Value
72  void ClearValue() override
73  {
74  m_StringParam->ClearValue();
75  }
76 
77  virtual ParameterType GetType() const override
78  {
80  }
81 
82  std::string ToString() const override
83  {
84  return GetValue();
85  }
86 
87  void FromString(const std::string& value) override
88  {
89  SetValue(value);
90  }
91 
92 protected:
95  {
96  // Initialize the String Parameter
97  m_StringParam= StringParameter::New();
98 
99 
100  }
101 
104  {}
105 
106 private:
108  void operator=(const InputFilenameParameter&) = delete;
109 
111 
112 }; // End class Parameter
113 
114 } // End namespace Wrapper
115 } // End namespace otb
116 
117 #endif
This class represent a parameter for the wrapper framework This class is a high level class represent...
#define otbGetObjectMemberConstMacro(object, name, type)
Definition: otbMacro.h:101
void FromString(const std::string &value) override
virtual void SetValue(const std::string value)
virtual ParameterType GetType() const override
This class represent a string parameter for the wrapper framework.
This class represent a string parameter for the wrapper framework.