OTB  6.7.0
Orfeo Toolbox
otbWrapperDocExampleStructure.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 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 :
47  public itk::Object
48 {
49 public:
55 
57  itkNewMacro(Self);
58 
61 
62  typedef std::pair<std::string, std::string> ParameterType;
63  typedef std::vector<ParameterType> ParametersVectorType;
64  typedef std::vector<ParametersVectorType> ParametersVectorOfVectorType;
65 
67  itkGetMacro(NbOfExamples, unsigned int);
68 
72  void AddParameter( const std::string key, const std::string name, unsigned int exId = 0);
73 
75  ParametersVectorOfVectorType GetParameterList();
76 
78  unsigned int GetNumberOfParameters(unsigned int exId = 0);
79 
81  std::string GetParameterKey( unsigned int i, unsigned int exId = 0 );
82 
84  std::string GetParameterValue( unsigned int i, unsigned int exId=0 );
85 
87  void SetApplicationName( const std::string name );
88 
90  std::string GetApplicationName();
91 
93  std::vector<std::string> GetExampleCommentList();
94 
96  std::string GetExampleComment( unsigned int i);
97 
99  void SetExampleComment( const std::string & comm, unsigned int i);
100 
102  unsigned int AddExample( const std::string & comm = "");
103 
106  std::string GenerateCLExample( unsigned int exId );
107 
109  std::string GenerateCLExample();
110 
113  std::string GenerateHtmlExample( unsigned int exId );
114 
116  std::string GenerateHtmlExample();
117 
118 protected:
121 
123  ~DocExampleStructure() override;
124 
125 private:
126  DocExampleStructure(const DocExampleStructure &) = delete;
127  void operator =(const DocExampleStructure&) = delete;
128 
131 
133  std::string m_ApplicationName;
134 
136  std::vector<std::string> m_ExampleCommentList;
137 
139  unsigned int m_NbOfExamples;
140 
141 }; // End class Parameter
142 
143 } // End namespace Wrapper
144 } // End namespace otb
145 
146 #endif
This class is a structure that gathered the necessary element to generate an example (for CommandLine...
std::pair< std::string, std::string > ParameterType
std::vector< ParametersVectorType > ParametersVectorOfVectorType
itk::SmartPointer< const Self > ConstPointer
std::vector< ParameterType > ParametersVectorType