Logo ROOT   6.08/07
Reference Guide
THttpEngine.h
Go to the documentation of this file.
1 // $Id$
2 // Author: Sergey Linev 21/12/2013
3 
4 #ifndef ROOT_THttpEngine
5 #define ROOT_THttpEngine
6 
7 #ifndef ROOT_TNamed
8 #include "TNamed.h"
9 #endif
10 
11 class THttpServer;
12 class THttpCallArg;
13 class TCanvas;
14 
15 
16 class THttpEngine : public TNamed {
17 protected:
18  friend class THttpServer;
19 
20  THttpServer *fServer; //! object server
21 
22  THttpEngine(const char *name, const char *title);
23 
24  void SetServer(THttpServer *serv)
25  {
26  fServer = serv;
27  }
28 
29  /** Method regularly called in main ROOT context */
30  virtual void Process() {}
31 
32 public:
33  virtual ~THttpEngine();
34 
35  /** Method to create all components of engine. Called once from by the server */
36  virtual Bool_t Create(const char *)
37  {
38  return kFALSE;
39  }
40 
42  {
43  return fServer;
44  }
45 
46  ClassDef(THttpEngine, 0) // abstract class which should provide http-based protocol for server
47 };
48 
49 // ====================================================================
50 
51 
52 class THttpWSEngine : public TNamed {
53 
54 protected:
55 
56  THttpWSEngine(const char* name, const char* title);
57 
58  Bool_t fReady; //! indicate if websocket get ready flag to send bigger amount of data
59  Bool_t fModified; //! true when canvas was modified
60  Bool_t fGetMenu; //! true when menu was requested
61  TCanvas* fCanv ; //! canvas associated with websocket
62 
63  void CheckModifiedFlag();
64 
65 public:
66  virtual ~THttpWSEngine();
67 
68  virtual void ClearHandle() = 0;
69 
70  virtual void Send(const void* buf, int len) = 0;
71 
72  virtual void ProcessData(THttpCallArg* arg);
73 
74  // --------- method to work with
75 
76  virtual void AssignCanvas(TCanvas* canv);
77 
78  virtual void CanvasModified();
79 
80  ClassDef(THttpWSEngine, 0) // abstract class for working with WebSockets-like protocol
81 };
82 
83 
84 #endif
virtual void Process()
Method regularly called in main ROOT context.
Definition: THttpEngine.h:30
Bool_t fReady
Definition: THttpEngine.h:58
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
void SetServer(THttpServer *serv)
Definition: THttpEngine.h:24
virtual ~THttpEngine()
destructor
Definition: THttpEngine.cxx:39
THttpServer * GetServer() const
Definition: THttpEngine.h:41
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
THttpEngine(const char *name, const char *title)
object server
Definition: THttpEngine.cxx:30
Bool_t fGetMenu
true when canvas was modified
Definition: THttpEngine.h:60
THttpServer * fServer
Definition: THttpEngine.h:20
virtual Bool_t Create(const char *)
Method to create all components of engine.
Definition: THttpEngine.h:36
TCanvas * fCanv
true when menu was requested
Definition: THttpEngine.h:61
The Canvas class.
Definition: TCanvas.h:41
Bool_t fModified
indicate if websocket get ready flag to send bigger amount of data
Definition: THttpEngine.h:59
char name[80]
Definition: TGX11.cxx:109