2222#include " emmy_debugger/transporter/transporter.h"
2323#include " emmy_debugger/api/lua_api.h"
2424#include " emmy_debugger/debugger/emmy_debugger_manager.h"
25+ #include " proto/proto_handler.h"
2526
2627enum class LogType
2728{
@@ -61,14 +62,13 @@ class EmmyFacade
6162 int OnConnect (bool suc);
6263 int OnDisconnect ();
6364 void WaitIDE (bool force = false , int timeout = 0 );
64- void OnReceiveMessage (const nlohmann::json document);
6565 bool OnBreak (std::shared_ptr<Debugger> debugger);
6666 void Destroy ();
6767 void OnEvalResult (std::shared_ptr<EvalContext> context);
6868 void SendLog (LogType type, const char * fmt, ...);
6969 void OnLuaStateGC (lua_State* L);
7070 void Hook (lua_State* L, lua_Debug* ar);
71- std::shared_ptr< EmmyDebuggerManager> GetDebugManager () const ;
71+ EmmyDebuggerManager& GetDebugManager ();
7272
7373 std::shared_ptr<Debugger> GetDebugger (lua_State* L);
7474
@@ -82,17 +82,19 @@ class EmmyFacade
8282
8383 void SetWorkMode (WorkMode mode);
8484 WorkMode GetWorkMode ();
85+
86+ void InitReq (InitParams ¶ms);
87+
88+ void ReadyReq ();
89+
90+ void OnReceiveMessage (nlohmann::json document);
91+
92+ // void Remove
93+
8594 // Start hook 作为成员存在
8695 std::function<void ()> StartHook;
8796
8897private:
89- void OnInitReq (const nlohmann::json document);
90- void OnReadyReq (const nlohmann::json document);
91- void OnAddBreakPointReq (const nlohmann::json document);
92- void OnRemoveBreakPointReq (const nlohmann::json document);
93- void OnActionReq (const nlohmann::json document);
94- void OnEvalReq (const nlohmann::json document);
95-
9698 std::mutex waitIDEMutex;
9799 std::condition_variable waitIDECV;
98100
@@ -103,12 +105,14 @@ class EmmyFacade
103105 bool isWaitingForIDE;
104106 WorkMode workMode;
105107
106- std::shared_ptr<EmmyDebuggerManager> emmyDebuggerManager;
107-
108108 // 表示使用了tcplisten tcpConnect 的states
109109 std::set<lua_State*> mainStates;
110110
111111 std::atomic<bool > readyHook;
112+
113+ ProtoHandler _protoHandler;
114+
115+ EmmyDebuggerManager _emmyDebuggerManager;
112116};
113117
114118
0 commit comments