OTB  9.0.0
Orfeo Toolbox
otbObjectListSource.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 otbObjectListSource_h
22 #define otbObjectListSource_h
23 
24 #include "itkProcessObject.h"
25 #include "otbObjectList.h"
26 
27 namespace otb
28 {
29 
46 template <class TOutputList>
47 class ITK_EXPORT ObjectListSource : public itk::ProcessObject
48 {
49 public:
52  typedef itk::ProcessObject Superclass;
53  typedef itk::SmartPointer<Self> Pointer;
54  typedef itk::SmartPointer<const Self> ConstPointer;
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(ObjectListSource, ProcessObject);
61 
63  typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
64  typedef TOutputList OutputListType;
65  typedef typename TOutputList::Pointer OutputListPointer;
66 
67  typedef itk::DataObject::Pointer DataObjectPointer;
68 
82  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
83  using Superclass::MakeOutput;
85 
120  void GraftOutput(itk::DataObject* graft);
122 
129  void GraftNthOutput(DataObjectPointerArraySizeType idx, itk::DataObject* graft);
130 
171  OutputListType* GetOutput(void);
174 
175 protected:
178 
180  ~ObjectListSource() override
181  {
182  }
183 
185  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
186 
188  virtual void AllocateOutputs();
189 
200  void GenerateData(void) override;
201 
202 private:
203  ObjectListSource(const Self&) = delete;
204  void operator=(const Self&) = delete;
205 };
206 
207 } // end namespace otb
208 
209 #ifndef OTB_MANUAL_INSTANTIATION
210 #include "otbObjectListSource.hxx"
211 #endif
212 
213 #endif
otb::ObjectListSource::DataObjectPointer
itk::DataObject::Pointer DataObjectPointer
Definition: otbObjectListSource.h:67
otb::ObjectListSource::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbObjectListSource.h:53
otbObjectListSource.hxx
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::ObjectListSource::OutputListPointer
TOutputList::Pointer OutputListPointer
Definition: otbObjectListSource.h:65
otb::ObjectListSource::Superclass
itk::ProcessObject Superclass
Definition: otbObjectListSource.h:52
otb::ObjectListSource::~ObjectListSource
~ObjectListSource() override
Definition: otbObjectListSource.h:180
otb::ObjectListSource::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbObjectListSource.h:54
otb::ObjectListSource
Base class for all process objects that output ObjectList data.
Definition: otbObjectListSource.h:47
otb::ObjectListSource::Self
ObjectListSource Self
Definition: otbObjectListSource.h:51
otbObjectList.h
otb::ObjectListSource::DataObjectPointerArraySizeType
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
Definition: otbObjectListSource.h:60
otb::ObjectList
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >.
Definition: otbObjectList.h:40
otb::ObjectListSource::OutputListType
TOutputList OutputListType
Definition: otbObjectListSource.h:64