blob: 8bd0f1c9b61ae266b3badfae2f21601d96d19d8a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#ifndef oo_ObjBase_H__
#define oo_ObjBase_H__
#include <typeinfo>
#include <string>
namespace meow{
class ObjBase{
protected:
ObjBase(){ }
public:
virtual ~ObjBase(){ }
//
virtual char const* ctype() const{
static char const* ptr = typeid(*this).name();
return ptr;
}
virtual std::string type() const{
return std::string(ctype());
}
//
static char const* ctypeBase(){
static char const* ptr = typeid(ObjBase).name();
return ptr;
}
static std::string typeBase(){
return std::string(ctypeBase());
}
};
}
#endif // oo_ObjBase_H__
|