5 #ifndef BALL_COMMON_RTTI_H
6 #define BALL_COMMON_RTTI_H
8 #ifndef BALL_CONFIG_CONFIG_H
9 # include <BALL/CONFIG/config.h>
26 namespace GNUDemangling
89 return static_cast<void*
>(
new T);
99 return typeid(T).name();
104 template <
typename T>
108 return (
void*)&dummy;
121 template <
typename T>
127 if ((
typeid(T) ==
typeid(
Size))
131 || (
typeid(T) ==
typeid(
Handle)))
135 if ((
typeid(T) ==
typeid(
Index))
139 return "BALL::Index";
141 if (
typeid(T) ==
typeid(::std::string))
143 return "::std::string";
147 return "BALL::LongSize";
149 if (
typeid(T) ==
typeid(
bool))
153 if (
typeid(T) ==
typeid(
float))
157 if (
typeid(T) ==
typeid(
char))
161 if (
typeid(T) ==
typeid(
unsigned char))
163 return "unsigned_char";
165 if (
typeid(T) ==
typeid(
double))
170 static bool is_set =
false;
191 template <
typename T,
typename U>
194 return (0 != dynamic_cast<const T*>(&u));
214 template <
typename T,
typename U>
217 return const_cast<T*
>(
dynamic_cast<const T*
>(&u));
225 template <
typename T,
typename U>
228 return (
typeid(u) ==
typeid(T));
234 #endif // BALL_COMMON_RTTI_H
const char * getStreamName()
bool isInstanceOf(const U &u)
bool isKindOf(const U &u)
BALL_ULONG64_TYPE LongSize
BALL_EXPORT string streamClassName(const std::type_info &t)