5#ifndef GKO_PUBLIC_CORE_BASE_NAME_DEMANGLING_HPP_
6#define GKO_PUBLIC_CORE_BASE_NAME_DEMANGLING_HPP_
9#include <ginkgo/config.hpp>
12#ifdef GKO_HAVE_CXXABI_H
31inline std::string get_type_name(
const std::type_info& tinfo)
33#ifdef GKO_HAVE_CXXABI_H
35 const std::string name(
36 std::unique_ptr<
char[],
void (*)(
void*)>(
37 abi::__cxa_demangle(tinfo.name(),
nullptr,
nullptr, &status),
44 return std::string(tinfo.name());
59 return get_type_name(
typeid(T));
74 return get_type_name(
typeid(t));
82std::string get_enclosing_scope(
const T&)
84 auto name = get_type_name(
typeid(T));
85 auto found = name.rfind(
':');
86 if (found == std::string::npos) {
89 return name.substr(0, found - 1);
109#define GKO_FUNCTION_NAME gko::name_demangling::get_enclosing_scope([] {})
The name demangling namespace.
Definition name_demangling.hpp:28
std::string get_static_type(const T &)
This function uses name demangling facilities to get the name of the static type (T) of the object pa...
Definition name_demangling.hpp:57
std::string get_dynamic_type(const T &t)
This function uses name demangling facilities to get the name of the dynamic type of the object passe...
Definition name_demangling.hpp:72
The Ginkgo namespace.
Definition abstract_factory.hpp:20