Client program which allows the snooping of objects from a spyserv process.
class Spy {
private:
public:
Spy();
~Spy();
void Connect();
void DoButton();
};
void Spy::DoButton()
{
return;
case 1:
break;
case 2:
fSock->
Send(
"get hpxpy");
break;
case 3:
fSock->
Send(
"get hprof");
break;
}
if (fSock->
Recv(mess) <= 0) {
Error(
"Spy::DoButton",
"error receiving message");
return;
}
if (fHist) delete fHist;
else
}
delete mess;
}
void Spy::Connect()
{
fSock =
new TSocket(
"localhost", 9090);
}
Spy::Spy()
{
fMain->AddFrame(fCanvas, fLcan);
fMain->AddFrame(fHorz, fLhorz);
fHpx->
Connect(
"Clicked()",
"Spy",
this,
"DoButton()");
fHpxpy->
Connect(
"Clicked()",
"Spy",
this,
"DoButton()");
fHprof->
Connect(
"Clicked()",
"Spy",
this,
"DoButton()");
fMain->AddFrame(fHorz2, fLhorz);
fConnect->
Connect(
"Clicked()",
"Spy",
this,
"Connect()");
fMain->SetWindowName("Spy on SpyServ");
fMain->MapSubwindows();
fMain->Resize(fMain->GetDefaultSize());
fMain->MapWindow();
fHist = 0;
}
Spy::~Spy()
{
delete fHist;
delete fSock;
delete fLbut;
delete fLhorz;
delete fLcan;
delete fHpx;
delete fHpxpy;
delete fHprof;
delete fConnect;
delete fQuit;
delete fHorz;
delete fHorz2;
delete fCanvas;
delete fMain;
}
void spy()
{
new Spy;
}
#define RQ_OBJECT(sender_class)
void Error(const char *location, const char *msgfmt,...)
R__EXTERN void * gTQSender
TObject * ReadObject(const TClass *cl) override
Read object from I/O buffer.
virtual void Update()
Update canvas pad buffers.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void Draw(Option_t *option="")
Draw this histogram with options.
TClass * GetClass() const
void Modified(Bool_t flag=1)
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.
TCanvas * GetCanvas() const
virtual Int_t Recv(TMessage *&mess)
Receive a TMessage object.
virtual Bool_t IsValid() const
virtual Int_t Send(const TMessage &mess)
Send a TMessage object.