Ignore:
Timestamp:
01/03/05 12:02:16 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
4 edited

Legend:

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

    r5551 r5692  
    1818!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2004
     20!   Copyright: MAGIC Software Development, 2000-2005
    2121!
    2222!
     
    116116using namespace std;
    117117
     118#undef DEBUG
     119//#define DEBUG
     120
     121
    118122// root 3.02:
    119123// check for TObjectWarning, TObject::Info, gErrorIgnoreLevel
     
    216220    DeallocateFile();
    217221
     222#ifdef DEBUG
     223    TIter Next(fPlugins);
     224    TObject *o=0;
     225    while ((o=Next()))
     226    {
     227        cout << "Delete: " << o->GetName() << std::flush;
     228        cout << " [" << o->ClassName() << "]" << endl;
     229        delete o;
     230    }
     231
     232    cout << "Delete: fPlugins " << fPlugins << "..." << std::flush;
     233#endif
     234
    218235    delete fPlugins;
     236#ifdef DEBUG
     237    cout << "done." << endl;
     238#endif
     239
    219240#ifdef _REENTRANT
    220241    delete fMuxStream;
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r5557 r5692  
    1818!   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2004
     20!   Copyright: MAGIC Software Development, 2000-2005
    2121!
    2222!
     
    109109{
    110110#ifdef DEBUG
     111    if (fName.IsNull() || fName==(TString)"MTime")
     112        return;
     113
    111114    *fLog << all << "Deleting " << GetDescriptor() << endl;
     115    if (TestBit(kMustCleanup) && gROOT && gROOT->MustClean())
     116    {
     117        *fLog << "Recursive Remove..." << flush;
     118        if (TestBit(kCanDelete))
     119            *fLog << "kCanDelete..." << flush;
     120        TIter Next(gROOT->GetListOfCleanups());
     121        TObject *o=0;
     122        while ((o=Next()))
     123            *fLog << dbg << o->GetName() << " [" << o->ClassName() << "]" << endl;
     124        *fLog << dbg << "Removing..." << flush;
     125        gROOT->GetListOfCleanups()->RecursiveRemove(this);
     126        *fLog << "Removed." << endl;
     127    }
    112128#endif
    113129}
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r5030 r5692  
    879879
    880880}
     881
     882// --------------------------------------------------------------------------
     883//
     884//  Find an object with the same name in the list and replace it with
     885//  the new one. If the kIsOwner flag is set and the object was not
     886//  created automatically, the object is deleted.
     887//
     888Bool_t MTaskList::Replace(MTask *task)
     889{
     890    //
     891    //  check if the object (you want to add) exists
     892    //
     893    if (!task)
     894        return kFALSE;
     895
     896    if (task==this)
     897    {
     898        *fLog << warn << "WARNING - You cannot add a tasklist to itself.  This" << endl;
     899        *fLog << "          would create infinite recursions...ignored." << endl;
     900        return kFALSE;
     901
     902    }
     903
     904    MTask *obj = (MTask*)FindObject(task->GetName());
     905    if (!obj)
     906    {
     907        *fLog << warn << "No object with the same name '";
     908        *fLog << task->GetName() << "' in list... adding." << endl;
     909        return AddToList(task);
     910    }
     911
     912    if (task==obj)
     913        return kTRUE;
     914
     915    *fLog << inf << "Adding " << task->GetName() << " to " << GetName() << " for " << obj->GetStreamId() << "... " << flush;
     916    task->SetStreamId(obj->GetStreamId());
     917    task->SetBit(kMustCleanup);
     918    fTasks->AddAfter((TObject*)obj, task);
     919    *fLog << "Done." << endl;
     920
     921    RemoveFromList(obj);
     922
     923    if (TestBit(kIsOwner))
     924        delete obj;
     925
     926    //*fLog << inf << "MTask '" << task->GetName() << "' found and replaced..." << endl;
     927
     928    return kTRUE;
     929}
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r4828 r5692  
    4949    void SetSerialNumber(Byte_t num);
    5050
     51    Bool_t Replace(MTask *obj);
    5152    Bool_t RemoveFromList(MTask *task);
    5253
Note: See TracChangeset for help on using the changeset viewer.