Ignore:
Timestamp:
10/29/01 11:15:53 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r988 r1003  
    4747#include "MTaskList.h"
    4848
     49#include <TOrdCollection.h>
     50
    4951#include "MLog.h"
    5052#include "MLogManip.h"
     
    6365MTaskList::MTaskList(const char *name, const char *title)
    6466{
    65     *fName  = name  ? name  : "MTaskList";
    66     *fTitle = title ? title : "A list for tasks to be executed";
     67    fName  = name  ? name  : "MTaskList";
     68    fTitle = title ? title : "A list for tasks to be executed";
     69
     70    fTasks = new TOrdCollection;
    6771}
    6872
     
    7579MTaskList::MTaskList(MTaskList &ts)
    7680{
    77     fTasks.AddAll(&ts.fTasks);
     81    fTasks->AddAll(ts.fTasks);
    7882}
    7983
     
    8690{
    8791    if (TestBit(kIsOwner))
    88         fTasks.SetOwner();
     92        fTasks->SetOwner();
     93
     94    delete fTasks;
    8995}
    9096
     
    110116    // create the Iterator over the tasklist
    111117    //
    112     TIter Next(&fTasks);
     118    TIter Next(fTasks);
    113119
    114120    MTask *task=NULL;
     
    147153    // Check if the new task is already existing in the list
    148154    //
    149     const TObject *objn = fTasks.FindObject(name);
    150     const TObject *objt = fTasks.FindObject(task);
     155    const TObject *objn = fTasks->FindObject(name);
     156    const TObject *objt = fTasks->FindObject(task);
    151157
    152158    if (objn || objt)
     
    165171        // Otherwise add it to the list, but print a warning message
    166172        //
    167         *fLog << dbginf << "Warning: Task with the same name '" << task->GetName();
     173        *fLog << dbginf << "Warning: Task '" << task->GetName();
    168174        *fLog << "' already existing in '" << GetName() << "'." << endl;
    169175        *fLog << "You may not be able to get a pointer to this task by name." << endl;
     
    172178    if (where)
    173179    {
    174         if (!fTasks.FindObject(where))
     180        if (!fTasks->FindObject(where))
    175181        {
    176182            *fLog << dbginf << "Error: Cannot find task after which the new task should be scheduled!" << endl;
     
    182188
    183189    task->SetStreamId(type);
    184     fTasks.Add(task);
     190    fTasks->Add(task);
    185191
    186192    *fLog << "Done." << endl;
     
    196202TObject *MTaskList::FindObject(const char *name) const
    197203{
    198     return fTasks.FindObject(name);
     204    return fTasks->FindObject(name);
    199205}
    200206
     
    205211TObject *MTaskList::FindObject(TObject *obj) const
    206212{
    207     return fTasks.FindObject(obj);
     213    return fTasks->FindObject(obj);
    208214}
    209215
     
    221227    //  create the Iterator over the tasklist
    222228    //
    223     TIter Next(&fTasks);
     229    TIter Next(fTasks);
    224230
    225231    MTask *task=NULL;
     
    260266    //  create the Iterator for the TaskList
    261267    //
    262     TIter Next(&fTasks);
     268    TIter Next(fTasks);
    263269    MTask *task=NULL;
    264270
     
    271277        // if the task has the wrong stream id skip it.
    272278        //
    273         if (strcmp(GetStreamId(), task->GetStreamId()) &&
    274             strcmp(task->GetStreamId(), "All"))
     279        if (GetStreamId() != task->GetStreamId() &&
     280            task->GetStreamId() !=  "All")
    275281            continue;
    276282
     
    331337    //  create the Iterator for the TaskList
    332338    //
    333     TIter Next(&fTasks);
     339    TIter Next(fTasks);
    334340
    335341    MTask *task=NULL;
     
    377383    //  create the Iterator for the TaskList
    378384    //
    379     TIter Next(&fTasks);
     385    TIter Next(fTasks);
    380386
    381387    MTask *task=NULL;
     
    396402    *fLog << "TaskList: " << GetName() << " <" << GetTitle() << ">" << endl;
    397403
    398     fTasks.Print();
     404    fTasks->Print();
    399405
    400406    *fLog << endl;
Note: See TracChangeset for help on using the changeset viewer.