OTB  6.7.0
Orfeo Toolbox
otbWrapperDirectoryParameter.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 otbWrapperDirectoryParameter_h
22 #define otbWrapperDirectoryParameter_h
23 
25 #include "otbMacro.h"
26 
27 #include <string>
28 
29 namespace otb
30 {
31 namespace Wrapper
32 {
33 
39 class OTBApplicationEngine_EXPORT DirectoryParameter
40  : public Parameter
41 {
42 public:
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(DirectoryParameter, Parameter);
54 
55  bool HasValue() const override
56  {
57  return m_StringParam->HasValue();
58  }
59 
60  // Set/Get Value
61  otbSetObjectMemberMacro(StringParam, Value , std::string);
62  otbGetObjectMemberConstMacro(StringParam, Value, std::string);
63 
64  // Clear Value
65  void ClearValue() override
66  {
67  m_StringParam->ClearValue();
68  }
69 
70  // Reimplement the SetActive method
71  void SetActive( bool value ) override
72  {
73  Superclass::SetActive( value );
74  m_StringParam->SetActive( value );
75  }
76 
77  // GetActive method
78  otbGetObjectMemberConstMacro(StringParam, Active, bool);
79 
80  virtual ParameterType GetType() const override
81  {
83  }
84 
85  std::string ToString() const override
86  {
87  return GetValue();
88  }
89 
90  void FromString(const std::string& value) override
91  {
92  SetValue(value);
93  }
94 
95 protected:
98  {
99  m_StringParam = StringParameter::New();
100  }
101 
104  {}
105 
106 private:
107  DirectoryParameter(const DirectoryParameter &) = delete;
108  void operator =(const DirectoryParameter&); //purposely not
109  //implemented
110 
112 
113 }; // End class Parameter
114 
115 } // End namespace Wrapper
116 } // End namespace otb
117 
118 #endif
itk::SmartPointer< const Self > ConstPointer
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
virtual ParameterType GetType() const override
void FromString(const std::string &value) override
#define otbSetObjectMemberMacro(object, name, type)
Definition: otbMacro.h:80
This class represent a string parameter for the wrapper framework.