20 #ifndef __itkResourceProbe_txx
21 #define __itkResourceProbe_txx
24 #include "itkNumericTraits.h"
30 template<
class ValueType,
class MeanType>
33 :m_TypeString(type),m_UnitString(unit)
42 template<
class ValueType,
class MeanType>
49 template<
class ValueType,
class MeanType>
54 return this->m_TypeString;
58 template<
class ValueType,
class MeanType>
63 return this->m_UnitString;
67 template<
class ValueType,
class MeanType>
72 this->m_NumberOfStarts++;
73 this->m_StartValue = this->GetInstantValue();
77 template<
class ValueType,
class MeanType>
82 if( this->m_NumberOfStops == this->m_NumberOfStarts )
84 itkGenericExceptionMacro( <<
"Can't stop a probe that has not been started." );
86 this->m_TotalValue += this->GetInstantValue() - this->m_StartValue;
87 this->m_NumberOfStops++;
91 template<
class ValueType,
class MeanType>
96 return this->m_NumberOfStarts;
100 template<
class ValueType,
class MeanType>
105 return this->m_NumberOfStops;
109 template<
class ValueType,
class MeanType>
114 return this->m_TotalValue;
118 template<
class ValueType,
class MeanType>
125 if( this->m_NumberOfStops)
127 meanValue =
static_cast<MeanType
>(this->m_TotalValue) / static_cast<MeanType>(this->m_NumberOfStops);