OTB  9.0.0
Orfeo Toolbox
otbStandardWriterWatcher.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1999-2011 Insight Software Consortium
3  * Copyright (C) 2005-2022 Centre National d'Etudes Spatiales (CNES)
4  *
5  * This file is part of Orfeo Toolbox
6  *
7  * https://www.orfeo-toolbox.org/
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */
21 
22 #ifndef otbStandardWriterWatcher_h
23 #define otbStandardWriterWatcher_h
24 
25 #include <iosfwd>
26 
27 #include "otbWriterWatcherBase.h"
28 
29 #include "OTBCommonExport.h"
30 
31 namespace otb
32 {
33 
56 class OTBCommon_EXPORT StandardWriterWatcher : public WriterWatcherBase
57 {
58 public:
61  StandardWriterWatcher(itk::ProcessObject* process, const char* comment = "");
62  StandardWriterWatcher(itk::ProcessObject* process, itk::ProcessObject* source, const char* comment = "");
64 
65  StandardWriterWatcher(itk::ProcessObject* process, const std::string& comment = "");
66  StandardWriterWatcher(itk::ProcessObject* process, itk::ProcessObject* source, const std::string& comment = "");
67 
69  StandardWriterWatcher() : m_StarsCount(0){};
70 
73 
75  void operator=(const StandardWriterWatcher&);
76 
78  void SetStars(int count)
79  {
80  m_StarsCount = count;
81  }
82  const unsigned int& GetStars() const
83  {
84  return m_StarsCount;
85  }
87 
88 protected:
90  void ShowWriterProgress() override;
91 
93  void StartWriter() override;
94 
96  void EndWriter() override;
97 
99  void ShowFilterProgress() override;
100 
102  void StartFilter() override
103  {
104  }
105 
107  void EndFilter() override
108  {
109  }
110 
112  virtual void ShowProgress();
113 
114 private:
116  unsigned int m_StarsCount;
117 
119 
120  std::string m_Buffer;
121 };
122 
123 } // end namespace otb
124 
125 #endif
otb::WriterWatcherBase
This class is an abstract class Provides an interface to progress task mechanic.
Definition: otbWriterWatcherBase.h:51
otb::StandardWriterWatcher::m_CoutIsConsole
bool m_CoutIsConsole
Definition: otbStandardWriterWatcher.h:118
otbWriterWatcherBase.h
otb::StandardWriterWatcher::m_Buffer
std::string m_Buffer
Definition: otbStandardWriterWatcher.h:120
otb
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
Definition: otbJoinContainer.h:32
otb::StandardWriterWatcher::StartFilter
void StartFilter() override
Definition: otbStandardWriterWatcher.h:102
otb::StandardWriterWatcher::GetStars
const unsigned int & GetStars() const
Definition: otbStandardWriterWatcher.h:82
otb::StandardWriterWatcher
This class shows the percentage progress execution of the pipeline filtering process.
Definition: otbStandardWriterWatcher.h:56
otb::StandardWriterWatcher::EndFilter
void EndFilter() override
Definition: otbStandardWriterWatcher.h:107
otb::StandardWriterWatcher::StandardWriterWatcher
StandardWriterWatcher()
Definition: otbStandardWriterWatcher.h:69
otb::StandardWriterWatcher::m_StarsCount
unsigned int m_StarsCount
Definition: otbStandardWriterWatcher.h:116
otb::StandardWriterWatcher::SetStars
void SetStars(int count)
Definition: otbStandardWriterWatcher.h:78