Changeset 959 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 10/02/01 14:46:56 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/BaseLinkDef.h
r858 r959 31 31 #pragma link C++ class MInputStreamID; 32 32 33 #pragma link C++ class MClone; 34 33 35 #pragma link C++ class MReadTree; 34 36 #pragma link C++ class MWriteFile; -
trunk/MagicSoft/Mars/mbase/MEvtLoop.cc
r887 r959 81 81 MEvtLoop::~MEvtLoop() 82 82 { 83 if (TestBit(kIsOwner) && fParList) 84 delete fParList; 85 } 86 87 // -------------------------------------------------------------------------- 88 // 89 // if you set the Eventloop as owner the destructor of the given parameter 90 // list is calles by the destructor of MEvtLoop, otherwise not. 91 // 92 inline void MEvtLoop::SetOwner(Bool_t enable=kTRUE) 93 { 94 enable ? SetBit(kIsOwner) : ResetBit(kIsOwner); 83 95 } 84 96 -
trunk/MagicSoft/Mars/mbase/MEvtLoop.h
r867 r959 27 27 MTaskList *fTaskList; 28 28 29 enum { kIsOwner = BIT(14) }; 30 29 31 public: 30 32 MEvtLoop(); 31 33 virtual ~MEvtLoop(); 32 34 33 void SetParList(MParList *p) { fParList = p; } 35 void SetParList(MParList *p) { fParList = p; } 36 MParList *GetParList() const { return fParList; } 37 38 void SetOwner(Bool_t enable=kTRUE); 34 39 35 40 Bool_t PreProcess(const char *tlist="MTaskList"); -
trunk/MagicSoft/Mars/mbase/MParList.cc
r905 r959 81 81 // -------------------------------------------------------------------------- 82 82 // 83 // If the 'IsOwner' bit is set (via SetOwner()) all containers are deleted 84 // by the destructor 85 // 86 MParList::~MParList() 87 { 88 if (TestBit(kIsOwner)) 89 fContainer.SetOwner(); 90 } 91 92 // -------------------------------------------------------------------------- 93 // 94 // If the 'IsOwner' bit is set (via SetOwner()) all containers are deleted 95 // by the destructor 96 // 97 inline void MParList::SetOwner(Bool_t enable=kTRUE) 98 { 99 enable ? SetBit(kIsOwner) : ResetBit(kIsOwner); 100 } 101 102 // -------------------------------------------------------------------------- 103 // 83 104 // Set the logging streamer of the parameter list and all contained 84 105 // parameter containers -
trunk/MagicSoft/Mars/mbase/MParList.h
r891 r959 32 32 static TString GetObjectName(const char *classname, const char *objname); 33 33 34 enum { kIsOwner = BIT(14) }; 35 34 36 public: 35 37 MParList(const char *name=NULL, const char *title=NULL); 36 38 MParList(MParList &ts); 37 39 38 ~MParList() 39 { 40 } 40 ~MParList(); 41 41 42 42 Bool_t AddToList(MParContainer *obj, MParContainer *where = NULL); … … 57 57 void SetReadyToSave(Bool_t flag=kTRUE); 58 58 59 void SetOwner(Bool_t enable=kTRUE); 60 59 61 void Print(Option_t *t = NULL); 60 62 -
trunk/MagicSoft/Mars/mbase/MTaskList.cc
r887 r959 80 80 // -------------------------------------------------------------------------- 81 81 // 82 // If the 'IsOwner' bit is set (via SetOwner()) all tasks are deleted 83 // by the destructor 84 // 85 MTaskList::~MTaskList() 86 { 87 if (TestBit(kIsOwner)) 88 fTasks.SetOwner(); 89 } 90 91 // -------------------------------------------------------------------------- 92 // 93 // If the 'IsOwner' bit is set (via SetOwner()) all containers are deleted 94 // by the destructor 95 // 96 inline void MTaskList::SetOwner(Bool_t enable=kTRUE) 97 { 98 enable ? SetBit(kIsOwner) : ResetBit(kIsOwner); 99 } 100 101 102 // -------------------------------------------------------------------------- 103 // 82 104 // Set the logging stream for the all tasks in the list and the tasklist 83 105 // itself. … … 169 191 // -------------------------------------------------------------------------- 170 192 // 193 // Find an object in the list. 194 // 'name' is the name of the object you are searching for. 195 // 196 TObject *MTaskList::FindObject(const char *name) const 197 { 198 return fTasks.FindObject(name); 199 } 200 201 // -------------------------------------------------------------------------- 202 // 203 // check if the object is in the list or not 204 // 205 TObject *MTaskList::FindObject(TObject *obj) const 206 { 207 return fTasks.FindObject(obj); 208 } 209 210 // -------------------------------------------------------------------------- 211 // 171 212 // do pre processing (before eventloop) of all tasks in the task-list 172 213 // … … 187 228 // loop over all tasks for preproccesing 188 229 // 189 while ( (task=(MTask*)Next()))230 while ((task=(MTask*)Next())) 190 231 { 191 232 *fLog << task->GetName() << "... " << flush; -
trunk/MagicSoft/Mars/mbase/MTaskList.h
r860 r959 27 27 MParList *fParList; 28 28 29 enum { kIsOwner = BIT(14) }; 30 29 31 public: 30 32 MTaskList(const char *name=NULL, const char *title=NULL); 33 MTaskList(MTaskList &ts); 31 34 32 MTaskList(MTaskList &ts);35 ~MTaskList(); 33 36 34 37 void SetLogStream(MLog *log); 35 38 36 39 Bool_t AddToList(MTask *task, const char *tType="All", MTask *where = NULL); 40 41 TObject *FindObject(const char *name) const; 42 TObject *FindObject(TObject *obj) const; 37 43 38 44 Bool_t PreProcess(MParList *pList); … … 41 47 42 48 void Print(Option_t *opt = ""); 49 void SetOwner(Bool_t enable=kTRUE); 43 50 44 51 ClassDef(MTaskList, 0) //collection of tasks to be performed in the eventloop -
trunk/MagicSoft/Mars/mbase/Makefile
r858 r959 49 49 MLog.cc \ 50 50 MHtml.cc \ 51 MClone.cc \ 51 52 MLogManip.cc 52 53
Note:
See TracChangeset
for help on using the changeset viewer.