830911f6f9
git-svn-id: svn://localhost/ardour2/branches/3.0@6760 d708f5d6-7413-0410-9779-e7cbd77b26cf
41 lines
767 B
C++
41 lines
767 B
C++
#ifndef AUDIOGRAPHER_DEBUG_UTILS_H
|
|
#define AUDIOGRAPHER_DEBUG_UTILS_H
|
|
|
|
#include "flag_field.h"
|
|
|
|
#include <string>
|
|
|
|
#ifdef __GNUC__
|
|
#include <cxxabi.h>
|
|
#endif
|
|
|
|
namespace AudioGrapher
|
|
{
|
|
|
|
/// Utilities for debugging
|
|
struct DebugUtils
|
|
{
|
|
/// Returns the demangled name of the object passed as the parameter
|
|
template<typename T>
|
|
static std::string demangled_name (T const & obj)
|
|
{
|
|
#ifdef __GNUC__
|
|
int status;
|
|
char * res = abi::__cxa_demangle (typeid(obj).name(), 0, 0, &status);
|
|
if (status == 0) {
|
|
std::string s(res);
|
|
free (res);
|
|
return s;
|
|
}
|
|
#endif
|
|
return typeid(obj).name();
|
|
}
|
|
|
|
/// Returns name of ProcessContext::Flag
|
|
static std::string process_context_flag_name (FlagField::Flag flag);
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif // AUDIOGRAPHER_DEBUG_UTILS_H
|