ITK  4.9.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 ITKCommon_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 
113  virtual void SetNameOfProbe(const char* nameOfProbe);
114 
116  virtual std::string GetNameOfProbe() const;
117 
119  virtual void PrintSystemInformation(std::ostream & os = std::cout);
120 
122  virtual void Report(std::ostream & os =std::cout, bool printSystemInfo = true,
123  bool printReportHead = true);
124 
126  virtual void ExpandedReport(std::ostream & os =std::cout, bool printSystemInfo = true,
127  bool printReportHead = true);
128 
129 protected:
131  virtual void UpdateMinimumMaximumMeasuredValue(ValueType value);
132 
134  virtual void PrintReportHead(std::ostream & os =std::cout);
135 
137  virtual void PrintExpandedReportHead(std::ostream & os =std::cout);
138 
140  virtual void GetSystemInformation();
141 
142 private:
143 
144  ValueType m_StartValue;
145  ValueType m_TotalValue;
146  ValueType m_MinimumValue;
147  ValueType m_MaximumValue;
148  MeanType m_MeanValue;
150 
154 
155  std::vector<ValueType> m_ProbeValueList;
156 
157  std::string m_NameOfProbe;
158  std::string m_TypeString;
159  std::string m_UnitString;
160 
161  std::string m_SystemName;
162  std::string m_ProcessorName;
165  unsigned int m_NumberOfPhysicalCPU;
166  unsigned int m_NumberOfLogicalCPU;
168  std::string m_OSName;
169  std::string m_OSRelease;
170  std::string m_OSVersion;
171  std::string m_OSPlatform;
173  std::string m_ITKVersion;
178 
179  static const unsigned int tabwidth = 15;
180 };
181 } // end namespace itk
182 
183 #ifndef ITK_MANUAL_INSTANTIATION
184 #include "itkResourceProbe.hxx"
185 #endif
186 
187 #endif //itkResourceProbe_h
unsigned int m_NumberOfAvailableCore
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