Changeset 1477 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 08/02/02 15:20:53 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParContainer.cc
r1476 r1477 80 80 fTitle = rhs.fTitle; 81 81 82 fLog 82 fLog = rhs.fLog; 83 83 fReadyToSave = rhs.fReadyToSave; 84 84 … … 123 123 cont.fTitle = fTitle; 124 124 125 cont.fLog 125 cont.fLog = fLog; 126 126 cont.fReadyToSave = fReadyToSave; 127 127 } … … 168 168 { 169 169 fName = name; 170 ResetBit(kIsSavedAsPrimitive); 170 171 if (gPad && TestBit(kMustCleanup)) gPad->Modified(); 171 172 } … … 180 181 fName = name; 181 182 fTitle = title; 183 ResetBit(kIsSavedAsPrimitive); 182 184 if (gPad && TestBit(kMustCleanup)) gPad->Modified(); 183 185 } … … 190 192 { 191 193 fTitle = title; 194 ResetBit(kIsSavedAsPrimitive); 192 195 if (gPad && TestBit(kMustCleanup)) gPad->Modified(); 193 196 } … … 356 359 void MParContainer::SavePrimitive(ofstream &out, Option_t *o) 357 360 { 358 out << " // SavePrimitive not overloaded... using default." << endl; 361 if (IsSavedAsPrimitive()) 362 return; 363 364 StreamPrimitive(out); 365 SetBit(kIsSavedAsPrimitive); 366 } 367 368 // -------------------------------------------------------------------------- 369 // 370 // Creates the string written by SavePrimitive and returns it. 371 // 372 void MParContainer::StreamPrimitive(ofstream &out) const 373 { 374 out << " // Using MParContainer::StreamPrimitive" << endl; 359 375 out << " " << ClassName() << " " << ToLower(fName) << "(\""; 360 376 out << fName << "\", \"" << fTitle << "\");" << endl; -
trunk/MagicSoft/Mars/mbase/MParContainer.h
r1474 r1477 34 34 MLog *fLog; // The general log facility for this object, initialized with the global object 35 35 36 virtual void StreamPrimitive(ofstream &out) const; 37 36 38 private: 37 39 Bool_t fReadyToSave; // should be set to true if the contents of the container is changed somehow 40 41 enum { 42 kIsSavedAsPrimitive = BIT(15) 43 }; 38 44 39 45 public: … … 67 73 virtual Bool_t IsReadyToSave() const { return fReadyToSave; } 68 74 virtual void SetReadyToSave(Bool_t flag=kTRUE) { fReadyToSave=flag; } 75 virtual Bool_t IsSavedAsPrimitive() const { return TestBit(kIsSavedAsPrimitive); } 69 76 70 77 TMethodCall *GetterMethod(const char *name) const; -
trunk/MagicSoft/Mars/mbase/MParList.cc
r1476 r1477 666 666 // gui elements to a macro-file. 667 667 // 668 void MParList::S avePrimitive(ofstream &out, Option_t *o)668 void MParList::StreamPrimitive(ofstream &out) const 669 669 { 670 670 out << " MParList " << ToLower(fName) << "(\""; … … 677 677 { 678 678 cont->SavePrimitive(out, ""); 679 679 680 out << " " << ToLower(fName) << ".AddToList(&"; 680 681 out << ToLower(cont->GetName()) << ");" << endl << endl; … … 691 692 { 692 693 MParContainer::SetNames(arr); 693 cout << fContainer << endl; 694 // fContainer->ForEach(MParContainer, SetNames)(arr); 695 TIter Next(fContainer); 696 697 MParContainer *cont = NULL; 698 while ((cont=(MParContainer*)Next())) 699 { 700 cout << cont << " " << cont->GetName() << endl; 701 cont->SetNames(arr); 702 } 703 704 } 705 694 fContainer->ForEach(MParContainer, SetNames)(arr); 695 } 696 -
trunk/MagicSoft/Mars/mbase/MParList.h
r1474 r1477 32 32 33 33 enum { kIsOwner = BIT(14) }; 34 35 void StreamPrimitive(ofstream &out) const; 34 36 35 37 public: … … 78 80 79 81 void Print(Option_t *t = NULL) const; 80 void SavePrimitive(ofstream &out, Option_t *o="");81 82 82 83 void GetNames(TObjArray &arr) const; -
trunk/MagicSoft/Mars/mbase/MTask.cc
r1476 r1477 265 265 // -------------------------------------------------------------------------- 266 266 // 267 // Implementation of SavePrimitive. Used to write the call to a constructor268 // to a macro. In the original root implementation it is used to write269 // gui elements to a macro-file.270 // 271 void MTask::SavePrimitive(ofstream &out, Option_t *o )267 // First call MParContainer::SavePrimitive which should stream the primitive 268 // to the output stream. Then, if a filter is set, stream first the filter 269 // and afterwards set the filter for this task. 270 // 271 void MTask::SavePrimitive(ofstream &out, Option_t *o="") 272 272 { 273 273 MParContainer::SavePrimitive(out); 274 if (fFilter) 275 out << " " << ToLower(fName) << ".SetFilter(&" << ToLower(fFilter->GetName()) <<");" << endl; 276 } 274 if (!fFilter) 275 return; 276 277 /* 278 If we don't stream filter which are not in the task list itself 279 (which means: alrteady streamed) we may be able to use the 280 primitive streamer as some kind of validity check for the macros 281 282 fFilter->SavePrimitive(out); 283 out << " " << ToLower(fName) << ".SetFilter(&" << ToLower(fFilter->GetName()) <<");" << endl; 284 */ 285 } -
trunk/MagicSoft/Mars/mbase/MTask.h
r1474 r1477 22 22 { 23 23 private: 24 TList *fListOfBranches; // List of Branch names for auto enabeling scheme24 TList *fListOfBranches; //! List of Branch names for auto enabeling scheme 25 25 26 26 const MFilter *fFilter; // Filter for conditional task execution 27 27 28 Bool_t fIsPreprocessed; // Indicates the success of the PreProcessing (set by MTaskList)29 UInt_t fNumExecutions; // Number of Excutions28 Bool_t fIsPreprocessed; //! Indicates the success of the PreProcessing (set by MTaskList) 29 UInt_t fNumExecutions; //! Number of Excutions 30 30 31 31 virtual Bool_t PreProcess(MParList *pList); … … 71 71 const MFilter *GetFilter() const { return fFilter; } 72 72 virtual void PrintStatistics(const Int_t lvl=0) const; 73 virtual void SavePrimitive(ofstream &out, Option_t *o="");74 73 75 74 UInt_t GetNumExecutions() { return fNumExecutions; } … … 83 82 const TList *GetListOfBranches() const { return fListOfBranches; } 84 83 85 ClassDef(MTask, 0) //Abstract base class for a task 84 void SavePrimitive(ofstream &out, Option_t *o=""); 85 86 ClassDef(MTask, 1) //Abstract base class for a task 86 87 }; 87 88 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r1476 r1477 520 520 // gui elements to a macro-file. 521 521 // 522 void MTaskList::S avePrimitive(ofstream &out, Option_t *o)522 void MTaskList::StreamPrimitive(ofstream &out) const 523 523 { 524 524 out << " MTaskList " << ToLower(fName) << "(\""; -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r1474 r1477 33 33 Bool_t CheckClassForProcess(TClass *cls); 34 34 35 void StreamPrimitive(ofstream &out) const; 36 35 37 public: 36 38 MTaskList(const char *name=NULL, const char *title=NULL); … … 56 58 void SetOwner(Bool_t enable=kTRUE); 57 59 58 void SavePrimitive(ofstream &out, Option_t *o="");59 60 60 const TList *GetList() const { return fTasks; } 61 61
Note:
See TracChangeset
for help on using the changeset viewer.