33#ifndef GKO_PUBLIC_CORE_BASE_NAME_DEMANGLING_HPP_
34#define GKO_PUBLIC_CORE_BASE_NAME_DEMANGLING_HPP_
37#include <ginkgo/config.hpp>
40#ifdef GKO_HAVE_CXXABI_H
56namespace name_demangling {
59inline std::string get_type_name(
const std::type_info&
tinfo)
61#ifdef GKO_HAVE_CXXABI_H
63 const std::string name(
64 std::unique_ptr<
char[],
void (*)(
void*)>(
65 abi::__cxa_demangle(
tinfo.name(),
nullptr,
nullptr, &status),
72 return std::string(
tinfo.name());
87 return get_type_name(
typeid(
T));
102 return get_type_name(
typeid(t));
110std::string get_enclosing_scope(
const T&)
112 auto name = get_type_name(
typeid(
T));
113 auto found = name.rfind(
':');
114 if (
found == std::string::npos) {
117 return name.substr(0,
found - 1);
137#define GKO_FUNCTION_NAME gko::name_demangling::get_enclosing_scope([] {})
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:85
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:100
The Ginkgo namespace.
Definition abstract_factory.hpp:48
constexpr T one()
Returns the multiplicative identity for T.
Definition math.hpp:803