7#include "vtkCxxABIConfigure.h"
14#if VTK_HAS_ABI_NAMESPACE
15#define VTK_TYPENAME_STRINGIFY_INTERNAL(x) #x
16#define VTK_TYPENAME_STRINGIFY(x) VTK_TYPENAME_STRINGIFY_INTERNAL(x)
17#define VTK_ABI_NAMESPACE_STRING VTK_TYPENAME_STRINGIFY(VTK_ABI_NAMESPACE_NAME) "::"
24VTK_ABI_NAMESPACE_BEGIN
26template <
typename ObjectType>
29 inline static std::string
value()
31 std::string result =
typeid(ObjectType).name();
32#ifdef VTK_HAS_CXXABI_DEMANGLE
35 char* demangledSymbol = abi::__cxa_demangle(result.c_str(),
nullptr, &size, &status);
36 if (!status && size > 0)
38 result = demangledSymbol;
40 free(demangledSymbol);
45#ifdef VTK_COMPILER_MSVC
50 for (std::string::size_type pos = result.find(
"class "); pos != std::string::npos;
51 pos = result.find(
"class ", pos + 1))
53 result = result.substr(0, pos) + result.substr(pos + 6);
55 for (std::string::size_type pos = result.find(
"struct "); pos != std::string::npos;
56 pos = result.find(
"struct ", pos + 1))
58 result = result.substr(0, pos) + result.substr(pos + 7);
63 for (std::string::size_type pos = result.find(
"`anonymous namespace'");
64 pos != std::string::npos; pos = result.find(
"`anonymous namespace'", pos + 1))
66 result = result.substr(0, pos) +
"(anonymous namespace)" + result.substr(pos + 21);
70 for (std::string::size_type pos = result.find(
','); pos != std::string::npos;
71 pos = result.find(
',', pos + 1))
73 result = result.substr(0, pos) +
", " + result.substr(pos + 1);
79#if VTK_HAS_ABI_NAMESPACE
80 const std::size_t nsLen = std::strlen(VTK_ABI_NAMESPACE_STRING);
81 for (std::string::size_type pos = result.find(VTK_ABI_NAMESPACE_STRING);
82 pos != std::string::npos; pos = result.find(VTK_ABI_NAMESPACE_STRING, pos + 1))
84 result = result.substr(0, pos) + result.substr(pos + nsLen);
107VTK_ABI_NAMESPACE_BEGIN
115template <
typename ObjectType>
131template <
typename ObjectType>
Represent a string by its integer hash.
static constexpr Hash StringHash(const char *data, std::size_t size) noexcept
Return the hash of a string This is used internally but also by the ""_token() literal operator.
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
vtkStringToken TypeToken()
Return a string token holding a hash of the demangled type-name of the provided ObjectType.
std::string TypeName()
Return the demangled type-name of the provided ObjectType.
static vtkStringToken::Hash token()
Return an integer hash of the ObjectType's typename.
static std::string value()