Ignore:
Timestamp:
07/06/01 14:31:04 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
4 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r852 r858  
    2424#pragma link C++ class MParList;
    2525
     26#pragma link C++ class MFilter;
     27#pragma link C++ class MFilterList;
     28
    2629#pragma link C++ class MEvtLoop;
    2730
  • trunk/MagicSoft/Mars/mbase/MArray.cc

    r749 r858  
    3838#include "MArray.h"
    3939
    40 ClassImp(MArray)
     40ClassImp(MArray);
    4141
  • trunk/MagicSoft/Mars/mbase/MArrayB.cc

    r749 r858  
    1919#include "MArrayB.h"
    2020
    21 ClassImp(MArrayB)
     21ClassImp(MArrayB);
    2222
  • trunk/MagicSoft/Mars/mbase/MArrayS.cc

    r749 r858  
    3535#include "MArrayS.h"
    3636
    37 ClassImp(MArrayS)
     37ClassImp(MArrayS);
    3838
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r852 r858  
    5959#include "MTaskList.h"
    6060
    61 ClassImp(MEvtLoop)
     61ClassImp(MEvtLoop);
    6262
    6363// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r752 r858  
    4848#include "MLogManip.h"
    4949
    50 ClassImp(MLog)
     50ClassImp(MLog);
    5151
    5252//
     
    108108    AllocateFile(fname);
    109109    CheckFlag(eFile, flag);
     110}
     111
     112// --------------------------------------------------------------------------
     113//
     114// copyt constructor
     115//
     116MLog::MLog(MLog &log)
     117{
     118    fOutputLevel  = log.fOutputLevel;
     119    fDebugLevel   = log.fDebugLevel;
     120    fDevice       = log.fDevice;
    110121}
    111122
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r765 r858  
    5151    MLog(const char *fname, int flag=-1);
    5252
    53     MLog(MLog &log) { }
     53    MLog(MLog &log);
    5454
    5555    ~MLog()
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r855 r858  
    4848    MParContainer& operator=(const MParContainer& rhs);
    4949
    50     void SetLogStream(MLog *log) { fLog = log; }
     50    void SetLogStream(MLog *lg) { fLog = lg; }
    5151
    5252    virtual ~MParContainer() {
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r855 r858  
    4747#include "MLogManip.h"
    4848
    49 ClassImp(MParList)
     49ClassImp(MParList);
    5050
    5151// --------------------------------------------------------------------------
     
    144144TObject *MParList::FindObject(const char *name) const
    145145{
    146     return (TObject*)fContainer.FindObject(name);
     146    return fContainer.FindObject(name);
     147}
     148
     149// --------------------------------------------------------------------------
     150//
     151//  check if the object is in the list or not
     152//
     153TObject *MParList::FindObject(TObject *obj) const
     154{
     155    return fContainer.FindObject(obj);
    147156}
    148157
     
    282291void MParList::Reset()
    283292{
    284     return;
    285293    TIter Next(&fContainer);
    286294
     
    290298    // loop over all tasks for preproccesing
    291299    //
    292     while ( (cont=(MParContainer*)Next()) )
     300    while ((cont=(MParContainer*)Next()))
    293301        cont->Reset();
    294302}
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r855 r858  
    4242
    4343    TObject       *FindObject(const char *name) const;
     44    TObject       *FindObject(TObject *obj) const;
    4445    MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
    4546
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r855 r858  
    5555#include "MParList.h"
    5656
    57 ClassImp(MReadTree)
     57ClassImp(MReadTree);
    5858
    5959// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r752 r858  
    6161#include "MTask.h"
    6262
    63 ClassImp(MTask)
     63ClassImp(MTask);
    6464
    6565// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r698 r858  
    1414#endif
    1515
     16class MFilter;
    1617class MParList;
    1718
    1819class MTask : public MInputStreamID
    1920{
     21private:
     22    const MFilter *fFilter;
     23
    2024public:
     25    MTask() : fFilter(NULL) {}
    2126    ~MTask()
    2227    {
    2328    }
     29
     30    const MFilter *GetFilter() const { return fFilter; }
     31    void SetFilter(const MFilter *filter) { fFilter=filter; }
    2432
    2533    virtual Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r855 r858  
    3434
    3535#include "MLog.h"
     36#include "MLogManip.h"
     37#include "MFilter.h"
    3638#include "MParList.h"
    3739#include "MInputStreamID.h"
    3840
    39 ClassImp(MTaskList)
     41ClassImp(MTaskList);
    4042
    4143// --------------------------------------------------------------------------
     
    7981    // loop over all tasks for preproccesing
    8082    //
    81     while ( (task=(MTask*)Next()) )
     83    while ((task=(MTask*)Next()))
    8284        task->SetLogStream(log);
    8385
     
    102104    if (fTasks.FindObject(task))
    103105    {
    104         *fLog << "WARNING: MTaskList::AddToList: Task already existing." << endl;
     106        *fLog << dbginf << "Task already existing." << endl;
    105107        return kTRUE;
    106108    }
     
    108110    if (fTasks.FindObject(name))
    109111    {
    110         *fLog << "WARNING: MTaskList::AddToList: '" << name << "' exists in List already." << endl;
     112        *fLog << dbginf << "'" << name << "' exists in List already." << endl;
    111113        return kTRUE;
    112114    }
     
    116118        if (!fTasks.FindObject(where))
    117119        {
    118             printf("ERROR: MTaskList::AddToList: Cannot find task after which the new task should be scheduled!\n");
     120            *fLog << dbginf << "Cannot find task after which the new task should be scheduled!" << endl;
    119121            return kFALSE;
    120122        }
     
    135137// do pre processing (before eventloop) of all tasks in the task-list
    136138//
    137 Bool_t MTaskList::PreProcess( MParList *pList )
     139Bool_t MTaskList::PreProcess(MParList *pList)
    138140{
    139141    *fLog << "Preprocessing... " << flush;
     
    199201
    200202        //
     203        // Check for the existance of a filter. If a filter is existing
     204        // check for its value. If the value is kFALSE don't execute
     205        // this task.
     206        //
     207        const MFilter *filter = task->GetFilter();
     208
     209        const Bool_t rc = filter ? filter->IsExpressionTrue() : kTRUE;
     210
     211        if (!rc)
     212            continue;
     213
     214        //
    201215        // if it has the right stream id execute the Process() function
    202216        // and check what the result of it is.
     
    273287void MTaskList::Print(Option_t *t)
    274288{
    275   *fLog << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
    276  
    277   fTasks.Print();
    278 
    279   *fLog << endl;
    280 }
    281 
     289    *fLog << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" << endl;
     290
     291    fTasks.Print();
     292
     293    *fLog << endl;
     294}
     295
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r843 r858  
    4040    Bool_t PostProcess();
    4141
    42     void Print(Option_t *t = NULL);
     42    void Print(Option_t *opt = "");
    4343
    4444    ClassDef(MTaskList, 0)      //collection of tasks to be performed in the eventloop
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r749 r858  
    3737#include "MLog.h"
    3838
    39 ClassImp(MTime)
     39ClassImp(MTime);
    4040
    4141void MTime::Print(Option_t *)
  • trunk/MagicSoft/Mars/mbase/MWriteAsciiFile.cc

    r855 r858  
    4646#include "MParList.h"
    4747
    48 ClassImp(MWriteAsciiFile)
     48ClassImp(MWriteAsciiFile);
    4949
    5050// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MWriteFile.cc

    r852 r858  
    4444#include "MParList.h"
    4545
    46 ClassImp(MWriteFile)
     46ClassImp(MWriteFile);
    4747
    4848// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc

    r855 r858  
    4343#include "MParList.h"
    4444
    45 ClassImp(MWriteRootFile)
     45ClassImp(MWriteRootFile);
    4646
    4747// --------------------------------------------------------------------------
  • trunk/MagicSoft/Mars/mbase/Makefile

    r852 r858  
    3535           MParContainer.cc \
    3636           MParList.cc \
     37           MFilter.cc \
     38           MFilterList.cc \
    3739           MInputStreamID.cc \
    3840           MEvtLoop.cc \
Note: See TracChangeset for help on using the changeset viewer.