ITK  5.2.0
Insight Toolkit
itkResourceProbesCollectorBase.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 itkResourceProbesCollectorBase_h
19 #define itkResourceProbesCollectorBase_h
20 
21 
22 #include "itkResourceProbe.h"
23 #include "itkMemoryUsageObserver.h"
24 
25 namespace itk
26 {
37 template <typename TProbe>
38 class ITK_TEMPLATE_EXPORT ResourceProbesCollectorBase
39 {
40 public:
41  using IdType = std::string;
42  using MapType = std::map<IdType, TProbe>;
43 
45  virtual ~ResourceProbesCollectorBase() = default;
46 
49  virtual void
50  Start(const char * id);
51 
53  virtual void
54  Stop(const char * id);
55 
57  virtual void
58  Report(std::ostream & os = std::cout, bool printSystemInfo = true, bool printReportHead = true, bool useTabs = false);
59 
61  virtual void
62  Report(const char * name,
63  std::ostream & os = std::cout,
64  bool printSystemInfo = true,
65  bool printReportHead = true,
66  bool useTabs = false);
67 
69  virtual void
70  ExpandedReport(std::ostream & os = std::cout,
71  bool printSystemInfo = true,
72  bool printReportHead = true,
73  bool useTabs = false);
74 
76  virtual void
77  ExpandedReport(const char * name,
78  std::ostream & os = std::cout,
79  bool printSystemInfo = true,
80  bool printReportHead = true,
81  bool useTabs = false);
82 
84  virtual void
85  JSONReport(std::ostream & os = std::cout, bool printSystemInfo = true);
86 
88  virtual void
89  JSONReport(const char * name, std::ostream & os = std::cout);
90 
93  virtual void
94  Clear();
95 
96 
99  const TProbe &
100  GetProbe(const char * id) const;
101 
102 
103 protected:
105 };
106 } // end namespace itk
107 
108 #ifndef ITK_MANUAL_INSTANTIATION
109 # include "itkResourceProbesCollectorBase.hxx"
110 #endif
111 
112 #endif // itkResourceProbesCollectorBase_h
itk::ResourceProbesCollectorBase
Aggregates a set of probes.
Definition: itkResourceProbesCollectorBase.h:38
itk::ResourceProbesCollectorBase::m_Probes
MapType m_Probes
Definition: itkResourceProbesCollectorBase.h:104
itkResourceProbe.h
itk::ResourceProbesCollectorBase< MemoryProbe >::MapType
std::map< IdType, MemoryProbe > MapType
Definition: itkResourceProbesCollectorBase.h:42
itk::ResourceProbesCollectorBase< MemoryProbe >::IdType
std::string IdType
Definition: itkResourceProbesCollectorBase.h:41
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itkMemoryUsageObserver.h