Changeset 2015 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 04/28/03 09:52:57 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r2009 r2015 251 251 // Check System time (don't loose too much time by updates) 252 252 // 253 static TTime t0 = gSystem->Now(); 254 255 const TTime t1 = gSystem->Now(); 256 if (t1-t0 < (TTime)20) 253 254 // FIXME: Not thread safe 255 static Int_t start = num; 256 static TTime t1 = gSystem->Now(); 257 static TTime t2 = t1; 258 259 // 260 // No update < 20ms 261 // 262 const TTime t0 = gSystem->Now(); 263 if (t0-t1 < (TTime)20) 257 264 return rc; 258 259 t0 = t1; 265 t1 = t0; 266 267 // 268 // Update current speed each second 269 // 270 if (t0-t2 > (TTime)1000) 271 { 272 const Int_t speed = 1000*(num-start)/(long int)(t0-t2); 273 TString txt = "Processing..."; 274 if (speed>0) 275 { 276 txt += " ("; 277 txt += speed; 278 txt += "Evts/s)"; 279 } 280 fDisplay->SetStatusLine1(txt); 281 start = num; 282 t2 = t1; 283 } 260 284 261 285 // -
trunk/MagicSoft/Mars/mbase/MGGroupFrame.h
r1664 r2015 37 37 virtual Bool_t ProcessMessage(Long_t msg, Long_t param1, Long_t param2); 38 38 39 ClassDef(MGGroupFrame, 0) // A interface to widgets in a group frame (makes live easier)39 ClassDef(MGGroupFrame, 0) // An interface to widgets in a group frame (makes live easier) 40 40 }; 41 41 -
trunk/MagicSoft/Mars/mbase/MTask.cc
r1936 r2015 69 69 70 70 #include <fstream.h> 71 #include <TBaseClass.h> 71 72 72 73 #include "MLog.h" … … 317 318 out << " " << GetUniqueName() << ".SetFilter(&" << fFilter->GetUniqueName() <<");" << endl; 318 319 } 320 321 // -------------------------------------------------------------------------- 322 // 323 // Check whether the class given in the argument overwrites MTask::Process. 324 // This function calls itself recursively. If you want to call it, 325 // leave out the argument. 326 // 327 Bool_t MTask::OverwritesProcess(TClass *cls) const 328 { 329 if (!cls) 330 cls = IsA(); 331 332 // 333 // Check whether we reached the base class MTask 334 // 335 if (TString(cls->GetName())=="MTask") 336 return kFALSE; 337 338 // 339 // Check whether the class cls overwrites Process 340 // 341 if (cls->GetMethodAny("Process")) 342 return kTRUE; 343 344 // 345 // If the class itself doesn't overload it check all it's base classes 346 // 347 TBaseClass *base=NULL; 348 TIter NextBase(cls->GetListOfBases()); 349 while ((base=(TBaseClass*)NextBase())) 350 { 351 if (OverwritesProcess(base->GetClassPointer())) 352 return kTRUE; 353 } 354 355 return kFALSE; 356 } -
trunk/MagicSoft/Mars/mbase/MTask.h
r1661 r2015 80 80 const TList *GetListOfBranches() const { return fListOfBranches; } 81 81 82 Bool_t OverwritesProcess(TClass *cls=NULL) const; 83 82 84 void SavePrimitive(ofstream &out, Option_t *o=""); 83 85 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1965 r2015 60 60 61 61 #include <TClass.h> 62 #include <TBaseClass.h>63 62 #include <TOrdCollection.h> 64 63 … … 322 321 // -------------------------------------------------------------------------- 323 322 // 324 // Check whether this task (or one of it's base classes) overloads325 // MTask::Process. Only if this function is overloaded this task is326 // added to the fTaskProcess-List. This makes the execution of the327 // tasklist a little bit (only a little bit) faster, bacause tasks328 // doing no Processing are not Processed.329 //330 Bool_t MTaskList::CheckClassForProcess(TClass *cls)331 {332 //333 // Check whether the class itself overloads the Process function334 //335 if (cls->GetName()=="MTask")336 return kFALSE;337 338 if (cls->GetMethodAny("Process"))339 return kTRUE;340 341 //342 // If the class itself doesn't overload it check all it's base classes343 //344 TBaseClass *base=NULL;345 TIter NextBase(cls->GetListOfBases());346 while ((base=(TBaseClass*)NextBase()))347 {348 if (CheckClassForProcess(base->GetClassPointer()))349 return kTRUE;350 }351 352 return kFALSE;353 }354 355 // --------------------------------------------------------------------------356 //357 323 // do pre processing (before eventloop) of all tasks in the task-list 324 // Only if a task overwrites the Process function the task is 325 // added to the fTaskProcess-List. This makes the execution of the 326 // tasklist a little bit (only a little bit) faster, bacause tasks 327 // doing no Processing are not Processed. 358 328 // 359 329 Bool_t MTaskList::PreProcess(MParList *pList) … … 410 380 // 411 381 while ((task=(MTask*)Next())) 412 if ( CheckClassForProcess(task->IsA()))382 if (task->OverwritesProcess()) 413 383 fTasksProcess.Add(task); 414 384 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1965 r2015 31 31 32 32 void Remove(MTask *task); 33 Bool_t CheckClassForProcess(TClass *cls); 34 35 void StreamPrimitive(ofstream &out) const; 36 33 void StreamPrimitive(ofstream &out) const; 37 34 Bool_t CheckAddToList(MTask *task, const char *tType, const MTask *where=NULL) const; 38 35
Note:
See TracChangeset
for help on using the changeset viewer.