Ignore:
Timestamp:
04/28/03 09:52:57 (22 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1965 r2015  
    6060
    6161#include <TClass.h>
    62 #include <TBaseClass.h>
    6362#include <TOrdCollection.h>
    6463
     
    322321// --------------------------------------------------------------------------
    323322//
    324 // Check whether this task (or one of it's base classes) overloads
    325 // MTask::Process. Only if this function is overloaded this task is
    326 // added to the fTaskProcess-List. This makes the execution of the
    327 // tasklist a little bit (only a little bit) faster, bacause tasks
    328 // 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 function
    334     //
    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 classes
    343     //
    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 //
    357323//  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.
    358328//
    359329Bool_t MTaskList::PreProcess(MParList *pList)
     
    410380    //
    411381    while ((task=(MTask*)Next()))
    412         if (CheckClassForProcess(task->IsA()))
     382        if (task->OverwritesProcess())
    413383            fTasksProcess.Add(task);
    414384
Note: See TracChangeset for help on using the changeset viewer.