DebuggerServlet.h
Go to the documentation of this file.
1 
20 #ifndef DEBUGGERSERVLET_H_ATUMDA3G
21 #define DEBUGGERSERVLET_H_ATUMDA3G
22 
23 #include "uscxml/Common.h"
26 
27 #include "uscxml/debug/Debugger.h"
28 
29 namespace uscxml {
30 
31 class USCXML_API DebuggerServlet : public Debugger, public HTTPServlet {
32 public:
33  virtual ~DebuggerServlet() {}
34 
35  // from Debugger
36  virtual void addBreakpoint(const Breakpoint& breakpoint) {};
37 
38  bool isCORS(const HTTPServer::Request& request);
39  void handleCORS(const HTTPServer::Request& request);
40 
41  bool requestFromHTTP(const HTTPServer::Request& request);
42  void setURL(const std::string& url) {
43  _url = url;
44  }
45 
46  void pushData(std::shared_ptr<DebugSession> session, Data pushData);
47  void returnData(const HTTPServer::Request& request, Data replyData);
48 
49  void processDisconnect(const HTTPServer::Request& request);
50  void processConnect(const HTTPServer::Request& request);
51  void processListSessions(const HTTPServer::Request& request);
52 
53  void processIssues(const HTTPServer::Request& request);
54 
55 // void processDebugPrepare(const HTTPServer::Request& request);
56 // void processDebugAttach(const HTTPServer::Request& request);
57 // void processDebugStart(const HTTPServer::Request& request);
58 // void processDebugStop(const HTTPServer::Request& request);
59 
60 // void processDebugEval(const HTTPServer::Request& request);
61 // void processDebugStart(const HTTPServer::Request& request);
62 // void processDebugStop(const HTTPServer::Request& request);
63 // void processDebugStep(const HTTPServer::Request& request);
64 // void processDebugResume(const HTTPServer::Request& request);
65 // void processDebugPause(const HTTPServer::Request& request);
66 // void processAddBreakPoint(const HTTPServer::Request& request);
67 // void processRemoveBreakPoint(const HTTPServer::Request& request);
68 // void processPoll(const HTTPServer::Request& request);
69 
70 
71 protected:
72  void serverPushData(std::shared_ptr<DebugSession>);
73 
74  std::string _url;
75  std::map<std::shared_ptr<DebugSession>, HTTPServer::Request> _clientConns;
76  std::map<std::shared_ptr<DebugSession>, BlockingQueue<Data> > _sendQueues;
77  std::map<std::string, std::shared_ptr<DebugSession> > _sessionForId;
78 
79  std::recursive_mutex _mutex;
80 };
81 
82 }
83 
84 #endif /* end of include guard: DEBUGGERSERVLET_H_ATUMDA3G */
Definition: Breakpoint.cpp:26
Definition: BlockingQueue.h:30
Definition: HTTPServer.h:47
Definition: DebuggerServlet.h:31
Definition: HTTPServer.h:200
Definition: Breakpoint.h:36
Definition: Debugger.h:32
Definition: Data.h:44