OTB  9.0.0
Orfeo Toolbox
otbWrapperDocExampleStructure.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 otbWrapperDocExampleStructure_h
22 #define otbWrapperDocExampleStructure_h
23 
24 #include "itkObject.h"
25 #include "itkObjectFactory.h"
26 
27 #include <string>
28 #include <vector>
29 #include "otbConfigure.h"
30 #include "itkFixedArray.h"
31 #include "OTBApplicationEngineExport.h"
32 
33 namespace otb
34 {
35 namespace Wrapper
36 {
37 
46 class OTBApplicationEngine_EXPORT DocExampleStructure : public itk::Object
47 {
48 public:
51  typedef itk::Object Superclass;
52  typedef itk::SmartPointer<Self> Pointer;
53  typedef itk::SmartPointer<const Self> ConstPointer;
54 
56  itkNewMacro(Self);
57 
59  itkTypeMacro(DocExampleStructure, itk::Object);
60 
61  typedef std::pair<std::string, std::string> ParameterType;
62  typedef std::vector<ParameterType> ParametersVectorType;
63  typedef std::vector<ParametersVectorType> ParametersVectorOfVectorType;
64 
66  itkGetMacro(NbOfExamples, unsigned int);
67 
71  void AddParameter(const std::string &key, const std::string &name, unsigned int exId = 0);
72 
74  ParametersVectorOfVectorType GetParameterList();
75 
77  unsigned int GetNumberOfParameters(unsigned int exId = 0);
78 
80  std::string GetParameterKey(unsigned int i, unsigned int exId = 0);
81 
83  std::string GetParameterValue(unsigned int i, unsigned int exId = 0);
84 
86  void SetApplicationName(const std::string &name);
87 
89  std::string GetApplicationName();
90 
92  std::vector<std::string> GetExampleCommentList();
93 
95  std::string GetExampleComment(unsigned int i);
96 
98  void SetExampleComment(const std::string& comm, unsigned int i);
99 
101  unsigned int AddExample(const std::string& comm = "");
102 
105  std::string GenerateCLExample(unsigned int exId);
106 
108  std::string GenerateCLExample();
109 
112  std::string GenerateHtmlExample(unsigned int exId);
113 
115  std::string GenerateHtmlExample();
116 
117 protected:
120 
122  ~DocExampleStructure() override;
123 
124 private:
125  DocExampleStructure(const DocExampleStructure&) = delete;
126  void operator=(const DocExampleStructure&) = delete;
127 
130 
132  std::string m_ApplicationName;
133 
135  std::vector<std::string> m_ExampleCommentList;
136 
138  unsigned int m_NbOfExamples;
139 
140 }; // End class Parameter
141 
142 } // End namespace Wrapper
143 } // End namespace otb
144 
145 #endif
otb::Wrapper::DocExampleStructure::ParameterType
std::pair< std::string, std::string > ParameterType
Definition: otbWrapperDocExampleStructure.h:59
otb::Wrapper::DocExampleStructure::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWrapperDocExampleStructure.h:53
otb::Wrapper::DocExampleStructure::m_ExampleCommentList
std::vector< std::string > m_ExampleCommentList
Definition: otbWrapperDocExampleStructure.h:135
otb::Wrapper::DocExampleStructure::m_NbOfExamples
unsigned int m_NbOfExamples
Definition: otbWrapperDocExampleStructure.h:138
otb::Wrapper::DocExampleStructure::Self
DocExampleStructure Self
Definition: otbWrapperDocExampleStructure.h:50
otb::Wrapper::DocExampleStructure
This class is a structure that gathered the necessary element to generate an example (for CommandLine...
Definition: otbWrapperDocExampleStructure.h:46
otb::Wrapper::DocExampleStructure::ParametersVectorOfVectorType
std::vector< ParametersVectorType > ParametersVectorOfVectorType
Definition: otbWrapperDocExampleStructure.h:63
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::DocExampleStructure::ParametersVectorType
std::vector< ParameterType > ParametersVectorType
Definition: otbWrapperDocExampleStructure.h:62
otb::Wrapper::DocExampleStructure::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperDocExampleStructure.h:52
otb::Wrapper::DocExampleStructure::Superclass
itk::Object Superclass
Definition: otbWrapperDocExampleStructure.h:51
otb::Wrapper::DocExampleStructure::m_ApplicationName
std::string m_ApplicationName
Definition: otbWrapperDocExampleStructure.h:132
otb::Wrapper::DocExampleStructure::m_ParameterList
ParametersVectorOfVectorType m_ParameterList
Definition: otbWrapperDocExampleStructure.h:129