Changeset 754 for trunk/MagicSoft/Mars
- Timestamp:
- 04/19/01 11:17:19 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParList.cc
r752 r754 152 152 // 'name' is the name of the object you are searching for. 153 153 // If the object doesn't exist we try to create one from the 154 // dictionary. If this isn't possible NULL is returned 154 // dictionary. If this isn't possible NULL is returned. 155 // 156 // By default (you don't specify an object name) the object name is 157 // the same as the classname 158 // 159 // If the classname (default classname) is of the structure 160 // "Name;something" - containing a semicolon - evarything which is 161 // after the last appearance of a semicolon is stripped to get the 162 // Name of the Class. Normally this is used to number your objects. 163 // "Name;1", "Name;2", ... 155 164 // 156 165 MParContainer *MParList::FindCreateObj(const char *classname, const char *objname) … … 164 173 165 174 // 175 // Check if the classname is a 'numbered' name (like: "MTime;2") 176 // if so strip the number from the classname. 177 // 178 // Becareful: We check for the last occurance of a ';' only and we 179 // also don't check if a number follows or something else. 180 // 181 // Rem: I use a TString to make the code more readyble and to get 182 // the new object deleted automatically 183 // 184 TString cname(classname); 185 const char *semicolon = strrchr(cname, ';'); 186 187 if (semicolon) 188 cname.Remove(semicolon-cname); 189 190 // 166 191 // Try to find a object with this object name which is already 167 192 // in the List. If we can find one we are done. … … 175 200 // if object is not existing in the list try to create one 176 201 // 177 *fLog << dbginf << " '" << classname << "' not found... creating." << endl;202 *fLog << dbginf << "Object '" << objname << "' of type '" << cname << "' not found... creating." << endl; 178 203 179 204 // 180 205 // try to get class from root environment 181 206 // 182 TClass *cls = gROOT->GetClass(c lassname);207 TClass *cls = gROOT->GetClass(cname); 183 208 184 209 if (!cls) … … 187 212 // if class is not existing in the root environment 188 213 // 189 *fLog << dbginf << "Class '" << c lassname << "' not existing in dictionary." << endl;214 *fLog << dbginf << "Class '" << cname << "' not existing in dictionary." << endl; 190 215 return NULL; 191 216 }
Note:
See TracChangeset
for help on using the changeset viewer.