Changeset 9345 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 02/16/09 10:19:21 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MEnv.cc
r9314 r9345 18 18 ! Author(s): Thomas Bretz 2/2005 <mailto:tbretz@astro.uni-wuerzburg.de> 19 19 ! 20 ! Copyright: MAGIC Software Development, 2000-200 720 ! Copyright: MAGIC Software Development, 2000-2009 21 21 ! 22 22 ! … … 44 44 // the including file. 45 45 // 46 // Class Version 1: 47 // ---------------- 48 // + TString fName 49 // 46 50 ////////////////////////////////////////////////////////////////////////////// 47 51 #include "MEnv.h" … … 71 75 // is called which can then be checked by IsValid() 72 76 // 73 MEnv::MEnv(const char *name) : TEnv(name) 77 // The second argument is the default name. Usually as name of the MEnv 78 // the base name of the file is returned. By giving a default name 79 // you can overwrite this behavious. This is useful for I/O 80 // because it allows to use Read and Write without argument. 81 // 82 MEnv::MEnv(const char *name, const char *defname) : TEnv(name), fName(defname) 74 83 { 75 84 fChecked.SetOwner(); … … 174 183 inc = inc.Strip(TString::kBoth); 175 184 176 // Set final resource, now as kEnvLocal (previously set as kEnvCh naged)185 // Set final resource, now as kEnvLocal (previously set as kEnvChanged) 177 186 SetValue("Include", inc, kEnvLocal); 178 187 … … 198 207 } 199 208 209 // -------------------------------------------------------------------------- 210 // 211 // Read an object from the current directory. If no name is given 212 // the name of this object is used. 213 // 214 Int_t MEnv::Read(const char *name) 215 { 216 const Int_t rc = TEnv::Read(name?name:(const char*)fName); 217 //if (name) 218 // SetName(name); 219 return rc; 220 } 221 200 222 //--------------------------------------------------------------------------- 201 223 // … … 204 226 const char *MEnv::GetName() const 205 227 { 228 if (!fName.IsNull()) 229 return fName; 230 206 231 const char *pos = strrchr(GetRcName(), '/'); 207 232 return pos>0 ? pos+1 : GetRcName(); … … 1061 1086 void MEnv::PrintEnv(EEnvLevel level) const 1062 1087 { 1063 cout << "# Path: " << GetRcName() << endl; 1064 cout << "# Name: " << GetName() << endl; 1088 if (!TString(GetRcName()).IsNull()) 1089 { 1090 cout << "# Path: " << GetRcName() << endl; 1091 cout << "# File: " << gSystem->BaseName(GetRcName()) << endl; 1092 } 1093 if (!fName.IsNull()) 1094 cout << "# Name: " << fName << endl; 1095 1065 1096 TEnv::PrintEnv(level); 1066 1097 } -
trunk/MagicSoft/Mars/mbase/MEnv.h
r9301 r9345 21 21 { 22 22 private: 23 TOrdCollection fChecked; 23 TOrdCollection fChecked; //! 24 25 TString fName; 24 26 25 27 TString Compile(TString str, const char *post) const; … … 27 29 28 30 public: 29 MEnv(const char *name="" );31 MEnv(const char *name="", const char *defname=0); 30 32 31 33 Bool_t IsValid() const { return !TString(GetRcName()).IsNull(); } … … 44 46 45 47 const char *GetName() const; 48 void SetName(const char *name=0) { fName = name; } 46 49 47 50 Int_t GetColor(const char *name, Int_t dftl); … … 73 76 Bool_t TakeEnv(MArgs &args, Bool_t print=kFALSE, Bool_t overwrite=kTRUE); 74 77 78 Int_t Read(const char *name=0); 75 79 Int_t ReadFile(const char *fname, EEnvLevel level); 76 80 … … 85 89 Int_t GetNumUntouched() const; 86 90 87 ClassDef(MEnv, 0) // A slightly more advanced version of TEnv91 ClassDef(MEnv, 1) // A slightly more advanced version of TEnv 88 92 }; 89 93 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r9268 r9345 245 245 // -------------------------------------------------------------------------- 246 246 // 247 // Add all entries of the TObjArray to the list. 247 // Add all entries which derive from MParContainer 248 // of the TObjArray to the list. 248 249 // 249 250 void MParList::AddToList(TObjArray *list) … … 255 256 return; 256 257 257 MIter Next(list);258 259 MParContainer*cont = NULL;258 TIter Next(list); 259 260 TObject *cont = NULL; 260 261 while ((cont=Next())) 261 262 { 263 if (!dynamic_cast<MParContainer*>(cont)) 264 continue; 265 262 266 cont->SetBit(kMustCleanup); 263 267 AddToList(cont);
Note:
See TracChangeset
for help on using the changeset viewer.