base inheritance for dynamic object system in C++
// Type class
struct LangType
{
enum Type
{
Type_int,
Type_add
};
};
// Base Object Class
class LangObject : LangType
{
public:
LangType::Type getType(void) const
{
return _type;
}
void setType(LangType::Type type)
{
_type = type;
}
private:
LangType::Type _type;
};