HawkTracer  0.8.0
scoped_tracepoint.hpp
Go to the documentation of this file.
1 #ifndef HAWKTRACER_SCOPED_TRACEPOINT_HPP
2 #define HAWKTRACER_SCOPED_TRACEPOINT_HPP
3 
4 #ifdef __cplusplus
5 
7 
8 namespace HawkTracer
9 {
10 
11 #ifdef HT_CPP11
12 template<typename ...T>
13 #else
14 template<typename T>
15 #endif
17 {
18 public:
20  HT_Timeline* timeline,
21 #ifdef HT_CPP11
22  void (*start_fnc)(HT_Timeline*, T...), T... label
23 #else
24  void (*start_fnc)(HT_Timeline*, T), T label
25 #endif
26  ):
27  _timeline(timeline)
28  {
29 #ifdef HT_CPP11
30  start_fnc(_timeline, label...);
31 #else
32  start_fnc(_timeline, label);
33 #endif
34  }
35 
37  {
38  ht_feature_callstack_stop(_timeline);
39  }
40 
41 private:
42  HT_Timeline* _timeline;
43 };
44 
45 } /* namespace HawkTracer */
46 
47 #endif /* __cplusplus */
48 
49 #endif /* HAWKTRACER_SCOPED_TRACEPOINT_HPP */
typedefHT_DECLS_BEGIN struct _HT_Timeline HT_Timeline
Definition: timeline.h:22
Definition: scoped_tracepoint.hpp:8
Definition: scoped_tracepoint.hpp:16
ScopedTracepoint(HT_Timeline *timeline, void(*start_fnc)(HT_Timeline *, T), T label)
Definition: scoped_tracepoint.hpp:19
~ScopedTracepoint()
Definition: scoped_tracepoint.hpp:36
HT_API void ht_feature_callstack_stop(HT_Timeline *timeline)
#define HT_CPP11
Definition: macros.h:24