Changeset 9026 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 07/21/08 09:18:18 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParList.cc
r9025 r9026 776 776 // try to get class from root environment 777 777 // 778 TClass *cls = GetClass(cname); 778 gLog << err; 779 TClass *cls = GetClass(cname, &gLog); 779 780 if (!cls) 780 781 return list; … … 782 783 if (!cls->InheritsFrom(MParContainer::Class())) 783 784 { 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; 786 787 return list; 787 788 } -
trunk/MagicSoft/Mars/mbase/MStatusArray.cc
r8961 r9026 44 44 #include "MStatusArray.h" 45 45 46 #include <TH1.h> // TH1::AddDirectoryStatus();46 #include <TH1.h> // TH1::AddDirectoryStatus(); 47 47 #include <TClass.h> 48 48 #include <TCanvas.h> … … 51 51 #include "MLogManip.h" 52 52 53 #include "MParContainer.h" // MParContainer::GetClass 53 54 #include "MStatusDisplay.h" 54 55 … … 125 126 } 126 127 127 // FIXME: Move to a general class MMARS (TROOT) and unify with MParContainer128 TClass *MStatusArray::GetClass(const char *name) const129 {130 TClass *cls = gROOT->GetClass(name);131 Int_t rc = 0;132 if (!cls)133 rc =1;134 else135 {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 174 128 TCanvas *MStatusArray::FindCanvas(const char *name) const 175 129 { … … 184 138 TObject *MStatusArray::FindObjectInCanvas(const char *object, const char *base, const char *canvas) const 185 139 { 186 TClass *cls = GetClass(base); 140 gLog << err; 141 TClass *cls = MParContainer::GetClass(base, &gLog); 187 142 if (!cls) 188 143 return 0; -
trunk/MagicSoft/Mars/mbase/MStatusArray.h
r8961 r9026 24 24 void PrintObjectsInPad(const TCollection *list, const TString &name, Int_t lvl=0) const; 25 25 TObject *FindObjectInPad(TVirtualPad *pad, const char *object, TClass *base) const; 26 TClass *GetClass(const char *name) const;27 26 28 27 public:
Note:
See TracChangeset
for help on using the changeset viewer.