Gobelijn API documentation  - generated for commit a0cbea7
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
FunctionTracer.h
Go to the documentation of this file.
1 #pragma once
2 
8 #include "tracer/TracerOutput.h"
9 #include <string>
10 
12 #if defined(__GNUC__)
13 #define COMP_MISC_FUNCTION_NAME __PRETTY_FUNCTION__
14 #else
15 #define COMP_MISC_FUNCTION_NAME __FUNCTION__
16 #endif
17 
19 #define COMP_MISC_FUNCTION_TRACER \
20  UA_CoMP::Misc::FunctionTracer macro_defined_function_tracer##__LINE__(COMP_MISC_FUNCTION_NAME)
21 
22 namespace UA_CoMP {
23 namespace Misc {
24 
35 {
36 public:
38  explicit FunctionTracer(const std::string& function_name);
39 
41  FunctionTracer(const FunctionTracer&) = delete;
42 
44  FunctionTracer& operator=(const FunctionTracer&) = delete;
45 
48 
49 private:
50  std::string const m_function_name;
51 };
52 
53 } // namespace Misc
54 } // namespace UA_CoMP
std::string const m_function_name
FunctionTracer(const std::string &function_name)
Constructor inserts message in TrackerOutput about entering a function body.
Header for TracerOutput.
FunctionTracer & operator=(const FunctionTracer &)=delete
No assignment.
Class whose constructor/destructor pair are used to mark entering and leaving a function body block...
~FunctionTracer()
Destructor inserts message in TracketOutput about leaving funvtion body.