#pragma once #include "GlobalDefine.h" #include "SmartPtr.h" #include "ObjContainer.h" #include "ObjBase.h" class CCommandBase { public: CCommandBase(void); virtual ~CCommandBase(void); virtual CString GetStr() = 0; virtual void ExcuteExt(){}; virtual void UndoExt(){}; void Excute(); void Undo(); void AddOpObj(CObjBase *p); void AddOpObj(Sptr); bool HasOpObj(); void SetOperatePar(SObjOperatePar par){m_Par = par;}; protected: CObjContainer m_ObjContainer;//obj 对象容器管理对象 SObjOperatePar m_Par;//操作参数 };