// // Created by linbo on 2025/10/23. // #ifndef CMVR_ES_ABSTRACTCONTROLLER_H #define CMVR_ES_ABSTRACTCONTROLLER_H #include #include "rapidxml/xml_parser.h" #include "jsoncpp/json/json.h" namespace cmvr::device { enum ControllerState { ControllerState_Idle, //默认 ControllerState_Executing, //正在执行命令 ControllerState_Switching //命令被中断,正在切换 }; class AbstractController { public: explicit AbstractController(const XmlNode& cfg); virtual ~AbstractController(); [[nodiscard]] ControllerState getState() const {return state_;} virtual void call(const Json::Value& json) = 0; virtual void stop() = 0; protected: ControllerState state_; }; } #endif //CMVR_ES_ABSTRACTCONTROLLER_H