jweinst1
1/17/2018 - 6:33 PM

base inheritance for dynamic object system in C++

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;
};