ITK  4.8.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 #include <string>
24 
25 namespace itk
26 {
38 template< typename ValueType, typename MeanType >
40 {
41 public:
42 
46 
47 public:
48 
50  ResourceProbe(const std::string & type, const std::string & unit);
51 
53  virtual ~ResourceProbe();
54 
56  std::string GetType() const;
57 
59  std::string GetUnit() const;
60 
62  void Start();
63 
69  void Stop();
70 
73 
76 
79  virtual ValueType GetInstantValue(void) const = 0;
80 
83  ValueType GetTotal() const;
84 
88  MeanType GetMean() const;
89 
91  void Reset();
92 
93 private:
94 
95  ValueType m_StartValue;
96  ValueType m_TotalValue;
97 
100 
101  std::string m_TypeString;
102  std::string m_UnitString;
103 };
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkResourceProbe.hxx"
108 #endif
109 
110 #endif //itkResourceProbe_h
std::string GetUnit() const
ResourceProbe(const std::string &type, const std::string &unit)
*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_TypeString
CountType GetNumberOfStarts() const
unsigned long SizeValueType
Definition: itkIntTypes.h:143
MeanType GetMean() const
std::string m_UnitString
CountType GetNumberOfStops() const
ValueType GetTotal() const
CountType m_NumberOfStarts
virtual ~ResourceProbe()
SizeValueType CountType
virtual ValueType GetInstantValue(void) const =0
std::string GetType() const
Computes the change of a value between two points in code.