ITK  6.0.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 * https://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"
24
25namespace itk
26{
37template <typename TProbe>
38class ITK_TEMPLATE_EXPORT ResourceProbesCollectorBase
39{
40public:
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
95
96
99 const TProbe &
100 GetProbe(const char * id) const;
101
102
103protected:
104 MapType m_Probes{};
105};
106} // end namespace itk
107
108#ifndef ITK_MANUAL_INSTANTIATION
109# include "itkResourceProbesCollectorBase.hxx"
110#endif
111
112#endif // itkResourceProbesCollectorBase_h
virtual void Report(const char *name, std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
virtual void ExpandedReport(const char *name, std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
virtual void Start(const char *id)
virtual void ExpandedReport(std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
virtual void JSONReport(std::ostream &os=std::cout, bool printSystemInfo=true)
virtual void JSONReport(const char *name, std::ostream &os=std::cout)
virtual void Report(std::ostream &os=std::cout, bool printSystemInfo=true, bool printReportHead=true, bool useTabs=false)
const TProbe & GetProbe(const char *id) const
virtual ~ResourceProbesCollectorBase()=default
virtual void Stop(const char *id)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....