OTB  9.0.0
Orfeo Toolbox
otbWrapperBoolParameter.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 otbWrapperBoolParameter_h
22 #define otbWrapperBoolParameter_h
23 
24 #include "otbWrapperParameter.h"
25 #include "OTBApplicationEngineExport.h"
26 #include <string>
27 
28 namespace otb
29 {
30 namespace Wrapper
31 {
32 
38 class OTBApplicationEngine_EXPORT BoolParameter : public Parameter
39 {
40 public:
44  typedef itk::SmartPointer<Self> Pointer;
45  typedef itk::SmartPointer<const Self> ConstPointer;
46 
48  itkNewMacro(Self);
49 
51  itkTypeMacro(BoolParameter, Parameter);
52 
54  bool HasValue() const override
55  {
56  return true;
57  }
58 
59  bool GetValue() const;
60  std::string GetValueAsString() const;
61 
62  void SetValue(bool state);
63  void SetValue(const std::string& str);
64 
65  ParameterType GetType() const override;
66 
67  int ToInt() const override;
68  std::string ToString() const override;
69 
70  void FromString(const std::string& value) override;
71  void FromInt(int value) override;
72  ;
73 
74 protected:
76  BoolParameter();
77 
79  ~BoolParameter() override
80  {
81  }
82 
83 private:
84  BoolParameter(const BoolParameter&) = delete;
85  void operator=(const BoolParameter&) = delete;
86 
87  bool m_Value;
88 };
89 
90 } // end of namespace Wrapper
91 } // end of namespace otb
92 
93 #endif
otb::Wrapper::BoolParameter
This class represent a boolean parameter for the wrapper framework.
Definition: otbWrapperBoolParameter.h:38
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
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::BoolParameter::m_Value
bool m_Value
Definition: otbWrapperBoolParameter.h:87
otb::Wrapper::BoolParameter::Superclass
Parameter Superclass
Definition: otbWrapperBoolParameter.h:43
otb::Wrapper::BoolParameter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWrapperBoolParameter.h:45
otb::Wrapper::BoolParameter::~BoolParameter
~BoolParameter() override
Definition: otbWrapperBoolParameter.h:79
otb::Wrapper::BoolParameter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperBoolParameter.h:44
otb::Wrapper::BoolParameter::Self
BoolParameter Self
Definition: otbWrapperBoolParameter.h:42
otbWrapperParameter.h
otb::Wrapper::MetaDataHelper::GetType
OTBApplicationEngine_EXPORT MDType GetType(const std::string &val)
otb::Wrapper::BoolParameter::HasValue
bool HasValue() const override
Definition: otbWrapperBoolParameter.h:54
otb::Wrapper::ParameterType
ParameterType
Definition: otbWrapperTypes.h:37