OTB  6.1.0
Orfeo Toolbox
otbObjectListToObjectListFilter.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2017 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:
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 
71 
72  using Superclass::SetInput;
73  virtual void SetInput(const InputListType *input);
74  const InputListType * GetInput(void);
75 
76 protected:
79 
82 
84  void PrintSelf(std::ostream& os, itk::Indent indent) const ITK_OVERRIDE;
85 
86  void GenerateData(void) ITK_OVERRIDE;
87 
91 
92  virtual void BeforeThreadedGenerateData();
93 
94  virtual void AfterThreadedGenerateData() {}
95 
96  virtual int SplitRequestedRegion(itk::ThreadIdType threadId, int threadCount, unsigned int requestedElements,
97  unsigned int& startIndex, unsigned int& stopIndex);
98 
101  virtual void ThreadedGenerateData(unsigned int startIndex, unsigned int stopIndex, itk::ThreadIdType threadId);
102 
106  static ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
107 
110  {
112  };
113 
115 
118 private:
119  ObjectListToObjectListFilter(const Self &); //purposely not implemented
120  void operator =(const Self&); //purposely not implemented
121 
122 };
123 
124 } // end namespace otb
125 
126 #ifndef OTB_MANUAL_INSTANTIATION
128 #endif
129 
130 #endif
itk::SmartPointer< const Self > ConstPointer
#define ITK_THREAD_RETURN_TYPE
otb::ObjectListSource< TOutputList > Superclass
Base class for all process objects that output ObjectList data.
TObject ObjectType
Definition: otbObjectList.h:52
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >...
Definition: otbObjectList.h:39
unsigned int ThreadIdType
Base class for filters that take an ObjectList as input and produce an ObjectList as output...