Changeset 752 for trunk/MagicSoft


Ignore:
Timestamp:
04/18/01 14:36:05 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 added
10 edited

Legend:

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

    r705 r752  
    3636#pragma link C++ class MTime;
    3737
     38#pragma link C++ class MHtml;
     39
    3840
    3941#endif
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r749 r752  
    5959ClassImp(MEvtLoop)
    6060
     61// --------------------------------------------------------------------------
     62//
     63// default constructor - emty
     64//
    6165MEvtLoop::MEvtLoop() : fParList(NULL)
    6266{
    6367}
    6468
     69// --------------------------------------------------------------------------
     70//
     71// default destructor - emty
     72//
    6573MEvtLoop::~MEvtLoop()
    6674{
    6775}
    6876
     77// --------------------------------------------------------------------------
     78//
     79// The proprocessing part of the eventloop. Be careful, this is
     80// for developers use only!
     81//
    6982Bool_t MEvtLoop::PreProcess(const char *tlist)
    7083{
    71     //
    72     // The proprocessing part of the eventloop. Be careful, this is
    73     // for developers use only!
    74     //
    75 
    7684    //
    7785    // check if the needed parameter list is set.
     
    116124}
    117125
     126// --------------------------------------------------------------------------
     127//
     128// The processing part of the eventloop. Be careful, this is
     129// for developers use only!
     130//
    118131void MEvtLoop::Process(Int_t maxcnt) const
    119132{
    120     //
    121     // The processing part of the eventloop. Be careful, this is
    122     // for developers use only!
    123     //
    124 
    125133    //
    126134    //   loop over all events and process all tasks for
     
    171179}
    172180
     181// --------------------------------------------------------------------------
     182//
     183//  The postprocessing part of the eventloop. Be careful, this is
     184//  for developers use only!
     185//
    173186void MEvtLoop::PostProcess() const
    174187{
    175188    //
    176     //  The postprocessing part of the eventloop. Be careful, this is
    177     //  for developers use only!
    178     //
    179 
    180     //
    181189    //  execute the post process of all tasks
    182190    //
     
    184192}
    185193
     194// --------------------------------------------------------------------------
     195//
     196// See class description above.
     197//
    186198void MEvtLoop::Eventloop(Int_t maxcnt, const char *tlist)
    187199{
    188     //
    189     // See class description above.
    190     //
    191200    if (!PreProcess(tlist))
    192201        return;
  • trunk/MagicSoft/Mars/mbase/MInputStreamID.cc

    r749 r752  
    3838ClassImp(MInputStreamID);
    3939
     40// --------------------------------------------------------------------------
     41//
     42// (default) constructor
     43//
    4044MInputStreamID::MInputStreamID(const char *name, const char *title)
    4145{
    42     //
    43     // (default) constructor
    44     //
    4546    *fName = name ? name : ClassName();
    4647    *fTitle = title;
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r749 r752  
    5555MLog gLog;
    5656
     57// --------------------------------------------------------------------------
     58//
     59// this strange usage of an unbufferd buffer is a workaround
     60// to make it work on Alpha and Linux!
     61//
    5762void MLog::Init()
    5863{
    59     //
    60     // this strange usage of an unbufferd buffer is a workaround
    61     // to make it work on Alpha and Linux!
    62     //
    6364    setp(&fBuffer, &fBuffer+1);
    6465    *this << '\0';
    6566}
    6667
     68// --------------------------------------------------------------------------
     69//
     70// default constructor which initializes the streamer and sets the device
     71// which is used for the output (i)
     72//
    6773MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fout(NULL), fOutAllocated(kFALSE), fgui(NULL)
    6874{
     
    7076}
    7177
     78// --------------------------------------------------------------------------
     79//
     80// default constructor which initializes the streamer and sets the given
     81// ofstream as the default output device
     82//
    7283MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fout(&out), fOutAllocated(kFALSE), fgui(NULL)
    7384{
     
    7586}
    7687
     88// --------------------------------------------------------------------------
     89//
     90// default constructor which initializes the streamer and sets the given
     91// TGListBox as the default output device
     92//
    7793MLog::MLog(TGListBox &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fout(NULL), fOutAllocated(kFALSE), fgui(&out)
    7894{
     
    8096}
    8197
     98// --------------------------------------------------------------------------
     99//
     100// default constructor which initializes the streamer and opens a file with
     101// the given name. Dependend on the flag the file is set as output device
     102// or not.
     103//
    82104MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fgui(NULL)
    83105{
     
    88110}
    89111
     112// --------------------------------------------------------------------------
     113//
     114// This is the function which writes the stream physically to a device.
     115// If you want to add a new device this must be done here.
     116//
    90117void MLog::WriteBuffer()
    91118{
     
    115142}
    116143
     144// --------------------------------------------------------------------------
     145//
     146// This is called to flush the buffer of the streaming devices
     147//
    117148int MLog::sync()
    118149{
     
    131162}
    132163
     164// --------------------------------------------------------------------------
     165//
     166// This function comes from streambuf and should
     167// output the buffer to the device (flush, endl)
     168// or handle a buffer overflow (too many chars)
     169// If a real overflow happens i contains the next
     170// chars which doesn't fit into the buffer anymore.
     171// If the buffer is not really filled i is EOF(-1).
     172//
    133173int MLog::overflow(int i) // i=EOF means not a real overflow
    134174{
    135     //
    136     // This function comes from streambuf and should
    137     // output the buffer to the device (flush, endl)
    138     // or handle a buffer overflow (too many chars)
    139     // If a real overflow happens i contains the next
    140     // chars which doesn't fit into the buffer anymore.
    141     // If the buffer is not really filled i is EOF(-1).
    142     //
    143175    if (fOutputLevel >= fDebugLevel)
    144176        return 0;
     
    152184}
    153185
     186// --------------------------------------------------------------------------
     187//
     188// Create a new instance of an file output stream
     189// an set the corresponding flag
     190//
    154191void MLog::AllocateFile(const char *fname)
    155192{
    156     //
    157     // Create a new instance of an file output stream
    158     // an set the corresponding flag
    159     //
    160193    fout = new ofstream(fname);
    161194    fOutAllocated = kTRUE;
    162195}
    163196
     197// --------------------------------------------------------------------------
     198//
     199// if fout was allocated by this instance of MLooging
     200// delete it.
     201//
    164202void MLog::DeallocateFile()
    165203{
    166     //
    167     // if fout was allocated by this instance of MLooging
    168     // delete it.
    169     //
    170204    if (fOutAllocated)
    171205        delete fout;
    172206}
    173207
     208// --------------------------------------------------------------------------
     209//
     210// if necessary delete the old in stance of the file
     211// output stream and create a new one
     212//
    174213void MLog::ReallocateFile(const char *fname)
    175214{
    176     //
    177     // if necessary delete the old in stance of the file
    178     // output stream and create a new one
    179     //
    180215    DeallocateFile();
    181216    AllocateFile(fname);
    182217}
    183218
     219// --------------------------------------------------------------------------
     220//
     221// This function checks if a device should get enabled or disabled.
     222//
    184223void MLog::CheckFlag(Flags_t chk, int flag)
    185224{
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r749 r752  
    4545ClassImp(MParContainer);
    4646
     47// --------------------------------------------------------------------------
     48//
     49//  MParContainer copy ctor
     50//
    4751MParContainer::MParContainer(const MParContainer &named)
    4852{
    49     //
    50     //  MParContainer copy ctor.
    51     //
    5253    *fName = *(named.fName);
    5354    *fTitle = *(named.fTitle);
    5455}
    5556
     57// --------------------------------------------------------------------------
     58//
     59//  MParContainer assignment operator.
     60//
    5661MParContainer& MParContainer::operator=(const MParContainer& rhs)
    5762{
    58     //
    59     //  MParContainer assignment operator.
    60     //
    6163    if (this != &rhs) {
    6264        TObject::operator=(rhs);
     
    6769}
    6870
     71// --------------------------------------------------------------------------
     72//
     73//  Compare two MParContainer objects. Returns 0 when equal, -1 when this is
     74//  smaller and +1 when bigger (like strcmp).
     75//
    6976Int_t MParContainer::Compare(TObject *obj)
    7077{
    71     //
    72     //  Compare two MParContainer objects. Returns 0 when equal, -1 when this is
    73     //  smaller and +1 when bigger (like strcmp).
    74     //
    7578    if (this == obj) return 0;
    7679    return fName->CompareTo(obj->GetName());
    7780}
    7881
     82// --------------------------------------------------------------------------
     83//
     84//  Copy this to obj.
     85//
    7986void MParContainer::Copy(TObject &obj)
    8087{
    81     //
    82     //  Copy this to obj.
    83     //
    8488    TObject::Copy(obj);
    8589    *(((MParContainer&)obj).fName)  = *fName;
     
    8791}
    8892
     93// --------------------------------------------------------------------------
     94//
     95//  Encode MParContainer into output buffer.
     96//
    8997void MParContainer::FillBuffer(char *&buffer)
    9098{
    91     //
    92     //  Encode MParContainer into output buffer.
    93     //
    9499    fName->FillBuffer(buffer);
    95100    fTitle->FillBuffer(buffer);
    96101}
    97102
     103// --------------------------------------------------------------------------
     104//
     105//  List MParContainer name and title.
     106//
    98107void MParContainer::ls(Option_t *)
    99108{
    100     //
    101     //  List MParContainer name and title.
    102     //
    103109    TROOT::IndentLevel();
    104110    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
     
    106112}
    107113
     114// --------------------------------------------------------------------------
     115//
     116//  Print MParContainer name and title.
     117//
    108118void MParContainer::Print(Option_t *)
    109119{
    110     //
    111     //  Print MParContainer name and title.
    112     //
    113120    *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
    114121}
    115122
     123// --------------------------------------------------------------------------
     124//
     125//  Change (i.e. set) the name of the MParContainer.
     126//  WARNING !!
     127//  If the object is a member of a THashTable, THashList container
     128//  The HashTable must be Rehashed after SetName
     129//  For example the list of objects in the current directory is a THashList
     130//
    116131void MParContainer::SetName(const char *name)
    117132{
    118     //
    119     //  Change (i.e. set) the name of the MParContainer.
    120     //  WARNING !!
    121     //  If the object is a member of a THashTable, THashList container
    122     //  The HashTable must be Rehashed after SetName
    123     //  For example the list of objects in the current directory is a THashList
    124     //
    125133    *fName = name;
    126134    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    127135}
    128136
     137// --------------------------------------------------------------------------
     138//
     139//  Change (i.e. set) all the MParContainer parameters (name and title).
     140//  See also WARNING in SetName
     141//
    129142void MParContainer::SetObject(const char *name, const char *title)
    130143{
    131     //
    132     //  Change (i.e. set) all the MParContainer parameters (name and title).
    133     //  See also WARNING in SetName
    134     //
    135144    *fName  = name;
    136145    *fTitle = title;
     
    138147}
    139148
     149// --------------------------------------------------------------------------
     150//
     151//  Change (i.e. set) the title of the MParContainer.
     152//
    140153void MParContainer::SetTitle(const char *title)
    141154{
    142     //
    143     //  Change (i.e. set) the title of the MParContainer.
    144     //
    145155    *fTitle = title;
    146156    if (gPad && TestBit(kMustCleanup)) gPad->Modified();
    147157}
    148158
     159// --------------------------------------------------------------------------
     160//
     161//  Return size of the MParContainer part of the TObject.
     162//
    149163Int_t MParContainer::Sizeof() const
    150164{
    151     //
    152     //  Return size of the MParContainer part of the TObject.
    153     //
    154165    Int_t nbytes = fName->Sizeof() + fTitle->Sizeof();
    155166    return nbytes;
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r749 r752  
    4949ClassImp(MParList)
    5050
    51     //
    52     // FIXME: The Automatic created classes are NEVER deleted!!!!!
    53     //
    54 
     51// --------------------------------------------------------------------------
     52//
     53//  default constructor
     54//  creates an empty list
     55//
    5556MParList::MParList(const char *name, const char *title)
    5657{
    57     //
    58     //  default constructor
    59     //  creates an empty list
    60     //
    6158    *fName  = name  ? name  : "MParList";
    6259    *fTitle = title ? title : "List of Parameter Containers";
     
    6966}
    7067
     68// --------------------------------------------------------------------------
     69//
     70// copy constructor
     71//
    7172MParList::MParList(MParList &ts)
    7273{
    73     //
    74     // copy constructor
    75     //
    76 
    7774    fContainer.AddAll(&ts.fContainer);
    7875}
    7976
     77// --------------------------------------------------------------------------
     78//
     79//  create the Iterator over the tasklist
     80//
    8081void MParList::SetLogStream(MLog *log)
    8182{
    82     //
    83     //  create the Iterator over the tasklist
    84     //
    8583    TIter Next(&fContainer);
    8684
     
    9694}
    9795
     96// --------------------------------------------------------------------------
     97//
     98//  Add an Container to the list.
     99//
     100//  If 'where' is given, the object will be added after this.
     101//
    98102Bool_t MParList::AddToList(MParContainer *obj, MParContainer *where)
    99103{
    100   //
    101   //  Add an Container to the list.
    102   //
    103   //  If 'where' is given, the object will be added after this.
    104   //
    105  
    106104  //
    107105  //  check if the object (you want to add) exists
     
    139137}
    140138
     139// --------------------------------------------------------------------------
     140//
     141//  Find an object in the list.
     142//  'name' is the name of the object you are searching for.
     143//
    141144TObject *MParList::FindObject(const char *name) const
    142145{
    143     //
    144     //  Find an object in the list.
    145     //  'name' is the name of the object you are searching for.
    146     //
    147146    return (TObject*)fContainer.FindObject(name);
    148147}
    149148
     149// --------------------------------------------------------------------------
     150//
     151//  Find an object in the list.
     152//  'name' is the name of the object you are searching for.
     153//  If the object doesn't exist we try to create one from the
     154//  dictionary. If this isn't possible NULL is returned
     155//
    150156MParContainer *MParList::FindCreateObj(const char *classname, const char *objname)
    151157{
    152     //
    153     //  Find an object in the list.
    154     //  'name' is the name of the object you are searching for.
    155     //  If the object doesn't exist we try to create one from the
    156     //  dictionary. If this isn't possible NULL is returned
    157     //
    158 
    159158    //
    160159    // If now object name (name of the object to identify it in the
     
    221220}
    222221
     222// --------------------------------------------------------------------------
     223//
     224//   print some information about the current status of MParList
     225//
    223226void MParList::Print(Option_t *t)
    224227{
    225   //
    226   //   print some information about the current status of MParList
    227   //
    228228  *fLog << dbginf << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
    229229  *fLog << endl;
  • trunk/MagicSoft/Mars/mbase/MReadTree.cc

    r749 r752  
    5353ClassImp(MReadTree)
    5454
     55// --------------------------------------------------------------------------
    5556MReadTree::MReadTree(const char *tname, const char *fname,
    5657                     const char *name, const char *title)
     
    6869}
    6970
     71// --------------------------------------------------------------------------
    7072MReadTree::~MReadTree()
    7173{
     
    7375}
    7476
     77// --------------------------------------------------------------------------
    7578/*Int_t*/ void MReadTree::AddFile(const char *fname)
    7679{
     
    8487}
    8588
     89// --------------------------------------------------------------------------
     90//
     91// open file and check if file is really open
     92//
    8693Bool_t MReadTree::PreProcess (MParList *pList)
    8794{
    88     //
    89     // open file and check if file is really open
    90     //
    91 
    9295    //
    9396    // get number of events in this tree
     
    154157}
    155158
     159// --------------------------------------------------------------------------
    156160Bool_t MReadTree::Process()
    157161{
     
    172176}
    173177
     178// --------------------------------------------------------------------------
     179//
     180// Close File
     181//
    174182Bool_t MReadTree::PostProcess()
    175183{
    176     //
    177     // Close File
    178     //
    179184    //fFile->Close();
    180185
     
    182187}
    183188
     189// --------------------------------------------------------------------------
     190//
     191// Get the Event with the current EventNumber fNumEntry
     192//
    184193Bool_t MReadTree::GetEvent()
    185194{
    186     //
    187     // Get the Event with the current EventNumber fNumEntry
    188     //
    189195    fChain->GetEntry(fNumEntry);
    190196
     
    192198}
    193199
     200// --------------------------------------------------------------------------
     201//
     202// Decrease the number of the event which is read by Process() next
     203// by one or more
     204//
    194205Bool_t MReadTree::DecEventNum(UInt_t dec)
    195206{
    196     //
    197     // Decrease the number of the event which is read by Process() next
    198     // by one or more
    199     //
    200 
    201207    //!
    202208    //! this function makes Process() read the event one (or more) before
     
    213219}
    214220
     221// --------------------------------------------------------------------------
     222//
     223// Increase the number of the event which is read by Process() next
     224// by one or more
     225//
    215226Bool_t MReadTree::IncEventNum(UInt_t inc)
    216227{
    217     //
    218     // Increase the number of the event which is read by Process() next
    219     // by one or more
    220     //
    221 
    222228    //!
    223229    //! this function makes Process() read the next (or more) after
     
    236242}
    237243
     244// --------------------------------------------------------------------------
     245//
     246// this function makes Process() read event number nr next
     247//
    238248Bool_t MReadTree::SetEventNum(UInt_t nr)
    239249{
    240     //
    241     // this function makes Process() read event number nr next
    242     //
    243250    if (nr>=fNumEntries)
    244251    {
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r749 r752  
    6363ClassImp(MTask)
    6464
     65// --------------------------------------------------------------------------
     66//
     67// This is processed before the eventloop starts
     68//
     69// It is the job of the PreProcess to connect the tasks
     70// with the right container in the parameter list.
     71//
     72// the virtual implementation returns kTRUE
     73//
    6574Bool_t MTask::PreProcess( MParList *pList )
    6675{
    67     //
    68     // This is processed before the eventloop starts
    69     //
    70     // It is the job of the PreProcess to connect the tasks
    71     // with the right container in the parameter list.
    72     //
    73     // the virtual implementation returns kTRUE
    74     //
    7576    return kTRUE;
    7677}
    7778
     79// --------------------------------------------------------------------------
     80//
     81// This is processed for every event in the eventloop
     82//
     83// the virtual implementation returns kTRUE
     84//
    7885Bool_t MTask::Process()
    7986{
    80     //
    81     // This is processed for every event in the eventloop
    82     //
    83     // the virtual implementation returns kTRUE
    84     //
    8587    return kTRUE;
    8688}
    8789
     90// --------------------------------------------------------------------------
     91//
     92// This is processed after the eventloop starts
     93//
     94// the virtual implementation returns kTRUE
     95//
    8896Bool_t MTask::PostProcess()
    8997{
    90     //
    91     // This is processed after the eventloop starts
    92     //
    93     // the virtual implementation returns kTRUE
    94     //
    9598    return kTRUE;
    9699}
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r749 r752  
    2323\* ======================================================================== */
    2424
    25 ///////////////////////////////////////////////////////////////////////
    26 //                                                                   //
    27 // MTaskList                                                         //
    28 //                                                                   //
    29 // Collection of tasks to be processed in the eventloop              //
    30 //                                                                   //
    31 ///////////////////////////////////////////////////////////////////////
     25/////////////////////////////////////////////////////////////////////////////
     26//                                                                         //
     27// MTaskList                                                               //
     28//                                                                         //
     29// Collection of tasks to be processed in the eventloop                    //
     30//                                                                         //
     31/////////////////////////////////////////////////////////////////////////////
    3232
    3333#include "MTaskList.h"
     
    3939ClassImp(MTaskList)
    4040
     41// --------------------------------------------------------------------------
     42//
     43// the name for the task list must be the same for all task lists
     44// because the task list (at the moment) is identified by exactly
     45// this name in the parameter list (by MEvtLoop::SetParList)
     46//
    4147MTaskList::MTaskList(const char *title)
    4248{
    43     //
    44     // the name for the task list must be the same for all task lists
    45     // because the task list (at the moment) is identified by exactly
    46     // this name in the parameter list (by MEvtLoop::SetParList)
    47     //
    4849    *fName  = "MTaskList";
    4950    *fTitle = title ? title : "List for Tasks";
    50 
    51     //
    52     //  default constructor: create empty task list
    53     //
    54 }
    55 
     51}
     52
     53// --------------------------------------------------------------------------
     54//
     55//   CopyConstructor
     56//   creates a new TaskList and put the contents of an existing
     57//   TaskList in the new TaskList.
     58//
    5659MTaskList::MTaskList(MTaskList &ts)
    5760{
    58   //
    59   //   CopyConstructor
    60   //   creates a new TaskList and put the contents of an existing
    61   //   TaskList in the new TaskList.
    62   //
    6361  fTasks.AddAll(&ts.fTasks);
    6462}
    6563
     64// --------------------------------------------------------------------------
     65//
     66//  create the Iterator over the tasklist
     67//
    6668void MTaskList::SetLogStream(MLog *log)
    6769{
    68     //
    69     //  create the Iterator over the tasklist
    70     //
    7170    TIter Next(&fTasks);
    7271
     
    8382
    8483
     84// --------------------------------------------------------------------------
     85//
     86// schedule task for execution, whether as first task, or after
     87// 'where'. 'tType' is the event type which should be processed
     88//
    8589Bool_t MTaskList::AddToList(MTask *task, const char *type, MTask *where)
    8690{
    87     // schedule task for execution, whether as first task, or after
    88     // 'where'. 'tType' is the event type which should be processed
    8991    if (!task)
    9092        return kTRUE;
     
    125127}
    126128
    127 
     129// --------------------------------------------------------------------------
     130//
     131// do pre processing (before eventloop) of all tasks in the task-list
     132//
    128133Bool_t MTaskList::PreProcess( MParList *pList )
    129134{
    130     //
    131     // do pre processing (before eventloop) of all tasks in the task-list
    132     //
    133135    *fLog << "Preprocessing... " << flush;
    134136
     
    156158}
    157159
     160// --------------------------------------------------------------------------
     161//
     162// do the event execution of all tasks in the task-list
     163//
    158164Bool_t MTaskList::Process()
    159165{
    160   //
    161   // do the event execution of all tasks in the task-list
    162   //
    163  
    164   //
    165   //  create the Iterator for the TaskList
    166   //
    167   TIter Next(&fTasks);
    168   MTask *task=NULL;
    169    
    170   //
    171   // loop over all tasks for processing
    172   //
    173   while ( (task=(MTask*)Next()) )
    174   {
    175       if (!strcmp(GetStreamId(), task->GetStreamId()) ||
    176           !strcmp(task->GetStreamId(), "All"))
    177       {
    178           switch (task->Process())
    179           {
    180           case kTRUE:
    181               //
    182               // everything was OK: go on
    183               //
    184               continue;
    185 
    186           case kFALSE:
    187               //
    188               // an error occured: stop eventloop
    189               //
    190               return kFALSE;
    191 
    192           case kCONTINUE:
    193               //
    194               // something occured: skip the rest of the tasks for this event
    195               //
    196               break;
    197           }
    198       }
    199   }
    200   return kTRUE;
    201 }
    202 
     166    //
     167    //  create the Iterator for the TaskList
     168    //
     169    TIter Next(&fTasks);
     170    MTask *task=NULL;
     171
     172    //
     173    // loop over all tasks for processing
     174    //
     175    while ( (task=(MTask*)Next()) )
     176    {
     177        //
     178        // if the task has the wrong stream id skip it.
     179        //
     180        if (strcmp(GetStreamId(), task->GetStreamId()) &&
     181            strcmp(task->GetStreamId(), "All"))
     182            continue;
     183
     184        //
     185        // if it has the right stream id execute the Process() function
     186        // and check what the result of it is.
     187        //
     188        switch (task->Process())
     189        {
     190        case kTRUE:
     191            //
     192            // everything was OK: go on
     193            //
     194            continue;
     195
     196        case kFALSE:
     197            //
     198            // an error occured: stop eventloop
     199            //
     200            return kFALSE;
     201
     202        case kCONTINUE:
     203            //
     204            // something occured: skip the rest of the tasks for this event
     205            //
     206            break;
     207        }
     208    }
     209    return kTRUE;
     210}
     211
     212// --------------------------------------------------------------------------
     213//
     214// do post processing (before eventloop) of all tasks in the task-list
     215//
    203216Bool_t MTaskList::PostProcess()
    204217{
    205   //
    206   // do post processing (before eventloop) of all tasks in the task-list
    207   //
    208 
    209218    *fLog << "Postprocessing... " << flush;
    210219
    211   //
    212   //  create the Iterator for the TaskList
    213   //
    214   TIter Next(&fTasks);
    215  
    216   MTask *task=NULL;
    217 
    218   //
    219   //  loop over all tasks for postprocessing
    220   // 
    221   while ( (task=(MTask*)Next()) )
    222   {
    223       *fLog << task->GetName() << "... " << flush;
    224 
    225       if (!task->PostProcess())
    226           return kFALSE;
    227   }
    228 
    229   *fLog << endl;
    230 
    231   return kTRUE;
    232 }
    233 
    234 
    235 
     220    //
     221    //  create the Iterator for the TaskList
     222    //
     223    TIter Next(&fTasks);
     224
     225    MTask *task=NULL;
     226
     227    //
     228    //  loop over all tasks for postprocessing
     229    //
     230    while ( (task=(MTask*)Next()) )
     231    {
     232        *fLog << task->GetName() << "... " << flush;
     233
     234        if (!task->PostProcess())
     235            return kFALSE;
     236    }
     237
     238    *fLog << endl;
     239
     240    return kTRUE;
     241}
     242
     243// --------------------------------------------------------------------------
    236244void MTaskList::Print(Option_t *t)
    237245{
  • trunk/MagicSoft/Mars/mbase/Makefile

    r604 r752  
    4343           MTime.cc \
    4444           MLog.cc \
     45           MHtml.cc \
    4546           MLogManip.cc
    4647
Note: See TracChangeset for help on using the changeset viewer.