OTB  9.0.0
Orfeo Toolbox
otbWrapperDirectoryParameter.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 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 : public Parameter
40 {
41 public:
45  typedef itk::SmartPointer<Self> Pointer;
46  typedef itk::SmartPointer<const Self> ConstPointer;
47 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(DirectoryParameter, Parameter);
53 
54  bool HasValue() const override
55  {
56  return m_StringParam->HasValue();
57  }
58 
59  // Set/Get Value
60  otbSetObjectMemberMacro(StringParam, Value, std::string);
61  otbGetObjectMemberConstMacro(StringParam, Value, std::string);
62 
63  // Clear Value
64  void ClearValue() override
65  {
66  m_StringParam->ClearValue();
67  }
68 
69  // Reimplement the SetActive method
70  void SetActive(bool value) override
71  {
72  Superclass::SetActive(value);
73  m_StringParam->SetActive(value);
74  }
75 
76  // GetActive method
77  otbGetObjectMemberConstMacro(StringParam, Active, bool);
78 
79  virtual ParameterType GetType() const override
80  {
82  }
83 
84  std::string ToString() const override
85  {
86  return GetValue();
87  }
88 
89  void FromString(const std::string& value) override
90  {
91  SetValue(value);
92  }
93 
94 protected:
97  {
98  m_StringParam = StringParameter::New();
99  }
100 
103  {
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
otb::Wrapper::StringParameter::New
static Pointer New()
otb::Wrapper::ParameterType_Directory
@ ParameterType_Directory
Definition: otbWrapperTypes.h:46
otb::Wrapper::DirectoryParameter::ToString
std::string ToString() const override
Definition: otbWrapperDirectoryParameter.h:84
otb::Wrapper::DirectoryParameter::FromString
void FromString(const std::string &value) override
Definition: otbWrapperDirectoryParameter.h:89
otb::Wrapper::DirectoryParameter::~DirectoryParameter
~DirectoryParameter() override
Definition: otbWrapperDirectoryParameter.h:102
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::DirectoryParameter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperDirectoryParameter.h:45
otb::Wrapper::DirectoryParameter::ClearValue
void ClearValue() override
Definition: otbWrapperDirectoryParameter.h:64
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::DirectoryParameter::DirectoryParameter
DirectoryParameter()
Definition: otbWrapperDirectoryParameter.h:96
otbMacro.h
otb::Wrapper::StringParameter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperStringParameter.h:43
otb::Wrapper::DirectoryParameter::Self
DirectoryParameter Self
Definition: otbWrapperDirectoryParameter.h:43
otbWrapperStringParameter.h
otb::Wrapper::DirectoryParameter::HasValue
bool HasValue() const override
Definition: otbWrapperDirectoryParameter.h:54
otb::Wrapper::DirectoryParameter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWrapperDirectoryParameter.h:46
otb::Wrapper::DirectoryParameter::m_StringParam
StringParameter::Pointer m_StringParam
Definition: otbWrapperDirectoryParameter.h:111
otb::Wrapper::DirectoryParameter::GetType
virtual ParameterType GetType() const override
Definition: otbWrapperDirectoryParameter.h:79
otbGetObjectMemberConstMacro
#define otbGetObjectMemberConstMacro(object, name, type)
Definition: otbMacro.h:100
otb::Wrapper::DirectoryParameter::SetActive
void SetActive(bool value) override
Definition: otbWrapperDirectoryParameter.h:70
otb::Wrapper::DirectoryParameter::Superclass
Parameter Superclass
Definition: otbWrapperDirectoryParameter.h:44
otb::Wrapper::DirectoryParameter
This class represent a string parameter for the wrapper framework.
Definition: otbWrapperDirectoryParameter.h:39
otbSetObjectMemberMacro
#define otbSetObjectMemberMacro(object, name, type)
Definition: otbMacro.h:79
otb::Wrapper::ParameterType
ParameterType
Definition: otbWrapperTypes.h:37