23 static_assert(!std::is_pointer<T>::value,
24 "for pointers use forPointer() method");
47 std::string id()
const;
48 std::string name()
const;
49 std::type_index index()
const;
61 bool operator <(
const ClassInfo &info)
const
63 return info.index() < m_index;
66 bool operator ==(
const ClassInfo &info)
const
68 return info.index() == m_index;
71 bool operator !=(
const ClassInfo &info)
const
73 return info.index() != m_index;
76 static ClassInfo byName(
const std::string &name);
79 static void registerClass(
const std::string &name)
81 registerClassInfo(name,
typeid(T));
85 static std::string repr(
const T *t)
89 reinterpret_cast<const void *>(t));
93 static void registerClassInfo(
94 const std::string &name,
95 const std::type_info &info);
97 static std::string reprImpl(
const ClassInfo &c,
const void *p);
100 std::type_index m_index;
103 #define BEEEON_CLASS_REGISTER(T, name, reg) \
109 registerClass<T>(name); \
112 static reg reg##Register;
114 #define BEEEON_CLASS(T) \
117 BEEEON_CLASS_REGISTER(T, #T, Class##__COUNTER__)\
static ClassInfo forPointer(const T *t)
Definition: ClassInfo.h:33
bool is() const
Definition: ClassInfo.h:56
Definition: ClassInfo.h:9