OTB  9.0.0
Orfeo Toolbox
otbUnaryFunctorObjectListFilter.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 otbUnaryFunctorObjectListFilter_h
22 #define otbUnaryFunctorObjectListFilter_h
23 
25 
26 namespace otb
27 {
28 
40 template <class TInputList, class TOutputList, class TFunction>
41 class ITK_EXPORT UnaryFunctorObjectListFilter : public otb::ObjectListToObjectListFilter<TInputList, TOutputList>
42 {
43 public:
47  typedef itk::SmartPointer<Self> Pointer;
48  typedef itk::SmartPointer<const Self> ConstPointer;
49 
51  itkNewMacro(Self);
52 
55 
57  typedef TFunction FunctorType;
58  typedef TInputList InputListType;
59  typedef TOutputList OutputListType;
60  typedef typename TInputList::ConstPointer InputListPointer;
61  typedef typename TOutputList::Pointer OutputListPointer;
62  typedef typename TInputList::ConstIterator InputListIterator;
63  typedef typename TOutputList::ConstIterator OutputListIterator;
64 
70  {
71  return m_Functor;
72  }
73 
74  const FunctorType& GetFunctor() const
75  {
76  return m_Functor;
77  }
78 
85  void SetFunctor(const FunctorType& functor)
86  {
87  if (m_Functor != functor)
88  {
89  m_Functor = functor;
90  this->Modified();
91  }
92  }
94 
95 protected:
98  {
99  }
100 
103  void AfterThreadedGenerateData() override;
104 
107  void ThreadedGenerateData(unsigned int startIndex, unsigned int stopIndex, itk::ThreadIdType threadId) override;
108 
111 private:
112  UnaryFunctorObjectListFilter(const Self&) = delete;
113  void operator=(const Self&) = delete;
114 
116 };
117 
118 } // end namespace otb
119 
120 #ifndef OTB_MANUAL_INSTANTIATION
122 #endif
123 
124 #endif
otb::UnaryFunctorObjectListFilter::OutputListIterator
TOutputList::ConstIterator OutputListIterator
Definition: otbUnaryFunctorObjectListFilter.h:63
otbObjectListToObjectListFilter.h
otb::UnaryFunctorObjectListFilter::~UnaryFunctorObjectListFilter
~UnaryFunctorObjectListFilter() override
Definition: otbUnaryFunctorObjectListFilter.h:97
otb::UnaryFunctorObjectListFilter::GetFunctor
FunctorType & GetFunctor()
Definition: otbUnaryFunctorObjectListFilter.h:69
otb::UnaryFunctorObjectListFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbUnaryFunctorObjectListFilter.h:47
otb::UnaryFunctorObjectListFilter::InputListType
TInputList InputListType
Definition: otbUnaryFunctorObjectListFilter.h:58
otb::UnaryFunctorObjectListFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbUnaryFunctorObjectListFilter.h:48
otb::UnaryFunctorObjectListFilter::FunctorType
TFunction FunctorType
Definition: otbUnaryFunctorObjectListFilter.h:54
otb::UnaryFunctorObjectListFilter::SetFunctor
void SetFunctor(const FunctorType &functor)
Definition: otbUnaryFunctorObjectListFilter.h:85
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::UnaryFunctorObjectListFilter::OutputListPointer
TOutputList::Pointer OutputListPointer
Definition: otbUnaryFunctorObjectListFilter.h:61
otb::UnaryFunctorObjectListFilter::Superclass
otb::ObjectListToObjectListFilter< TInputList, TOutputList > Superclass
Definition: otbUnaryFunctorObjectListFilter.h:46
otb::UnaryFunctorObjectListFilter::InputListIterator
TInputList::ConstIterator InputListIterator
Definition: otbUnaryFunctorObjectListFilter.h:62
otb::ObjectListToObjectListFilter
Base class for filters that take an ObjectList as input and produce an ObjectList as output.
Definition: otbObjectListToObjectListFilter.h:46
otb::UnaryFunctorObjectListFilter
Process each element in the ObjectList with the functor.
Definition: otbUnaryFunctorObjectListFilter.h:41
otb::ObjectListSource
Base class for all process objects that output ObjectList data.
Definition: otbObjectListSource.h:47
otb::UnaryFunctorObjectListFilter::OutputListType
TOutputList OutputListType
Definition: otbUnaryFunctorObjectListFilter.h:59
otb::UnaryFunctorObjectListFilter::Self
UnaryFunctorObjectListFilter Self
Definition: otbUnaryFunctorObjectListFilter.h:45
otb::UnaryFunctorObjectListFilter::GetFunctor
const FunctorType & GetFunctor() const
Definition: otbUnaryFunctorObjectListFilter.h:74
otbUnaryFunctorObjectListFilter.hxx
otb::UnaryFunctorObjectListFilter::m_Functor
FunctorType m_Functor
Definition: otbUnaryFunctorObjectListFilter.h:115
otb::UnaryFunctorObjectListFilter::InputListPointer
TInputList::ConstPointer InputListPointer
Definition: otbUnaryFunctorObjectListFilter.h:60