21 #ifndef otbObjectListSource_hxx
22 #define otbObjectListSource_hxx
25 #include "itkProgressReporter.h"
34 template <
class TOutputList>
39 typename TOutputList::Pointer output =
static_cast<TOutputList*
>(this->MakeOutput(0).GetPointer());
40 this->Superclass::SetNumberOfRequiredOutputs(1);
41 this->Superclass::SetNthOutput(0, output.GetPointer());
48 template <
class TOutputList>
51 return static_cast<itk::DataObject*
>(TOutputList::New().GetPointer());
57 template <
class TOutputList>
60 if (this->GetNumberOfOutputs() < 1)
65 return static_cast<TOutputList*
>(this->Superclass::GetOutput(0));
71 template <
class TOutputList>
74 return static_cast<TOutputList*
>(this->Superclass::GetOutput(idx));
80 template <
class TOutputList>
83 this->GraftNthOutput(0, graft);
89 template <
class TOutputList>
92 if (idx >= this->GetNumberOfOutputs())
94 itkExceptionMacro(<<
"Requested to graft output " << idx <<
" but this filter only has " << this->GetNumberOfOutputs() <<
" Outputs.");
99 itkExceptionMacro(<<
"Requested to graft output that is a NULL pointer");
102 itk::DataObject* output = this->GetOutput(idx);
105 output->Graft(graft);
110 template <
class TOutputList>
116 for (
unsigned int i = 0; i < this->GetNumberOfOutputs(); ++i)
118 outputPtr = this->GetOutput(i);
126 template <
class TOutputList>
129 itkExceptionMacro(
"subclass should override this method!!!");
135 template <
class TOutputList>
138 Superclass::PrintSelf(os, indent);