OTB  6.7.0
Orfeo Toolbox
otbWrapperParameterList.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 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 >
44 {
45 //
46 // Public types.
47 public:
51 
54 
56  typedef std::vector< typename T::Pointer > ParameterVector;
57 
58 //
59 // Public methods.
60 public:
61 
63  itkTypeMacro( ParameterList, AbstractParameterList );
64 
66  typename ParameterVector::const_iterator begin() const;
67 
69  typename ParameterVector::const_iterator end() const;
70 
72  void ClearValue() override;
73 
75  bool HasValue() const override;
76 
78  void SetListFromFileName( const StringVector & ) override;
79 
81  void InsertNullElement( std::size_t = -1 ) override;
82 
84  void AddFromFileName( const std::string & ) override;
85 
87  void Insert( const std::string &, std::size_t = -1 ) override;
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  std::vector<std::string> ToStringList() const override;
121  void FromStringList(const std::vector<std::string>& value) override;
122  std::string ToString() const override;
123 
124 protected:
126  ParameterList();
127 
129  ~ParameterList() override;
130 
131 // Protected methods.
132 protected:
134  template< typename L, typename From, typename Get >
135  void
136  SetObjectList( L &, const L &, From, Get );
137 
139  template< typename L, typename Get >
140  typename L::ObjectType *
141  GetObjectList( L &, Get );
142 
144  template< typename L, typename Get >
145  const typename L::ObjectType *
146  GetObjectList( L &, Get ) const;
147 
149  template< typename D, typename From >
150  void AddData( D *, From );
151 
153  template< typename D, typename Set >
154  typename T::Pointer
155  FromData( D *,
156  Set,
157  const std::string & description = std::string() );
158 
160  template< typename D, typename Set >
161  typename T::Pointer &
162  FromData( typename T::Pointer &,
163  D *,
164  Set,
165  const std::string & description = std::string() );
166 
167 //
168 // Protected attributes.
169 protected:
172 
173 }; // End class InputImage Parameter
174 
175 } // End namespace Wrapper
176 
177 } // End namespace otb
178 
179 #ifndef OTB_MANUAL_INSTANTIATION
180 # include "otbWrapperParameterList.hxx"
181 #endif
182 
183 #endif
std::vcl_size_t GetStrings(StringVector &) const override
itk::SmartPointer< Self > Pointer
This class is a base class for list-type parameters.
StringVector GetFileNameList() const override
std::vcl_size_t Size() const override
std::vector< std::string > ToStringList() const override
std::vcl_size_t SetStrings(const StringVector &) override
virtual void Erase(std::vcl_size_t id)
void SetListFromFileName(const StringVector &) override
void Erase(std::vcl_size_t start, std::vcl_size_t count) override
void FromStringList(const std::vector< std::string > &value) override
itk::SmartPointer< const Self > ConstPointer
T::Pointer FromData(D *, Set, const std::string &description=std::string())
This class represents a InputImage parameter.
std::string ToString() const override
bool IsActive(vcl_size_t) const override
void AddFromFileName(const std::string &) override
void Swap(std::vcl_size_t, std::vcl_size_t) override
void Insert(const std::string &, std::vcl_size_t=-1) override
const std::string & GetToolTip(std::vcl_size_t) const override
ParameterVector::const_iterator end() const
std::string GetNthFileName(std::vcl_size_t) const override
void SetNthFileName(std::vcl_size_t, const std::string &) override
void SetObjectList(L &, const L &, From, Get)
std::vector< typename T::Pointer > ParameterVector
ParameterVector::const_iterator begin() const
L::ObjectType * GetObjectList(L &, Get)
void InsertNullElement(std::vcl_size_t=-1) override