OTB  6.7.0
Orfeo Toolbox
otbWrapperBoolParameter.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 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
39  : public Parameter
40 {
41 public:
47 
49  itkNewMacro(Self);
50 
52  itkTypeMacro(BoolParameter, Parameter);
53 
55  bool HasValue() const override
56  {
57  return true;
58  }
59 
60  bool GetValue() const;
61  std::string GetValueAsString() const;
62 
63  void SetValue(bool state);
64  void SetValue(const std::string & str);
65 
66  ParameterType GetType() const override;
67 
68  int ToInt() const override;
69  std::string ToString() const override;
70 
71  void FromString(const std::string& value) override;
72  void FromInt(int value) override;
73  ;
74 
75 protected:
77  BoolParameter();
78 
80  ~BoolParameter() override
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
This class represent a parameter for the wrapper framework This class is a high level class represent...
This class represent a boolean parameter for the wrapper framework.
itk::SmartPointer< Self > Pointer
itk::SmartPointer< const Self > ConstPointer
OTBApplicationEngine_EXPORT MDType GetType(const std::string &val)
const char * ToString(const QString &str)
Append the content of a StringVector object to the content of a QStringList object.
Definition: mvdAlgorithm.h:521