All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FunctionTrace.h
Go to the documentation of this file.
1 //=================================================================================================
20 //=================================================================================================
21 
22 #ifndef _BLAZE_UTIL_LOGGING_FUNCTIONTRACE_H_
23 #define _BLAZE_UTIL_LOGGING_FUNCTIONTRACE_H_
24 
25 
26 //*************************************************************************************************
27 // Includes
28 //*************************************************************************************************
29 
30 #include <new>
31 #include <string>
32 #include <blaze/system/Logging.h>
33 #include <blaze/system/Signature.h>
34 #include <blaze/util/NonCopyable.h>
35 
36 
37 namespace blaze {
38 
39 namespace logging {
40 
41 //=================================================================================================
42 //
43 // CLASS DEFINITION
44 //
45 //=================================================================================================
46 
47 //*************************************************************************************************
55 class FunctionTrace : private NonCopyable
56 {
57  public:
58  //**Constructors********************************************************************************
61  FunctionTrace( const std::string& file, const std::string& function );
63  //**********************************************************************************************
64 
65  //**Destructor**********************************************************************************
70  //**********************************************************************************************
71 
72  private:
73  //**Member variables****************************************************************************
76  std::string file_;
77  std::string function_;
78 
79  //**********************************************************************************************
80 
81  //**Forbidden operations************************************************************************
84  void* operator new ( std::size_t ) /*throw( std::bad_alloc )*/;
85  void* operator new[]( std::size_t ) /*throw( std::bad_alloc )*/;
86  void* operator new ( std::size_t, const std::nothrow_t& ) /*throw()*/;
87  void* operator new[]( std::size_t, const std::nothrow_t& ) /*throw()*/;
88 
89  void operator delete ( void* ) /*throw()*/;
90  void operator delete[]( void* ) /*throw()*/;
91  void operator delete ( void*, const std::nothrow_t& ) /*throw()*/;
92  void operator delete[]( void*, const std::nothrow_t& ) /*throw()*/;
94  //**********************************************************************************************
95 };
96 //*************************************************************************************************
97 
98 
99 
100 
101 //=================================================================================================
102 //
103 // BLAZE_FUNCTION_TRACE MACRO
104 //
105 //=================================================================================================
106 
107 //*************************************************************************************************
140 #if BLAZE_USE_FUNCTION_TRACES
141 # define BLAZE_FUNCTION_TRACE \
142  blaze::logging::FunctionTrace BLAZE_FUNCTION_TRACE_OBJECT( __FILE__, BLAZE_SIGNATURE )
143 #else
144 # define BLAZE_FUNCTION_TRACE
145 #endif
146 //*************************************************************************************************
147 
148 } // namespace logging
149 
150 } // namespace blaze
151 
152 #endif