OTB  9.0.0
Orfeo Toolbox
otbWrapperCompositeApplication.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 otbWrapperCompositeApplication_h
22 #define otbWrapperCompositeApplication_h
23 
24 #include "otbWrapperApplication.h"
25 #include "itkStdStreamLogOutput.h"
26 #include <string>
27 
28 namespace otb
29 {
30 namespace Wrapper
31 {
32 
48 class OTBApplicationEngine_EXPORT CompositeApplication : public Application
49 {
50 public:
54  typedef itk::SmartPointer<Self> Pointer;
55  typedef itk::SmartPointer<const Self> ConstPointer;
56 
59 
61  typedef itk::MemberCommand<Self> AddProcessCommandType;
62 
63  typedef struct
64  {
66  std::string Desc;
68 
69  typedef std::map<std::string, InternalApplication> InternalAppContainer;
70 
71 protected:
74 
76  ~CompositeApplication() override;
77 
81  void LinkWatchers(itk::Object* itkNotUsed(caller), const itk::EventObject& event);
82 
89  bool AddApplication(std::string appType, std::string key, std::string desc);
90 
96  void ClearApplications();
97 
102  bool Connect(std::string fromKey, std::string toKey);
103 
112  bool ShareParameter(std::string localKey, std::string internalKey, std::string name = std::string(), std::string desc = std::string());
113 
122  Application* DecodeKey(std::string& key);
123 
127  Application* GetInternalApplication(std::string id);
128 
132  std::string GetInternalAppDescription(std::string id);
133 
137  void ExecuteInternal(std::string key);
138 
142  void UpdateInternalParameters(std::string key);
143 
144 private:
146  void operator=(const CompositeApplication&) = delete;
147 
149 
150  AddProcessCommandType::Pointer m_AddProcessCommand;
151 };
152 }
153 }
154 #endif
otb::Wrapper::Application
This class represent an application TODO.
Definition: otbWrapperApplication.h:76
otb::Wrapper::Application::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperApplication.h:82
otb::Wrapper::CompositeApplication::Superclass
Application Superclass
Definition: otbWrapperCompositeApplication.h:53
otbWrapperApplication.h
otb::Wrapper::CompositeApplication::InternalApplication::App
Application::Pointer App
Definition: otbWrapperCompositeApplication.h:65
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::Wrapper::CompositeApplication::m_AppContainer
InternalAppContainer m_AppContainer
Definition: otbWrapperCompositeApplication.h:148
otb::Wrapper::CompositeApplication::Pointer
itk::SmartPointer< Self > Pointer
Definition: otbWrapperCompositeApplication.h:54
otb::Wrapper::CompositeApplication::InternalApplication::Desc
std::string Desc
Definition: otbWrapperCompositeApplication.h:66
otb::Wrapper::CompositeApplication
This class is a base class for composite applications.
Definition: otbWrapperCompositeApplication.h:48
otb::Wrapper::CompositeApplication::InternalAppContainer
std::map< std::string, InternalApplication > InternalAppContainer
Definition: otbWrapperCompositeApplication.h:69
otb::Wrapper::CompositeApplication::InternalApplication
Definition: otbWrapperCompositeApplication.h:63
otb::Wrapper::CompositeApplication::ConstPointer
itk::SmartPointer< const Self > ConstPointer
Definition: otbWrapperCompositeApplication.h:55
otb::Wrapper::CompositeApplication::m_AddProcessCommand
AddProcessCommandType::Pointer m_AddProcessCommand
Definition: otbWrapperCompositeApplication.h:150
otb::Wrapper::CompositeApplication::AddProcessCommandType
itk::MemberCommand< Self > AddProcessCommandType
Definition: otbWrapperCompositeApplication.h:58
otb::Wrapper::CompositeApplication::Self
CompositeApplication Self
Definition: otbWrapperCompositeApplication.h:52