39 :
TNamed(name, title), fServer(0)
74 if (str) Send(str, strlen(str));
91 if (!fReady || !fCanv)
return;
109 while ((m = (
TMethod *)iter()) != 0) {
110 if (cnt++ > 0) buf.
Append(
",");
118 }
else if (strncmp(m->
GetName(),
"Set", 3) == 0) {
121 getter =
TString(
"Has") + getter;
123 getter =
TString(
"Get") + getter;
125 getter =
TString(
"Is") + getter;
141 printf(
"Cannot get toggle value with getter %s \n", getter.
Data());
154 }
else if (fModified) {
173 const char *cdata = (
const char *)arg->
GetPostData();
175 if (strncmp(cdata,
"READY", 5) == 0) {
181 if (strncmp(cdata,
"GETMENU", 7) == 0) {
187 if (strncmp(cdata,
"EXEC", 4) == 0) {
192 exec.
Form(
"((%s*) %p)->%s;", fCanv->ClassName(), fCanv, cdata + 4);
194 gROOT->ProcessLine(exec);
209 fCanv->Disconnect(
"Modified()",
this,
"CanvasModified()");
210 fCanv->GetListOfPrimitives()->Remove(
this);
216 canv->
Connect(
"Modified()",
"THttpWSEngine",
this,
"CanvasModified()");
virtual const char * GetName() const
Returns name of object.
TList * GetListOfPrimitives() const
virtual void SetName(const char *name)
Set the name of the TNamed.
virtual const char * Getter() const
virtual void ProcessData(THttpCallArg *arg)
process data received from the client
static const EReturnType kLong
void * GetPostData() const
return pointer on posted with request data
virtual void AssignCanvas(TCanvas *canv)
assign canvas to the web socket connects with CanvasModified signal
TMethod * GetMethodAllAny(const char *method)
Return pointer to method without looking at parameters.
virtual ~THttpEngine()
destructor
virtual void SendCharStar(const char *str)
Envelope for sending string via the websocket.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
The TNamed class is the base class for all named ROOT classes.
TString & Append(const char *cs)
Method or function calling interface.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
THttpServer * fServer
! object server
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
void CheckModifiedFlag()
if canvas was modified, send new copy to the client
The ROOT global object gROOT contains a list of all defined classes.
static TString ConvertToJSON(const TObject *obj, Int_t compact=0, const char *member_name=0)
Converts object, inherited from TObject class, to JSON string Lower digit of compact parameter define...
EMenuItemKind IsMenuItem() const
virtual void CanvasModified()
react on canvas modifications
virtual ~THttpWSEngine()
destructor
virtual void Add(TObject *obj)
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
Each ROOT class (see TClass) has a linked list of methods.
void GetMenuItems(TList *listitems)
Returns list of methods accessible by context menu.
Long_t GetPostDataLength() const
return length of posted with request data
EReturnType ReturnType()
Returns the return type of the method.
virtual const char * GetTitle() const
Returns title of object.
const char * Data() const