ITK  4.3.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< class ValueType, class MeanType >
39 class ITK_EXPORT ResourceProbe
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(void) const;
57 
59  std::string GetUnit(void) const;
60 
62  void Start(void);
63 
65  void Stop(void);
66 
68  CountType GetNumberOfStarts(void) const;
69 
71  CountType GetNumberOfStops(void) const;
72 
75  virtual ValueType GetInstantValue(void) const = 0;
76 
79  ValueType GetTotal(void) const;
80 
84  MeanType GetMean(void) const;
85 
86 private:
87 
88  ValueType m_StartValue;
89  ValueType m_TotalValue;
90 
93 
94  std::string m_TypeString;
95  std::string m_UnitString;
96 };
97 } // end namespace itk
98 
99 #ifndef ITK_MANUAL_INSTANTIATION
100 #include "itkResourceProbe.hxx"
101 #endif
102 
103 #endif //__itkResourceProbe_h
104