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/MParList.cc

    r986 r1003  
    4343#include <TNamed.h>
    4444#include <TClass.h>
    45 #include <TObjArray.h>
     45#include <TOrdCollection.h>
    4646
    4747#include "MLog.h"
     
    5757MParList::MParList(const char *name, const char *title)
    5858{
    59     *fName  = name  ? name  : "MParList";
    60     *fTitle = title ? title : "A list of Parameter Containers";
     59    fName  = name  ? name  : "MParList";
     60    fTitle = title ? title : "A list of Parameter Containers";
    6161
    6262    //
     
    6464    // that the destructor of the list deletes all it's objects
    6565    //
    66     fAutodelete.SetOwner();
     66    fContainer  = new TOrdCollection;
     67    fAutodelete = new TOrdCollection;
     68
     69    fAutodelete->SetOwner();
    6770}
    6871
     
    7679MParList::MParList(MParList &ts)
    7780{
    78     fContainer.AddAll(&ts.fContainer);
     81    fContainer->AddAll(ts.fContainer);
    7982}
    8083
     
    8790{
    8891    if (TestBit(kIsOwner))
    89         fContainer.SetOwner();
     92        fContainer->SetOwner();
     93
     94    delete fContainer;
     95    delete fAutodelete;
    9096}
    9197
     
    107113void MParList::SetLogStream(MLog *log)
    108114{
    109     TIter Next(&fContainer);
     115    TIter Next(fContainer);
    110116
    111117    MParContainer *cont=NULL;
     
    143149    // Check if the new container is already existing in the list
    144150    //
    145     const TObject *objn = fContainer.FindObject(name);
    146     const TObject *objt = fContainer.FindObject(cont);
     151    const TObject *objn = fContainer->FindObject(name);
     152    const TObject *objt = fContainer->FindObject(cont);
    147153
    148154    if (objn || objt)
     
    172178    if (where)
    173179    {
    174         if (!fContainer.FindObject(where))
     180        if (!fContainer->FindObject(where))
    175181        {
    176182            *fLog << dbginf << "Error: Cannot find parameter container after which the new one should be added!" << endl;
     
    181187    *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
    182188
    183     fContainer.Add(cont);
     189    fContainer->Add(cont);
    184190    *fLog << "Done." << endl;
    185191
     
    204210    while ((cont=(MParContainer*)Next()))
    205211    {
    206         //
     212        AddToList(cont);
     213/*        //
    207214        // Get Name of new container
    208215        //
     
    212219        // Check if the new container is already existing in the list
    213220        //
    214         const TObject *objn = fContainer.FindObject(name);
    215         const TObject *objt = fContainer.FindObject(cont);
     221        const TObject *objn = fContainer->FindObject(name);
     222        const TObject *objt = fContainer->FindObject(cont);
    216223
    217224        if (objn || objt)
     
    237244        *fLog << "Adding " << name << " to " << GetName() << "... " << flush;
    238245
    239         fContainer.Add(cont);
    240 
    241         *fLog << "Done." << endl;
     246        fContainer->Add(cont);
     247
     248        *fLog << "Done." << endl;*/
    242249    }
    243250}
     
    250257TObject *MParList::FindObject(const char *name) const
    251258{
    252     return fContainer.FindObject(name);
     259    return fContainer->FindObject(name);
    253260}
    254261
     
    259266TObject *MParList::FindObject(TObject *obj) const
    260267{
    261     return fContainer.FindObject(obj);
     268    return fContainer->FindObject(obj);
    262269}
    263270
     
    358365    // if object is not existing in the list try to create one
    359366    //
    360     *fLog << dbginf << "Object '" << oname << "' [" << cname << "] not found... creating." << endl;
     367    *fLog << "Object '" << oname << "' [" << cname << "] not yet in " << GetName() << "... creating." << endl;
    361368
    362369    //
     
    393400    // object is deleted together with the list
    394401    //
    395     fAutodelete.Add(pcont);
     402    fAutodelete->Add(pcont);
    396403
    397404    //
     
    419426void MParList::SetReadyToSave(Bool_t flag)
    420427{
    421     TIter Next(&fContainer);
     428    TIter Next(fContainer);
    422429
    423430    MParContainer *cont=NULL;
     
    438445void MParList::Reset()
    439446{
    440     TIter Next(&fContainer);
     447    TIter Next(fContainer);
    441448
    442449    MParContainer *cont=NULL;
Note: See TracChangeset for help on using the changeset viewer.