OTB  9.0.0
Orfeo Toolbox
otbObjectListToObjectListFilter.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 otbObjectListToObjectListFilter_h
22 #define otbObjectListToObjectListFilter_h
23 
24 #include "otbObjectListSource.h"
25 
26 namespace otb
27 {
28 
45 template <class TInputList, class TOutputList>
46 class ITK_EXPORT ObjectListToObjectListFilter : public otb::ObjectListSource<TOutputList>
47 {
48 public:
52  typedef itk::SmartPointer<Self> Pointer;
53  typedef itk::SmartPointer<const Self> ConstPointer;
54 
56  itkNewMacro(Self);
57 
60 
62  typedef TInputList InputListType;
63  typedef TOutputList OutputListType;
64  typedef typename TInputList::ConstPointer InputListPointer;
65  typedef typename TOutputList::Pointer OutputListPointer;
66  typedef typename TInputList::ConstIterator InputListIterator;
69 
70  typedef itk::DataObject::Pointer DataObjectPointer;
71 
72  using Superclass::SetInput;
73  virtual void SetInput(const InputListType* input);
74  const InputListType* GetInput(void);
75 
76 protected:
79 
82  {
83  }
84 
86  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
87 
88  void GenerateData(void) override;
89 
92  typedef std::vector<OutputListPointer> OutputListForThreadType;
93 
94  virtual void BeforeThreadedGenerateData();
95 
97  {
98  }
99 
100  virtual int SplitRequestedRegion(itk::ThreadIdType threadId, int threadCount, unsigned int requestedElements, unsigned int& startIndex,
101  unsigned int& stopIndex);
102 
105  virtual void ThreadedGenerateData(unsigned int startIndex, unsigned int stopIndex, itk::ThreadIdType threadId);
106 
110  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void* arg);
111 
114  {
116  };
117 
119 
122 private:
123  ObjectListToObjectListFilter(const Self&) = delete;
124  void operator=(const Self&) = delete;
125 };
126 
127 } // end namespace otb
128 
129 #ifndef OTB_MANUAL_INSTANTIATION
131 #endif
132 
133 #endif
otb::ObjectListToObjectListFilter::~ObjectListToObjectListFilter
~ObjectListToObjectListFilter() override
Definition: otbObjectListToObjectListFilter.h:81
otb::ObjectListToObjectListFilter::Self
ObjectListToObjectListFilter Self
Definition: otbObjectListToObjectListFilter.h:50
otb::ObjectListSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectListSource.h:53
otb::ObjectListToObjectListFilter::AfterThreadedGenerateData
virtual void AfterThreadedGenerateData()
Definition: otbObjectListToObjectListFilter.h:96
otbObjectListSource.h
otb::ObjectList::ObjectType
TObject ObjectType
Definition: otbObjectList.h:53
otb::ObjectListToObjectListFilter::InputListType
TInputList InputListType
Definition: otbObjectListToObjectListFilter.h:59
otb::ObjectListToObjectListFilter::InputObjectType
InputListType::ObjectType InputObjectType
Definition: otbObjectListToObjectListFilter.h:67
otbObjectListToObjectListFilter.hxx
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ObjectListToObjectListFilter::InputListIterator
TInputList::ConstIterator InputListIterator
Definition: otbObjectListToObjectListFilter.h:66
otb::ObjectListToObjectListFilter::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbObjectListToObjectListFilter.h:53
otb::ObjectListToObjectListFilter::OutputListType
TOutputList OutputListType
Definition: otbObjectListToObjectListFilter.h:63
otb::ObjectListToObjectListFilter::InputListPointer
TInputList::ConstPointer InputListPointer
Definition: otbObjectListToObjectListFilter.h:64
otb::ObjectListToObjectListFilter
Base class for filters that take an ObjectList as input and produce an ObjectList as output.
Definition: otbObjectListToObjectListFilter.h:46
otb::ObjectListToObjectListFilter::ThreadStruct
Definition: otbObjectListToObjectListFilter.h:113
otb::ObjectListSource
Base class for all process objects that output ObjectList data.
Definition: otbObjectListSource.h:47
otb::ObjectListToObjectListFilter::OutputObjectType
OutputListType::ObjectType OutputObjectType
Definition: otbObjectListToObjectListFilter.h:68
otb::ObjectListToObjectListFilter::Superclass
otb::ObjectListSource< TOutputList > Superclass
Definition: otbObjectListToObjectListFilter.h:51
otb::ObjectListToObjectListFilter::OutputListPointer
TOutputList::Pointer OutputListPointer
Definition: otbObjectListToObjectListFilter.h:65
otb::ObjectListToObjectListFilter::OutputListForThreadType
std::vector< OutputListPointer > OutputListForThreadType
Definition: otbObjectListToObjectListFilter.h:92
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::ObjectListToObjectListFilter::DataObjectPointer
itk::DataObject::Pointer DataObjectPointer
Definition: otbObjectListToObjectListFilter.h:70
otb::ObjectListToObjectListFilter::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectListToObjectListFilter.h:52
otb::ObjectListToObjectListFilter::m_ObjectListPerThread
OutputListForThreadType m_ObjectListPerThread
Definition: otbObjectListToObjectListFilter.h:118
otb::ObjectListToObjectListFilter::ThreadStruct::Filter
Pointer Filter
Definition: otbObjectListToObjectListFilter.h:115