Changeset 4601 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 08/12/04 16:41:37 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r4081 r4601 33 33 34 34 #pragma link C++ class MTask+; 35 #pragma link C++ class MTaskEnv+; 35 36 #pragma link C++ class MTaskInteractive+; 36 37 #pragma link C++ class MTaskList+; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r4452 r4601 936 936 // all Mars classes. 937 937 // 938 Bool_t MEvtLoop::ReadEnv(const TEnv &env, TString prefix, Bool_t print)938 Int_t MEvtLoop::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 939 939 { 940 940 if (!prefix.IsNull()) … … 946 946 *fLog << inf << "Reading resources for " << prefix /*TEnv::fRcName << " from " << env.GetRcName()*/ << endl; 947 947 948 fLog->ReadEnv(env, prefix, print); 949 948 950 if (fParList->ReadEnv(env, prefix, print)==kERROR) 949 951 { … … 951 953 return kFALSE; 952 954 } 953 954 fLog->ReadEnv(env, prefix, print);955 955 956 956 return kTRUE; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r4368 r4601 77 77 void Print(Option_t *opt="") const; 78 78 79 Bool_tReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE);79 Int_t ReadEnv(const TEnv &env, TString prefix="", Bool_t print=kFALSE); 80 80 Bool_t WriteEnv(TEnv &env, TString prefix="", Bool_t print=kFALSE) const; 81 81 -
trunk/MagicSoft/Mars/mbase/MGList.cc
r2173 r4601 37 37 #include <iostream> 38 38 39 #include <TROOT.h> 39 40 #include <TClass.h> 40 41 #include <TGClient.h> … … 45 46 46 47 using namespace std; 48 49 // -------------------------------------------------------------------------- 50 // 51 // Add the list to the global list of cleanups 52 // objects in the list. 53 // 54 MGList::MGList() : TList() 55 { 56 gROOT->GetListOfCleanups()->Add(this); 57 } 47 58 48 59 // -------------------------------------------------------------------------- … … 159 170 160 171 TList::Add(obj); 172 obj->SetBit(kMustCleanup); 161 173 } 162 174 … … 180 192 181 193 TList::Add(obj, opt); 194 obj->SetBit(kMustCleanup); 182 195 } 183 196 … … 187 200 // - The picture is freed as often as it was retrieved from gClient 188 201 // 189 void MGList::AddPicture( constTGPicture *pic, const char *name)202 void MGList::AddPicture(TGPicture *pic, const char *name) 190 203 { 191 204 // … … 204 217 // Add the picture to the list 205 218 // 206 TList::Add(const_cast<TGPicture*>(pic)); 219 TList::Add(pic); 220 pic->SetBit(kMustCleanup); 207 221 } 208 222 … … 221 235 const TGPicture *MGList::GetPicture(const char *name) 222 236 { 223 const TGPicture *pic = gClient->GetPicture(name);237 TGPicture *pic = const_cast<TGPicture*>(gClient->GetPicture(name)); 224 238 AddPicture(pic, name); 225 239 return pic; … … 240 254 const TGPicture *MGList::GetPicture(const char *name, Int_t width, Int_t height) 241 255 { 242 const TGPicture *pic = gClient->GetPicture(name, width, height);256 TGPicture *pic = const_cast<TGPicture*>(gClient->GetPicture(name, width, height)); 243 257 AddPicture(pic, name); 244 258 return pic; -
trunk/MagicSoft/Mars/mbase/MGList.h
r1108 r4601 15 15 Bool_t IsExisting(TObject *obj) const; 16 16 17 void AddPicture( constTGPicture *pic, const char *name);17 void AddPicture(TGPicture *pic, const char *name); 18 18 19 19 public: 20 MGList() : TList() {}21 virtual~MGList();20 MGList(); 21 ~MGList(); 22 22 23 23 void Add(TObject *obj); -
trunk/MagicSoft/Mars/mbase/MLog.cc
r4461 r4601 544 544 void MLog::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 545 545 { 546 if (!prefix.IsNull())547 prefix += ".";548 prefix += "MLog";549 550 546 MParContainer mlog("MLog"); 551 547 552 if (mlog.IsEnvDefined(env, prefix, "VerbosityLevel", print)) 553 SetDebugLevel(mlog.GetEnvValue(env, prefix, "VerbosityLevel", 2)); 554 555 if (mlog.IsEnvDefined(env, prefix, "DebugLevel", print)) 556 gDebug = mlog.GetEnvValue(env, prefix, "DebugLevel", 0); 557 558 if (mlog.IsEnvDefined(env, prefix, "NoColors", print)) 559 if (mlog.GetEnvValue(env, prefix, "NoColors", 1)>0) 560 SetNoColors(); 548 if (mlog.IsEnvDefined(env, prefix+"MLog", "VerbosityLevel", print)) 549 SetDebugLevel(mlog.GetEnvValue(env, prefix+"MLog", "VerbosityLevel", 2)); 550 else 551 if (mlog.IsEnvDefined(env, "MLog", "VerbosityLevel", print)) 552 SetDebugLevel(mlog.GetEnvValue(env, "MLog", "VerbosityLevel", 2)); 553 554 if (mlog.IsEnvDefined(env, prefix+"MLog", "DebugLevel", print)) 555 gDebug = mlog.GetEnvValue(env, prefix+"MLog", "DebugLevel", 0); 556 else 557 if (mlog.IsEnvDefined(env, "MLog", "DebugLevel", print)) 558 gDebug = mlog.GetEnvValue(env, "MLog", "DebugLevel", 0); 559 560 if (mlog.IsEnvDefined(env, prefix+"MLog", "NoColors", print)) 561 SetNoColors(mlog.GetEnvValue(env, prefix+"MLog", "NoColors", kFALSE)); 562 else 563 if (mlog.IsEnvDefined(env, "MLog", "NoColors", print)) 564 SetNoColors(mlog.GetEnvValue(env, "MLog", "NoColors", kFALSE)); 561 565 } 562 566 -
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r4081 r4601 569 569 // all Mars classes. 570 570 // 571 Bool_t MParContainer::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 571 // Return values: 572 // kTRUE: Environment string found 573 // kFALSE: Environment string not found 574 // kERROR: Error occured, eg. environment invalid 575 // 576 // Overload this if you don't want to control the level of setup-string. In 577 // this case ReadEnv gets called with the different possibilities, see TestEnv. 578 // 579 Int_t MParContainer::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 572 580 { 573 581 if (!IsEnvDefined(env, prefix, "", print)) … … 609 617 } 610 618 619 // -------------------------------------------------------------------------- 620 // 621 // Take the prefix and call ReadEnv for: 622 // prefix.containername 623 // prefix.classname 624 // containername 625 // classname 626 // 627 // The existance of an environment variable is done in this order. If 628 // ReadEnv return kTRUE the existance of the container setup is assumed and 629 // the other tests are skipped. If kFALSE is assumed the sequence is 630 // continued. In case of kERROR failing of the setup from a file is assumed. 631 // 632 // Overload this if you want to control the handling of level of setup-string 633 // mentioned above. In this case ReadEnv gets never called if you don't call 634 // it explicitly. 635 // 636 Int_t MParContainer::TestEnv(const TEnv &env, TString prefix, Bool_t print) 637 { 638 if (print) 639 *fLog << all << "Testing Prefix+ContName: " << prefix+GetName() << endl; 640 Int_t rc = ReadEnv(env, prefix+GetName(), print); 641 if (rc==kERROR || rc==kTRUE) 642 return rc; 643 644 // Check For: Job4.MClassName.Varname 645 if (print) 646 *fLog << all << "Testing Prefix+ClasName: " << prefix+ClassName() << endl; 647 rc = ReadEnv(env, prefix+ClassName(), print); 648 if (rc==kERROR || rc==kTRUE) 649 return rc; 650 651 // Check For: ContainerName.Varname 652 if (print) 653 *fLog << all << "Testing ContName: " << GetName() << endl; 654 rc = ReadEnv(env, GetName(), print); 655 if (rc==kERROR || rc==kTRUE) 656 return rc; 657 658 // Check For: MClassName.Varname 659 if (print) 660 *fLog << all << "Testing ClassName: " << ClassName() << endl; 661 rc = ReadEnv(env, ClassName(), print); 662 if (rc==kERROR || rc==kTRUE) 663 return rc; 664 665 // Not found 666 return kFALSE; 667 } 668 611 669 Bool_t MParContainer::IsEnvDefined(const TEnv &env, TString prefix, TString postfix, Bool_t print) const 612 670 { -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r3574 r4601 118 118 virtual void SetNames(TObjArray &arr); 119 119 120 virtual Bool_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 120 virtual Int_t TestEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 121 virtual Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 121 122 virtual Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 122 123 -
trunk/MagicSoft/Mars/mbase/MParList.cc
r4577 r4601 853 853 // all Mars classes. 854 854 // 855 Bool_t MParList::ReadEnv(const TEnv &env, TString prefix, Bool_t print)855 Int_t MParList::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 856 856 { 857 857 if (print) … … 870 870 } 871 871 872 // Check For: Job4.ContainerName.Varname 873 if (print) 874 *fLog << all << "Testing: " << prefix+cont->GetName() << endl; 875 Bool_t rc = cont->ReadEnv(env, prefix+cont->GetName(), print); 876 if (rc==kERROR) 872 if (cont->TestEnv(env, prefix, print)==kERROR) 877 873 return kERROR; 878 if (rc==kTRUE)879 continue;880 881 // Check For: Job4.MClassName.Varname882 if (print)883 *fLog << all << "Testing: " << prefix+cont->ClassName() << endl;884 rc = cont->ReadEnv(env, prefix+cont->ClassName(), print);885 if (rc==kERROR)886 return kERROR;887 if (rc==kTRUE)888 continue;889 890 // Check For: ContainerName.Varname891 if (print)892 *fLog << all << "Testing: " << cont->GetName() << endl;893 rc = cont->ReadEnv(env, cont->GetName(), print);894 if (rc==kERROR)895 return kERROR;896 if (rc==kTRUE)897 continue;898 899 // Check For: MClassName.Varname900 if (print)901 *fLog << all << "Testing: " << cont->ClassName() << endl;902 rc = cont->ReadEnv(env, cont->ClassName(), print);903 if (rc==kERROR)904 return kERROR;905 if (rc==kTRUE)906 continue;907 874 } 908 875 -
trunk/MagicSoft/Mars/mbase/MParList.h
r4577 r4601 91 91 void SavePrimitive(ofstream &out, Option_t *o=""); 92 92 93 Bool_tReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);93 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 94 94 Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 95 95 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r3788 r4601 734 734 // all Mars classes. 735 735 // 736 Bool_t MTaskList::ReadEnv(const TEnv &env, TString prefix, Bool_t print)736 Int_t MTaskList::ReadEnv(const TEnv &env, TString prefix, Bool_t print) 737 737 { 738 738 if (print) … … 751 751 } 752 752 753 // Check For: Job4.ContainerName.Varname 754 if (print) 755 *fLog << all << "Testing: " << prefix+cont->GetName() << endl; 756 Bool_t rc = cont->ReadEnv(env, prefix+cont->GetName(), print); 757 if (rc==kERROR) 753 if (cont->TestEnv(env, prefix, print)==kERROR) 758 754 return kERROR; 759 if (rc==kTRUE)760 continue;761 762 // Check For: Job4.MClassName.Varname763 if (print)764 *fLog << all << "Testing: " << prefix+cont->ClassName() << endl;765 rc = cont->ReadEnv(env, prefix+cont->ClassName(), print);766 if (rc==kERROR)767 return kERROR;768 if (rc==kTRUE)769 continue;770 771 // Check For: ContainerName.Varname772 if (print)773 *fLog << all << "Testing: " << cont->GetName() << endl;774 rc = cont->ReadEnv(env, cont->GetName(), print);775 if (rc==kERROR)776 return kERROR;777 if (rc==kTRUE)778 continue;779 780 // Check For: MClassName.Varname781 if (print)782 *fLog << all << "Testing: " << cont->ClassName() << endl;783 rc = cont->ReadEnv(env, cont->ClassName(), print);784 if (rc==kERROR)785 return kERROR;786 if (rc==kTRUE)787 continue;788 755 } 789 756 -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r3666 r4601 78 78 void SetNames(TObjArray &arr); 79 79 80 Bool_tReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE);80 Int_t ReadEnv(const TEnv &env, TString prefix, Bool_t print=kFALSE); 81 81 Bool_t WriteEnv(TEnv &env, TString prefix, Bool_t print=kFALSE) const; 82 82 -
trunk/MagicSoft/Mars/mbase/Makefile
r4081 r4601 30 30 MInputStreamID.cc \ 31 31 MTask.cc \ 32 MTaskEnv.cc \ 32 33 MTaskInteractive.cc \ 33 34 MTaskList.cc \
Note:
See TracChangeset
for help on using the changeset viewer.