OTB  6.7.0
Orfeo Toolbox
otbObjectListSource.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 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:
55 
57  itkNewMacro(Self);
58 
60  itkTypeMacro(ObjectListSource, ProcessObject);
61 
64  typedef TOutputList OutputListType;
65  typedef typename TOutputList::Pointer OutputListPointer;
66 
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 
183  void PrintSelf(std::ostream& os, itk::Indent indent) const override;
184 
186  virtual void AllocateOutputs();
187 
198  void GenerateData(void) override;
199 
200 private:
201  ObjectListSource(const Self &) = delete;
202  void operator =(const Self&) = delete;
203 
204 };
205 
206 } // end namespace otb
207 
208 #ifndef OTB_MANUAL_INSTANTIATION
209 #include "otbObjectListSource.hxx"
210 #endif
211 
212 #endif
itk::SmartPointer< const Self > ConstPointer
itk::DataObject::Pointer DataObjectPointer
Base class for all process objects that output ObjectList data.
This class is a generic all-purpose wrapping around an std::vector<itk::SmartPointer<ObjectType> >...
Definition: otbObjectList.h:40
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
itk::ProcessObject Superclass
itk::SmartPointer< Self > Pointer
TOutputList::Pointer OutputListPointer
itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType