32 #ifndef TypInfo_INCLUDE_ONCE 33 #define TypInfo_INCLUDE_ONCE 52 const char* ptr =
name;
65 const char*
name()
const {
return mName; }
77 #define VL_GROUP(...) __VA_ARGS__ 78 #define VL_TO_STR(...) #__VA_ARGS__ 80 #define VL_INSTRUMENT_BASE_CLASS(ClassName) \ 84 static const char* Name() { return VL_TO_STR(ClassName); } \ 86 static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \ 90 virtual const char* className() const { return VL_TO_STR(ClassName); } \ 92 virtual const ::vl::TypeInfo& classType() const { return Type(); } \ 94 virtual bool isOfType(const ::vl::TypeInfo& type) const \ 96 return type == Type(); \ 101 #define VL_INSTRUMENT_ABSTRACT_BASE_CLASS(ClassName) \ 105 static const char* Name() { return VL_TO_STR(ClassName); } \ 107 static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \ 111 virtual const char* className() const { return VL_TO_STR(ClassName); } \ 113 virtual const ::vl::TypeInfo& classType() const { return Type(); } \ 115 virtual bool isOfType(const ::vl::TypeInfo& type) const \ 117 return type == Type(); \ 122 #define VL_INSTRUMENT_CLASS(ClassName, BaseClass) \ 124 typedef BaseClass super; \ 128 static const char* Name() { return VL_TO_STR(ClassName); } \ 130 static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \ 134 virtual const char* className() const { return VL_TO_STR(ClassName); } \ 136 virtual const ::vl::TypeInfo& classType() const { return Type(); } \ 138 virtual bool isOfType(const ::vl::TypeInfo& type) const \ 140 return type == Type() || super::isOfType(type); \ 145 #define VL_INSTRUMENT_ABSTRACT_CLASS(ClassName, BaseClass) \ 147 typedef BaseClass super; \ 151 static const char* Name() { return VL_TO_STR(ClassName); } \ 153 static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \ 157 virtual const char* className() const { return VL_TO_STR(ClassName); } \ 159 virtual const ::vl::TypeInfo& classType() const { return Type(); } \ 161 virtual bool isOfType(const ::vl::TypeInfo& type) const \ 163 return type == Type() || super::isOfType(type); \ 168 #define VL_INSTRUMENT_CLASS_2(ClassName, BaseClass1, BaseClass2) \ 170 typedef BaseClass1 super1; \ 171 typedef BaseClass2 super2; \ 175 static const char* Name() { return VL_TO_STR(ClassName); } \ 177 static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \ 181 virtual const char* className() const { return VL_TO_STR(ClassName); } \ 183 virtual const ::vl::TypeInfo& classType() const { return Type(); } \ 185 virtual bool isOfType(const ::vl::TypeInfo& type) const \ 187 return type == Type() || super1::isOfType(type) || super2::isOfType(type); \ 192 #define VL_INSTRUMENT_ABSTRACT_CLASS_2(ClassName, BaseClass1, BaseClass2) \ 194 typedef BaseClass1 super1; \ 195 typedef BaseClass2 super2; \ 199 static const char* Name() { return VL_TO_STR(ClassName); } \ 201 static const ::vl::TypeInfo& Type() { static const ::vl::TypeInfo class_type(VL_TO_STR(ClassName)); return class_type; } \ 205 virtual const char* className() const { return VL_TO_STR(ClassName); } \ 207 virtual const ::vl::TypeInfo& classType() const { return Type(); } \ 209 virtual bool isOfType(const ::vl::TypeInfo& type) const \ 211 return type == Type() || super1::isOfType(type) || super2::isOfType(type); \ 218 template<
class B,
class A>
221 if(obj && obj->isOfType(B::Type()))
222 return static_cast<B*>(obj);
227 template<
class B,
class A>
230 if(obj && obj->isOfType(B::Type()))
231 return static_cast<const B*>(obj);
TypeInfo(const char *name)
Constructor.
u32 hash() const
The 32 bit hash of the name of the class including the namespace.
Visualization Library main namespace.
unsigned int u32
32 bits unsigned integer
VLCORE_EXPORT void MurmurHash3_x86_32(const void *key, int len, u32 seed, void *out)
const B * cast_const(const A *obj)
bool operator<(const TypeInfo &other) const
Less operator.
bool operator==(const TypeInfo &other) const
Equal operator.
const char * name() const
The name of the class including the namespace.