Changeset 843


Ignore:
Timestamp:
06/12/01 13:08:58 (24 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
8 edited

Legend:

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

    r752 r843  
    2929
    3030#pragma link C++ class MReadTree;
     31#pragma link C++ class MWriteAsciiFile;
    3132
    3233#pragma link C++ class MArray;
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r752 r843  
    5454
    5555#include "MLog.h"
     56#include "MLogManip.h"
     57
    5658#include "MParList.h"
    5759#include "MTaskList.h"
     
    8789    if (!fParList)
    8890    {
    89         *fLog << "MEvtLoop::Eventloop - Error: Parlist not initialized." << endl;
     91        *fLog << dbginf << "Parlist not initialized." << endl;
    9092        return kFALSE;
    9193    }
     
    98100    if (!fTaskList)
    99101    {
    100         *fLog << "MEvtLoop::Eventloop - Error: Cannot find tasklist '" << tlist << "' in parameter list." << endl;
     102        *fLog << dbginf << "Cannot find tasklist '" << tlist << "' in parameter list." << endl;
    101103        return kFALSE;
    102104    }
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r752 r843  
    5353    *fName = *(named.fName);
    5454    *fTitle = *(named.fTitle);
     55
     56    fLog = named.fLog;
     57
     58    fHasChanged = named.fHasChanged;
    5559}
    5660
     
    6569        *fName  = *(rhs.fName);
    6670        *fTitle = *(rhs.fTitle);
     71        fLog    = rhs.fLog;
     72        fHasChanged = rhs.fHasChanged;
    6773    }
    6874    return *this;
     
    8995    *(((MParContainer&)obj).fName)  = *fName;
    9096    *(((MParContainer&)obj).fTitle) = *fTitle;
     97    ((MParContainer&)obj).fLog   = fLog;
     98    ((MParContainer&)obj).fHasChanged = fHasChanged;
    9199}
    92100
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r609 r843  
    3535
    3636protected:
    37     MLog    *fLog;    //! The general log facility for this object, initialized with the global object
     37    MLog    *fLog;        //! The general log facility for this object, initialized with the global object
    3838
    39     TString *fName;   //! parameter container identifier (name)
    40     TString *fTitle;  //! parameter container title
     39    TString *fName;       //! parameter container identifier (name)
     40    TString *fTitle;      //! parameter container title
     41
     42    Bool_t   fHasChanged; //! should be set to true if the contents of the container is changed somehow
    4143
    4244public:
    43     MParContainer(const char *name="", const char *title="") : fLog(&gLog) { Init(name, title); }
    44     MParContainer(const TString &name, const TString &title) : fLog(&gLog) { Init(name, title); }
     45    MParContainer(const char *name="", const char *title="") : fLog(&gLog), fHasChanged(kFALSE) { Init(name, title); }
     46    MParContainer(const TString &name, const TString &title) : fLog(&gLog), fHasChanged(kFALSE) { Init(name, title); }
    4547    MParContainer(const MParContainer &named);
    4648    MParContainer& operator=(const MParContainer& rhs);
     
    6567    virtual Int_t    Sizeof() const;
    6668
     69    virtual void     Reset() {};
     70
     71    virtual Bool_t HasChanged() { return fHasChanged; }
     72    virtual void   SetHasChanged(Bool_t flag=kTRUE) { fHasChanged=flag; }
     73
    6774    virtual void AsciiRead(ifstream &fin) {};
    6875    virtual void AsciiWrite(ofstream &fout) const {};
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r754 r843  
    251251void MParList::Print(Option_t *t)
    252252{
    253   *fLog << dbginf << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
    254   *fLog << endl;
    255  
    256 }
    257 
     253    *fLog << dbginf << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
     254    *fLog << endl;
     255}
     256
     257// --------------------------------------------------------------------------
     258//
     259//   Sets the flags off all containers in the list (and the list
     260//   itself) to unchanged
     261//
     262void MParList::SetHasChanged(Bool_t flag)
     263{
     264    TIter Next(&fContainer);
     265
     266    MParContainer *cont=NULL;
     267
     268    //
     269    // loop over all tasks for preproccesing
     270    //
     271    while ( (cont=(MParContainer*)Next()) )
     272        cont->SetHasChanged(flag);
     273
     274    MParContainer::SetHasChanged(flag);
     275}
     276
     277void MParList::Reset()
     278{
     279    return;
     280    TIter Next(&fContainer);
     281
     282    MParContainer *cont=NULL;
     283
     284    //
     285    // loop over all tasks for preproccesing
     286    //
     287    while ( (cont=(MParContainer*)Next()) )
     288        cont->Reset();
     289}
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r749 r843  
    4444    MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
    4545
     46    void Reset();
     47    void SetHasChanged(Bool_t flag=kTRUE);
     48
    4649    void Print(Option_t *t = NULL);
    4750
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r752 r843  
    135135    *fLog << "Preprocessing... " << flush;
    136136
     137    fParList = pList;
     138
    137139    //
    138140    //  create the Iterator over the tasklist
     
    149151        *fLog << task->GetName() << "... " << flush;
    150152
    151         if (!task->PreProcess( pList ))
     153        if (!task->PreProcess(fParList))
    152154            return kFALSE;
    153155    }
     
    164166Bool_t MTaskList::Process()
    165167{
     168    //
     169    // Reset the HasChanged flag.
     170    // Reset all containers.
     171    //
     172    fParList->SetHasChanged(kFALSE);
     173    fParList->Reset();
     174
    166175    //
    167176    //  create the Iterator for the TaskList
     
    218227    *fLog << "Postprocessing... " << flush;
    219228
     229    // FIXME: At the moment all containers are post processed independ of
     230    // whether it was preprocessed or not.
     231
    220232    //
    221233    //  create the Iterator for the TaskList
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r698 r843  
    2525private:
    2626    TOrdCollection fTasks;      // Container for the ordered list of different tasks
     27    MParList      *fParList;
    2728
    2829public:
Note: See TracChangeset for help on using the changeset viewer.