ITK  4.12.0
Insight Segmentation and Registration Toolkit
itkResourceProbe.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkResourceProbe_h
19 #define itkResourceProbe_h
20 
21 #include "itkMacro.h"
22 #include "itkIntTypes.h"
23 
24 #include <string>
25 #include <vector>
26 
27 #include "ITKCommonExport.h"
28 
29 namespace itk
30 {
42 template< typename ValueType, typename MeanType >
43 class ITK_TEMPLATE_EXPORT ResourceProbe
44 {
45 public:
46 
50 
51 public:
52 
54  ResourceProbe(const std::string & type, const std::string & unit);
55 
57  virtual ~ResourceProbe();
58 
60  std::string GetType() const;
61 
63  std::string GetUnit() const;
64 
66  virtual void Start();
67 
73  virtual void Stop();
74 
76  CountType GetNumberOfStarts() const;
77 
79  CountType GetNumberOfStops() const;
80 
82  CountType GetNumberOfIteration() const;
83 
86  virtual ValueType GetInstantValue(void) const = 0;
87 
90  virtual ValueType GetTotal() const;
91 
95  virtual MeanType GetMean() const;
96 
98  virtual void Reset();
99 
102  virtual ValueType GetMinimum() const;
103 
106  virtual ValueType GetMaximum() const;
107 
110  virtual ValueType GetStandardDeviation();
111 
114  virtual ValueType GetStandardError();
115 
117  virtual void SetNameOfProbe(const char* nameOfProbe);
118 
120  virtual std::string GetNameOfProbe() const;
121 
123  virtual void PrintSystemInformation(std::ostream & os = std::cout);
124 
126  virtual void Report(std::ostream & os = std::cout, bool printSystemInfo = true,
127  bool printReportHead = true, bool useTabs = false);
128 
130  virtual void ExpandedReport(std::ostream & os = std::cout, bool printSystemInfo = true,
131  bool printReportHead = true, bool useTabs = false);
132 
133 protected:
135  virtual void UpdateMinimumMaximumMeasuredValue(ValueType value);
136 
138  virtual void PrintReportHead(std::ostream & os = std::cout, bool useTabs = false);
139 
141  virtual void PrintExpandedReportHead(std::ostream & os = std::cout, bool useTabs = false);
142 
144  virtual void GetSystemInformation();
145 
146 private:
147 
148  ValueType m_StartValue;
149  ValueType m_TotalValue;
150  ValueType m_MinimumValue;
151  ValueType m_MaximumValue;
152  MeanType m_MeanValue;
154  ValueType m_StandardError;
155 
159 
160  std::vector<ValueType> m_ProbeValueList;
161 
162  std::string m_NameOfProbe;
163  std::string m_TypeString;
164  std::string m_UnitString;
165 
166  std::string m_SystemName;
167  std::string m_ProcessorName;
170  unsigned int m_NumberOfPhysicalCPU;
171  unsigned int m_NumberOfLogicalCPU;
172  std::string m_OSName;
173  std::string m_OSRelease;
174  std::string m_OSVersion;
175  std::string m_OSPlatform;
177  std::string m_ITKVersion;
182 
183  static ITK_CONSTEXPR_VAR unsigned int tabwidth = 15;
184 };
185 } // end namespace itk
186 
187 #ifndef ITK_MANUAL_INSTANTIATION
188 #include "itkResourceProbe.hxx"
189 #endif
190 
191 #endif //itkResourceProbe_h
std::string m_ProcessorName
vcl_size_t m_AvailablePhysicalMemory
ValueType m_StandardDeviation
*brief Mask an image with the negative of a mask **This class is templated over the types of the *input image type
std::string m_ITKVersion
std::string m_TypeString
vcl_size_t m_AvailableVirtualMemory
unsigned long SizeValueType
Definition: itkIntTypes.h:143
vcl_size_t m_TotalVirtualMemory
std::string m_UnitString
unsigned int m_NumberOfLogicalCPU
vcl_size_t m_TotalPhysicalMemory
std::string m_NameOfProbe
std::string m_OSPlatform
unsigned int m_NumberOfPhysicalCPU
CountType m_NumberOfIteration
SizeValueType CountType
std::vector< ValueType > m_ProbeValueList
Computes the change of a value between two points in code.
std::string m_SystemName