#pragma once #include #include #include #include "DataManagerGlobal.h" class DATAMANAGER_DLL_API_EXPORTS InterpreterBase { /// /// 整理过后的命令行 /// public: std::string cmd; /// /// 输出字符串 /// std::string Output; // 新增 by czb 20170106 /// /// 重定向命令, /// std::string RedirectCmd; // 新增 by czb 20170501 /// /// 上一命令行 /// std::string PrevCommandLine = ""; // 20180101 modified by czb, curStr修改为PrevCommandLine(上一命令行),当前命令行用commandLines[0]获得 /// /// 当不执行AddObj但需要重绘图形区时,此项须设为true. /// bool Update3D = false; bool Fit3D = false; /// /// 最终执行的Interpreter(命令解析过程中可能重定向到新的Interpreter) /// std::shared_ptr ReturnInterpreter = nullptr; InterpreterBase(); virtual void ExecuteCommand(std::vector &commandLines); protected: // template // void RedirectExecuteCommand(std::vector &commandLines) // { // // protected List RedirectExecuteCommand(string data) where T : InterpreterBase // std::shared_ptr intp = std::dynamic_pointer_cast(Activator::CreateInstance(typeid(T))); // this->ReturnInterpreter = intp; // intp->ExecuteCommand(commandLines); // } void LineDone(std::vector &commandLines); /// /// 输出到Output成员 /// /// void OnOutput(const std::string &text); // 20170106 by czb };