OTB  9.0.0
Orfeo Toolbox
otbWrapperParameterList.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 otbWrapperParameterList_h
22 #define otbWrapperParameterList_h
23 
24 
27 
28 
29 namespace otb
30 {
31 
32 namespace Wrapper
33 {
34 
35 
41 template <typename T>
43 {
44  //
45  // Public types.
46 public:
50 
51  typedef itk::SmartPointer<Self> Pointer;
52  typedef itk::SmartPointer<const Self> ConstPointer;
53 
55  typedef std::vector<typename T::Pointer> ParameterVector;
56 
57  //
58  // Public methods.
59 public:
61  itkTypeMacro(ParameterList, AbstractParameterList);
62 
64  typename ParameterVector::const_iterator begin() const;
65 
67  typename ParameterVector::const_iterator end() const;
68 
70  void ClearValue() override;
71 
73  bool HasValue() const override;
74 
76  void SetListFromFileName(const StringVector&) override;
77 
79  void InsertNullElement(std::size_t = -1) override;
80 
82  void AddFromFileName(const std::string&) override;
83 
85  void Insert(const std::string&, std::size_t = -1) override;
86 
87  void InsertElement(typename T::Pointer, std::size_t = -1);
88 
90  void SetNthFileName(std::size_t, const std::string&) override;
91 
93  std::size_t SetStrings(const StringVector&) override;
94 
96  std::size_t GetStrings(StringVector&) const override;
97 
99  StringVector GetFileNameList() const override;
100 
102  std::string GetNthFileName(std::size_t) const override;
103 
105  const std::string& GetToolTip(std::size_t) const override;
106 
109  void Erase(std::size_t start, std::size_t count) override;
110 
112  std::size_t Size() const override;
113 
115  bool IsActive(size_t) const override;
116 
118  void Swap(std::size_t, std::size_t) override;
119 
120  typename T::Pointer GetNthElement(std::size_t);
121 
122  std::vector<std::string> ToStringList() const override;
123  void FromStringList(const std::vector<std::string>& value) override;
124  std::string ToString() const override;
125 
126 protected:
128  ParameterList();
129 
131  ~ParameterList() override;
132 
133  // Protected methods.
134 protected:
136  template <typename L, typename From, typename Get>
137  void SetObjectList(L&, const L&, From, Get);
138 
140  template <typename L, typename Get>
141  typename L::ObjectType* GetObjectList(L&, Get);
142 
144  template <typename L, typename Get>
145  const typename L::ObjectType* GetObjectList(L&, Get) const;
146 
148  template <typename D, typename From>
149  void AddData(D*, From);
150 
152  template <typename D, typename Set>
153  typename T::Pointer FromData(D*, Set, const std::string& description = std::string());
154 
156  template <typename D, typename Set>
157  typename T::Pointer& FromData(typename T::Pointer&, D*, Set, const std::string& description = std::string());
158 
159  //
160  // Protected attributes.
161 protected:
164 
165 }; // End class InputImage Parameter
166 
167 } // End namespace Wrapper
168 
169 } // End namespace otb
170 
171 #ifndef OTB_MANUAL_INSTANTIATION
173 #endif
174 
175 #endif
otb::Wrapper::ParameterList::GetObjectList
L::ObjectType * GetObjectList(L &, Get)
Definition: otbWrapperParameterList.hxx:304
otb::Wrapper::ParameterList::GetNthFileName
std::string GetNthFileName(std::vcl_size_t) const override
Definition: otbWrapperParameterList.hxx:204
otb::Wrapper::ParameterList::GetNthElement
T::Pointer GetNthElement(std::vcl_size_t)
Definition: otbWrapperParameterList.hxx:401
otb::Wrapper::ParameterList::begin
ParameterVector::const_iterator begin() const
Definition: otbWrapperParameterList.hxx:53
otb::Wrapper::ParameterList::HasValue
bool HasValue() const override
Definition: otbWrapperParameterList.hxx:67
otbWrapperAbstractParameterList.h
otb::Wrapper::ParameterList
This class represents a InputImage parameter.
Definition: otbWrapperParameterList.h:42
otb::Wrapper::ParameterList::~ParameterList
~ParameterList() override
Definition: otbWrapperParameterList.hxx:47
otb::Wrapper::StringListInterface::Erase
virtual void Erase(std::vcl_size_t id)
otb::Wrapper::ParameterList::AddFromFileName
void AddFromFileName(const std::string &) override
Definition: otbWrapperParameterList.hxx:105
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::ParameterList::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWrapperParameterList.h:52
otb::Wrapper::ParameterList::FromStringList
void FromStringList(const std::vector< std::string > &value) override
Definition: otbWrapperParameterList.hxx:378
otb::Wrapper::ParameterList::GetToolTip
const std::string & GetToolTip(std::vcl_size_t) const override
Definition: otbWrapperParameterList.hxx:213
otb::Wrapper::ParameterList::SetNthFileName
void SetNthFileName(std::vcl_size_t, const std::string &) override
Definition: otbWrapperParameterList.hxx:148
otb::Wrapper::ParameterList::Erase
void Erase(std::vcl_size_t start, std::vcl_size_t count) override
Definition: otbWrapperParameterList.hxx:224
otb::Wrapper::ParameterList::Superclass
AbstractParameterList Superclass
Definition: otbWrapperParameterList.h:49
otb::Wrapper::ParameterList::IsActive
bool IsActive(vcl_size_t) const override
Definition: otbWrapperParameterList.hxx:244
otbWrapperStringListInterface.h
otb::Wrapper::ParameterList::ParameterVector
std::vector< typename T::Pointer > ParameterVector
Definition: otbWrapperParameterList.h:55
otb::Wrapper::ParameterList::AddData
void AddData(D *, From)
Definition: otbWrapperParameterList.hxx:333
otb::Wrapper::ParameterList::SetStrings
std::vcl_size_t SetStrings(const StringVector &) override
Definition: otbWrapperParameterList.hxx:163
otb::Wrapper::ParameterList::ClearValue
void ClearValue() override
Definition: otbWrapperParameterList.hxx:78
otb::Wrapper::ParameterList::Self
ParameterList Self
Definition: otbWrapperParameterList.h:48
otb::Wrapper::ParameterList::SetObjectList
void SetObjectList(L &, const L &, From, Get)
Definition: otbWrapperParameterList.hxx:267
otb::Wrapper::ParameterList::ToStringList
std::vector< std::string > ToStringList() const override
Definition: otbWrapperParameterList.hxx:372
otb::Wrapper::ParameterList::InsertNullElement
void InsertNullElement(std::vcl_size_t=-1) override
Definition: otbWrapperParameterList.hxx:94
otbWrapperParameterList.hxx
otb::Wrapper::ParameterList::end
ParameterVector::const_iterator end() const
Definition: otbWrapperParameterList.hxx:60
otb::Wrapper::ParameterList::m_Parameters
ParameterVector m_Parameters
Definition: otbWrapperParameterList.h:163
otb::Wrapper::ParameterList::Insert
void Insert(const std::string &, std::vcl_size_t=-1) override
Definition: otbWrapperParameterList.hxx:124
otb::Wrapper::ParameterList::InsertElement
void InsertElement(typename T::Pointer, std::vcl_size_t=-1)
Definition: otbWrapperParameterList.hxx:135
otb::Wrapper::AbstractParameterList
This class is a base class for list-type parameters.
Definition: otbWrapperAbstractParameterList.h:41
otb::Wrapper::ParameterList::ToString
std::string ToString() const override
Definition: otbWrapperParameterList.hxx:384
otb::Wrapper::StringListInterface::StringVector
std::vector< std::string > StringVector
Definition: otbWrapperStringListInterface.h:48
otb::Wrapper::ParameterList::GetStrings
std::vcl_size_t GetStrings(StringVector &) const override
Definition: otbWrapperParameterList.hxx:184
otb::Wrapper::ParameterList::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperParameterList.h:51
otb::Wrapper::ParameterList::GetFileNameList
StringVector GetFileNameList() const override
Definition: otbWrapperParameterList.hxx:193
otb::Wrapper::ParameterList::ParameterList
ParameterList()
Definition: otbWrapperParameterList.hxx:41
otb::Wrapper::ParameterList::SetListFromFileName
void SetListFromFileName(const StringVector &) override
Definition: otbWrapperParameterList.hxx:87
otb::Wrapper::ParameterList::Size
std::vcl_size_t Size() const override
Definition: otbWrapperParameterList.hxx:237
otb::Wrapper::ParameterList::Swap
void Swap(std::vcl_size_t, std::vcl_size_t) override
Definition: otbWrapperParameterList.hxx:255
otb::Wrapper::ParameterList::FromData
T::Pointer FromData(D *, Set, const std::string &description=std::string())
Definition: otbWrapperParameterList.hxx:349