ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkResourceProbe.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkResourceProbe_h
00019 #define __itkResourceProbe_h
00020 
00021 #include "itkMacro.h"
00022 #include "itkIntTypes.h"
00023 #include <string>
00024 
00025 namespace itk
00026 {
00038 template< class ValueType, class MeanType >
00039 class ITK_EXPORT ResourceProbe
00040 {
00041 public:
00042 
00045   typedef  SizeValueType  CountType;
00046 public:
00047 
00049   ResourceProbe(const std::string & type, const std::string & unit);
00050 
00052   virtual ~ResourceProbe();
00053 
00055   std::string GetType(void) const;
00056 
00058   std::string GetUnit(void) const;
00059 
00061   void        Start(void);
00062 
00064   void        Stop(void);
00065 
00067   CountType   GetNumberOfStarts(void) const;
00068 
00070   CountType   GetNumberOfStops(void) const;
00071 
00074   virtual ValueType   GetInstantValue(void) const = 0;
00075 
00078   ValueType    GetTotal(void) const;
00079 
00083   MeanType    GetMean(void) const;
00084 
00085 private:
00086 
00087   ValueType m_StartValue;
00088   ValueType m_TotalValue;
00089 
00090   CountType m_NumberOfStarts;
00091   CountType m_NumberOfStops;
00092 
00093   std::string m_TypeString;
00094   std::string m_UnitString;
00095 };
00096 } // end namespace itk
00097 
00098 #ifndef ITK_MANUAL_INSTANTIATION
00099 #include "itkResourceProbe.hxx"
00100 #endif
00101 
00102 #endif //__itkResourceProbe_h
00103