Fix export, which has been broken since the boost::signals2 changes. Also update...
[ardour.git] / libs / audiographer / audiographer / debug_utils.h
1 #ifndef AUDIOGRAPHER_DEBUG_UTILS_H
2 #define AUDIOGRAPHER_DEBUG_UTILS_H
3
4 #include "flag_field.h"
5
6 #include <string>
7
8 #ifdef __GNUC__
9 #include <cxxabi.h>
10 #endif
11
12 namespace AudioGrapher
13 {
14
15 /// Utilities for debugging
16 struct DebugUtils
17 {
18         /// Returns the demangled name of the object passed as the parameter
19         template<typename T>
20         static std::string demangled_name (T const & obj)
21         {
22 #ifdef __GNUC__
23                 int status;
24                 char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status);
25                 if (status == 0) {
26                         std::string s(res);
27                         free (res);
28                         return s;
29                 }
30 #endif
31                 return typeid(obj).name();
32         }
33         
34         /// Returns name of ProcessContext::Flag
35         static std::string process_context_flag_name (FlagField::Flag flag);
36 };
37
38 } // namespace
39
40 #endif // AUDIOGRAPHER_DEBUG_UTILS_H