RTK  1.4.0
Reconstruction Toolkit
rtkGlobalTimer.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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 rtkGlobalTimer_h
19 #define rtkGlobalTimer_h
20 
21 #include <itkProcessObject.h>
24 #include "rtkWatcherForTimer.h"
25 #include "rtkWin32Header.h"
26 #include <itkSimpleFastMutexLock.h>
27 
28 namespace rtk
29 {
38 {
39 public:
41  typedef GlobalTimer Self;
45 
47  itkTypeMacro(GlobalTimer, itk::Object)
48 
49 
54  static Pointer New();
55 
57  static Pointer GetInstance();
58 
60  itkSetMacro(Verbose, bool)
61  itkGetMacro(Verbose, bool)
62 
65  virtual void Start(const char *name);
66 
68  virtual void Stop(const char *name);
69 
71  virtual void Report(std::ostream & os = std::cout) const;
72 
75  virtual void Clear(void);
76 
78  virtual void Watch(itk::ProcessObject *o);
79 
81  virtual void Remove(const rtk::WatcherForTimer *w);
82 
83 protected:
84  GlobalTimer();
85  virtual ~GlobalTimer();
86  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
87  bool m_Verbose;
88 
89 // rtk::GlobalTimerProbesCollector m_GlobalTimerProbesCollector;
90  rtk::TimeProbesCollectorBase m_TimeProbesCollectorBase;
91  std::vector<rtk::WatcherForTimer*> m_Watchers;
92 
93 private:
94  GlobalTimer(const Self &); //purposely not implemented
95  void operator=(const Self &); //purposely not implemented
96 
97  static Pointer m_Instance;
99 
100 };
101 } // end namespace itk
102 
103 #endif
itk::SmartPointer< Self > Pointer
STL namespace.
itk::Object Superclass
Very light watcher to monitor Start and End events on all filters.
itk::SmartPointer< const Self > ConstPointer
GlobalTimer Self
#define RTK_EXPORT
#define itkSetMacro(name, type)