85 TSocket *sock = (TSocket *) arg;
86 TMessage message(kMESS_OBJECT);
91 int rd = sock->Recv(request,
sizeof(request));
100 printf(
"Request %s\n", request);
102 if (strcmp(request,
"GetListOfFolders") == 0) {
107 if (folder == NULL) {
108 message.Reset(kMESS_OBJECT);
109 message.WriteObject(NULL);
116 TObjArray *names =
new TObjArray(100);
118 TCollection *folders = folder->GetListOfFolders();
119 TIterator *iterFolders = folders->MakeIterator();
120 while ((obj = iterFolders->Next()) != NULL)
121 names->Add(
new TObjString(obj->GetName()));
124 message.Reset(kMESS_OBJECT);
125 message.WriteObject(names);
128 for (
int i = 0; i < names->GetLast() + 1; i++)
129 delete(TObjString *) names->At(i);
133 }
else if (strncmp(request,
"FindObject", 10) == 0) {
141 if (strncmp(request + 10,
"Any", 3) == 0)
142 obj = folder->FindObjectAny(request + 14);
144 obj = folder->FindObject(request + 11);
150 message.Reset(kMESS_OBJECT);
151 message.WriteObject(obj);
157 }
else if (strncmp(request,
"FindFullPathName", 16) == 0) {
164 const char *path = folder->FindFullPathName(request + 17);
170 TObjString *obj =
new TObjString(path);
171 message.Reset(kMESS_OBJECT);
172 message.WriteObject(obj);
178 }
else if (strncmp(request,
"GetPointer", 10) == 0) {
182 TObject *obj = gROOT->FindObjectAny(request + 11);
185 message.Reset(kMESS_ANY);
189 const char* name = obj->GetName();
199 printf(
"give %d for \'%s\'\n", p, name);
205 }
else if (strncmp(request,
"Command", 7) == 0) {
206 char objName[100], method[100];
207 sock->Recv(objName,
sizeof(objName));
208 sock->Recv(method,
sizeof(method));
212 TObject *
object = gROOT->FindObjectAny(objName);
213 if (
object && object->InheritsFrom(TH1::Class())
214 && strcmp(method,
"Reset") == 0)
215 static_cast < TH1 *
>(object)->Reset();
217 }
else if (strncmp(request,
"SetCut", 6) == 0) {
221 sock->Recv(name,
sizeof(name));
229 TCutG *newc = ((TCutG *) m->ReadObject(m->GetClass()));
232 fprintf(stderr,
"root server thread: changing cut %s\n", newc->GetName());
233 newc->TAttMarker::Copy(*cut);
234 newc->TAttFill::Copy(*cut);
235 newc->TAttLine::Copy(*cut);
236 newc->TNamed::Copy(*cut);
237 cut->Set(newc->GetN());
238 for (
int i = 0; i < cut->GetN(); ++i) {
239 cut->SetPoint(i, newc->GetX()[i], newc->GetY()[i]);
242 fprintf(stderr,
"root server thread: ignoring receipt of unknown cut \'%s\'\n",
248 fprintf(stderr,
"midasServer: Received unknown request \"%s\"\n", request);