OTB  6.7.0
Orfeo Toolbox
otbListSampleSource.hxx
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 otbListSampleSource_hxx
22 #define otbListSampleSource_hxx
23 
24 #include "otbListSampleSource.h"
25 
26 namespace otb {
27 namespace Statistics {
28 
29 template < class TInputSampleList, class TOutputSampleList >
32 {
33  this->SetNumberOfRequiredOutputs(1);
34 
35  // Generate the output sample list
36  typename OutputSampleListType::Pointer outputPtr =
37  static_cast< OutputSampleListType * >(this->MakeOutput(0).GetPointer());
38  this->ProcessObject::SetNthOutput(0, outputPtr.GetPointer());
39 }
40 
41 template < class TInputSampleList, class TOutputSampleList >
43 ::DataObjectPointer
46 {
47  OutputSampleListPointer outputSampleList = OutputSampleListType::New();
48  return static_cast<DataObjectPointer>(outputSampleList);
49 }
50 
51 template < class TInputSampleList, class TOutputSampleList >
53 ::OutputSampleListType *
56 {
57  return static_cast<OutputSampleListType * >
58  (this->ProcessObject::GetOutput(0) );
59 }
60 
61 template < class TInputSampleList, class TOutputSampleList >
62 void
64 ::PrintSelf(std::ostream& os, itk::Indent indent) const
65 {
66  // Call superclass implementation
67  Superclass::PrintSelf(os, indent);
68 }
69 
70 } // End namespace Statistics
71 } // End namespace otb
72 
73 #endif
This class is a base class for filters using ListSample as input and returning ListSample.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override
OutputSampleListType::Pointer OutputSampleListPointer
void PrintSelf(std::ostream &os, itk::Indent indent) const override