37 lines
816 B
C++
37 lines
816 B
C++
//
|
|
// Created by linbo on 2025/10/23.
|
|
//
|
|
|
|
#ifndef CMVR_ES_ABSTRACTCONTROLLER_H
|
|
#define CMVR_ES_ABSTRACTCONTROLLER_H
|
|
|
|
#include <curl/curl.h>
|
|
|
|
#include "rapidxml/xml_parser.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(std::string json) = 0;
|
|
|
|
virtual void stop() = 0;
|
|
|
|
private:
|
|
ControllerState state_;
|
|
};
|
|
}
|
|
|
|
#endif //CMVR_ES_ABSTRACTCONTROLLER_H
|