Ignore:
Timestamp:
07/21/08 09:18:18 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
3 edited

Legend:

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

    r9025 r9026  
    776776    // try to get class from root environment
    777777    //
    778     TClass *cls = GetClass(cname);
     778    gLog << err;
     779    TClass *cls = GetClass(cname, &gLog);
    779780    if (!cls)
    780781        return list;
     
    782783    if (!cls->InheritsFrom(MParContainer::Class()))
    783784    {
    784         *fLog << err << dbginf << "Cannot create new instance of class '" << cname << "': " << endl;
    785         *fLog << "Class doesn't inherit from MParContainer." << endl;
     785        gLog << err << dbginf << "Cannot create new instance of class '" << cname << "': " << endl;
     786        gLog << "Class doesn't inherit from MParContainer." << endl;
    786787        return list;
    787788    }
  • trunk/MagicSoft/Mars/mbase/MStatusArray.cc

    r8961 r9026  
    4444#include "MStatusArray.h"
    4545
    46 #include <TH1.h>      // TH1::AddDirectoryStatus();
     46#include <TH1.h>       // TH1::AddDirectoryStatus();
    4747#include <TClass.h>
    4848#include <TCanvas.h>
     
    5151#include "MLogManip.h"
    5252
     53#include "MParContainer.h"   // MParContainer::GetClass
    5354#include "MStatusDisplay.h"
    5455
     
    125126}
    126127
    127 // FIXME: Move to a general class MMARS (TROOT) and unify with MParContainer
    128 TClass *MStatusArray::GetClass(const char *name) const
    129 {
    130     TClass *cls = gROOT->GetClass(name);
    131     Int_t rc = 0;
    132     if (!cls)
    133         rc =1;
    134     else
    135     {
    136         if (!cls->Property())
    137             rc = 5;
    138         if (!cls->Size())
    139             rc = 4;
    140         if (!cls->IsLoaded())
    141             rc = 3;
    142         if (!cls->HasDefaultConstructor())
    143             rc = 2;
    144     }
    145 
    146     if (rc==0)
    147         return cls;
    148 
    149     gLog << err << dbginf << "Class '" << name << "' not in dictionary: ";
    150     switch (rc)
    151     {
    152     case 1:
    153         gLog << "gROOT->GetClass() returned NULL." << endl;
    154         return NULL;
    155     case 2:
    156         gLog << "no default constructor." << endl;
    157         return NULL;
    158     case 3:
    159         gLog << "not loaded." << endl;
    160         return NULL;
    161     case 4:
    162         gLog << "zero size." << endl;
    163         return NULL;
    164     case 5:
    165         gLog << "no property." << endl;
    166         return NULL;
    167     }
    168 
    169     gLog << "THIS SHOULD NEVER HAPPEN!" << endl;
    170 
    171     return 0;
    172 }
    173 
    174128TCanvas *MStatusArray::FindCanvas(const char *name) const
    175129{
     
    184138TObject *MStatusArray::FindObjectInCanvas(const char *object, const char *base, const char *canvas) const
    185139{
    186     TClass *cls = GetClass(base);
     140    gLog << err;
     141    TClass *cls = MParContainer::GetClass(base, &gLog);
    187142    if (!cls)
    188143        return 0;
  • trunk/MagicSoft/Mars/mbase/MStatusArray.h

    r8961 r9026  
    2424    void     PrintObjectsInPad(const TCollection *list, const TString &name, Int_t lvl=0) const;
    2525    TObject *FindObjectInPad(TVirtualPad *pad, const char *object, TClass *base) const;
    26     TClass  *GetClass(const char *name) const;
    2726
    2827public:
Note: See TracChangeset for help on using the changeset viewer.